Added: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java?rev=603323&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java (added) +++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java Tue Dec 11 10:31:25 2007 @@ -0,0 +1,507 @@ +/******************************************************************************* + * 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. + *******************************************************************************/ +package org.ofbiz.ebay; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javolution.util.FastList; +import javolution.util.FastMap; + +import org.ofbiz.base.util.Debug; +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.GenericDelegator; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.condition.EntityExpr; +import org.ofbiz.entity.condition.EntityOperator; +import org.ofbiz.service.DispatchContext; +import org.ofbiz.service.ServiceUtil; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +public class ProductsExportToEbay { + + private static final String resource = "EbayUiLabels"; + private static final String module = ProductsExportToEbay.class.getName(); + + public static Map exportToEbay(DispatchContext dctx, Map context) { + Locale locale = (Locale) context.get("locale"); + try { + String configString = "ebayExport.properties"; + + // get the Developer Key + String devID = UtilProperties.getPropertyValue(configString, "eBayExport.devID"); + + // get the Application Key + String appID = UtilProperties.getPropertyValue(configString, "eBayExport.appID"); + + // get the Certifcate Key + String certID = UtilProperties.getPropertyValue(configString, "eBayExport.certID"); + + // get the Token + String token = UtilProperties.getPropertyValue(configString, "eBayExport.token"); + + // get the Compatibility Level + String compatibilityLevel = UtilProperties.getPropertyValue(configString, "eBayExport.compatibilityLevel"); + + // get the Site ID + String siteID = UtilProperties.getPropertyValue(configString, "eBayExport.siteID"); + + // get the xmlGatewayUri + String xmlGatewayUri = UtilProperties.getPropertyValue(configString, "eBayExport.xmlGatewayUri"); + + StringBuffer dataItemsXml = new StringBuffer(); + + /* + String itemId = ""; + if (!ServiceUtil.isFailure(buildAddTransactionConfirmationItemRequest(context, dataItemsXml, token, itemId))) { + Map result = postItem(xmlGatewayUri, dataItemsXml, devID, appID, certID, "AddTransactionConfirmationItem"); + Debug.logInfo(result.toString(), module); + } + */ + + if (!ServiceUtil.isFailure(buildDataItemsXml(dctx, context, dataItemsXml, token))) { + Map result = postItem(xmlGatewayUri, dataItemsXml, devID, appID, certID, "AddItem", compatibilityLevel, siteID); + if (ServiceUtil.isFailure(result)) { + return ServiceUtil.returnFailure(ServiceUtil.getErrorMessage(result)); + } + } + } catch (Exception e) { + Debug.logError("Exception in exportToEbay " + e, module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionInExportToEbay", locale)); + } + return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "productsExportToEbay.productItemsSentCorrecltyToEbay", locale)); + } + + private static void appendRequesterCredentials(Element elem, Document doc, String token) { + Element requesterCredentialsElem = UtilXml.addChildElement(elem, "RequesterCredentials", doc); + UtilXml.addChildElementValue(requesterCredentialsElem, "eBayAuthToken", token, doc); + } + + private static String toString(InputStream inputStream) throws IOException { + String string; + StringBuilder outputBuilder = new StringBuilder(); + if (inputStream != null) { + BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); + while (null != (string = reader.readLine())) { + outputBuilder.append(string).append('\n'); + } + } + return outputBuilder.toString(); + } + + private static Map postItem(String postItemsUrl, StringBuffer dataItems, String devID, String appID, String certID, + String callName, String compatibilityLevel, String siteID) throws IOException { + if (Debug.verboseOn()) { + Debug.logVerbose("Request of " + callName + " To eBay:\n" + dataItems.toString(), module); + } + + HttpURLConnection connection = (HttpURLConnection)(new URL(postItemsUrl)).openConnection(); + connection.setDoInput(true); + connection.setDoOutput(true); + connection.setRequestMethod("POST"); + connection.setRequestProperty("X-EBAY-API-COMPATIBILITY-LEVEL", compatibilityLevel); + connection.setRequestProperty("X-EBAY-API-DEV-NAME", devID); + connection.setRequestProperty("X-EBAY-API-APP-NAME", appID); + connection.setRequestProperty("X-EBAY-API-CERT-NAME", certID); + connection.setRequestProperty("X-EBAY-API-CALL-NAME", callName); + connection.setRequestProperty("X-EBAY-API-SITEID", siteID); + connection.setRequestProperty("Content-Type", "text/xml"); + + OutputStream outputStream = connection.getOutputStream(); + outputStream.write(dataItems.toString().getBytes()); + outputStream.close(); + + int responseCode = connection.getResponseCode(); + InputStream inputStream; + Map result = FastMap.newInstance(); + String response = null; + + if (responseCode == HttpURLConnection.HTTP_CREATED || + responseCode == HttpURLConnection.HTTP_OK) { + inputStream = connection.getInputStream(); + response = toString(inputStream); + result = ServiceUtil.returnSuccess(response); + } else { + inputStream = connection.getErrorStream(); + response = toString(inputStream); + result = ServiceUtil.returnFailure(response); + } + + if (Debug.verboseOn()) { + Debug.logVerbose("Response of " + callName + " From eBay:\n" + response, module); + } + + return result; + } + + private static Map buildDataItemsXml(DispatchContext dctx, Map context, StringBuffer dataItemsXml, String token) { + Locale locale = (Locale)context.get("locale"); + try { + GenericDelegator delegator = dctx.getDelegator(); + List selectResult = (List)context.get("selectResult"); + + // Get the list of products to be exported to eBay + List productsList = delegator.findByCondition("Product", new EntityExpr("productId", EntityOperator.IN, selectResult), null, null); + + try { + Document itemDocument = UtilXml.makeEmptyXmlDocument("AddItemRequest"); + Element itemRequestElem = itemDocument.getDocumentElement(); + itemRequestElem.setAttribute("xmlns", "urn:ebay:apis:eBLBaseComponents"); + + appendRequesterCredentials(itemRequestElem, itemDocument, token); + + // Iterate the product list getting all the relevant data + Iterator productsListItr = productsList.iterator(); + while(productsListItr.hasNext()) { + GenericValue prod = (GenericValue)productsListItr.next(); + String title = parseText(prod.getString("internalName")); + String description = parseText(prod.getString("internalName")); + String qnt = (String)context.get("qnt"); + + Element itemElem = UtilXml.addChildElement(itemRequestElem, "Item", itemDocument); + UtilXml.addChildElementValue(itemElem, "Country", (String)context.get("country"), itemDocument); + UtilXml.addChildElementValue(itemElem, "Location", (String)context.get("location"), itemDocument); + UtilXml.addChildElementValue(itemElem, "Currency", "USD", itemDocument); + UtilXml.addChildElementValue(itemElem, "SKU", prod.getString("productId"), itemDocument); + UtilXml.addChildElementValue(itemElem, "Title", title, itemDocument); + UtilXml.addChildElementValue(itemElem, "Description", description, itemDocument); + UtilXml.addChildElementValue(itemElem, "ListingDuration", (String)context.get("listingDuration"), itemDocument); + UtilXml.addChildElementValue(itemElem, "Quantity", qnt, itemDocument); + UtilXml.addChildElementValue(itemElem, "UseTaxTable", "true", itemDocument); + + setPaymentMethodAccepted(itemDocument, itemElem, context); + + String categoryCode = (String)context.get("ebayCategory"); + String categoryParent = ""; + String levelLimit = ""; + + if (categoryCode != null) { + String[] params = categoryCode.split("_"); + + if (params == null || params.length != 3) { + ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.parametersNotCorrectInGetEbayCategories", locale)); + } else { + categoryParent = params[1]; + levelLimit = params[2]; + } + } + + Element primaryCatElem = UtilXml.addChildElement(itemElem, "PrimaryCategory", itemDocument); + UtilXml.addChildElementValue(primaryCatElem, "CategoryID", categoryParent, itemDocument); + + Element startPriceElem = UtilXml.addChildElementValue(itemElem, "StartPrice", (String)context.get("startPrice"), itemDocument); + startPriceElem.setAttribute("currencyID", "USD"); + } + + dataItemsXml.append(UtilXml.writeXmlDocument(itemDocument)); + } catch (Exception e) { + Debug.logError("Exception during building data items to eBay", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingDataItemsToEbay", locale)); + } + } catch (Exception e) { + Debug.logError("Exception during building data items to eBay", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingDataItemsToEbay", locale)); + } + return ServiceUtil.returnSuccess(); + } + + private static Map buildCategoriesXml(Map context, StringBuffer dataItemsXml, String token, String siteID, String categoryParent, String levelLimit) { + Locale locale = (Locale)context.get("locale"); + try { + Document itemRequest = UtilXml.makeEmptyXmlDocument("GetCategoriesRequest"); + Element itemRequestElem = itemRequest.getDocumentElement(); + itemRequestElem.setAttribute("xmlns", "urn:ebay:apis:eBLBaseComponents"); + + appendRequesterCredentials(itemRequestElem, itemRequest, token); + + UtilXml.addChildElementValue(itemRequestElem, "DetailLevel", "ReturnAll", itemRequest); + UtilXml.addChildElementValue(itemRequestElem, "CategorySiteID", siteID, itemRequest); + + if (UtilValidate.isNotEmpty(categoryParent)) { + UtilXml.addChildElementValue(itemRequestElem, "CategoryParent", categoryParent, itemRequest); + } + + if (UtilValidate.isEmpty(levelLimit)) { + levelLimit = "1"; + } + + UtilXml.addChildElementValue(itemRequestElem, "LevelLimit", levelLimit, itemRequest); + UtilXml.addChildElementValue(itemRequestElem, "ViewAllNodes", "true", itemRequest); + + dataItemsXml.append(UtilXml.writeXmlDocument(itemRequest)); + } catch (Exception e) { + Debug.logError("Exception during building data items to eBay", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingGetCategoriesRequest", locale)); + } + return ServiceUtil.returnSuccess(); + } + + private static Map buildSetTaxTableRequestXml(DispatchContext dctx, Map context, StringBuffer setTaxTableRequestXml, String token) { + Locale locale = (Locale)context.get("locale"); + try { + Document taxRequestDocument = UtilXml.makeEmptyXmlDocument("SetTaxTableRequest"); + Element taxRequestElem = taxRequestDocument.getDocumentElement(); + taxRequestElem.setAttribute("xmlns", "urn:ebay:apis:eBLBaseComponents"); + + appendRequesterCredentials(taxRequestElem, taxRequestDocument, token); + + Element taxTableElem = UtilXml.addChildElement(taxRequestElem, "TaxTable", taxRequestDocument); + Element taxJurisdictionElem = UtilXml.addChildElement(taxTableElem, "TaxJurisdiction", taxRequestDocument); + + UtilXml.addChildElementValue(taxJurisdictionElem, "JurisdictionID", "NY", taxRequestDocument); + UtilXml.addChildElementValue(taxJurisdictionElem, "SalesTaxPercent", "4.25", taxRequestDocument); + UtilXml.addChildElementValue(taxJurisdictionElem, "ShippingIncludedInTax", "false", taxRequestDocument); + + setTaxTableRequestXml.append(UtilXml.writeXmlDocument(taxRequestDocument)); + } catch (Exception e) { + Debug.logError("Exception during building request set tax table to eBay", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingRequestSetTaxTableToEbay", locale)); + } + return ServiceUtil.returnSuccess(); + } + + private static Map buildAddTransactionConfirmationItemRequest(Map context, StringBuffer dataItemsXml, String token, String itemId) { + Locale locale = (Locale)context.get("locale"); + try { + Document transDoc = UtilXml.makeEmptyXmlDocument("AddTransactionConfirmationItemRequest"); + Element transElem = transDoc.getDocumentElement(); + transElem.setAttribute("xmlns", "urn:ebay:apis:eBLBaseComponents"); + + appendRequesterCredentials(transElem, transDoc, token); + + UtilXml.addChildElementValue(transElem, "ItemID", itemId, transDoc); + UtilXml.addChildElementValue(transElem, "ListingDuration", "Days_1", transDoc); + Element negotiatePriceElem = UtilXml.addChildElementValue(transElem, "NegotiatedPrice", "50.00", transDoc); + negotiatePriceElem.setAttribute("currencyID", "USD"); + UtilXml.addChildElementValue(transElem, "RecipientRelationType", "1", transDoc); + UtilXml.addChildElementValue(transElem, "RecipientUserID", "buyer_anytime", transDoc); + + dataItemsXml.append(UtilXml.writeXmlDocument(transDoc)); + Debug.logInfo(dataItemsXml.toString(), module); + } catch (Exception e) { + Debug.logError("Exception during building AddTransactionConfirmationItemRequest eBay", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionDuringBuildingAddTransactionConfirmationItemRequestToEbay", locale)); + } + return ServiceUtil.returnSuccess(); + } + + private static void setPaymentMethodAccepted(Document itemDocument, Element itemElem, Map context) { + String payPal = (String)context.get("paymentPayPal"); + String visaMC = (String)context.get("paymentVisaMC"); + String amEx = (String)context.get("paymentAmEx"); + String discover = (String)context.get("paymentDiscover"); + String ccAccepted = (String)context.get("paymentCCAccepted"); + String cashInPerson = (String)context.get("paymentCashInPerson"); + String cashOnPickup = (String)context.get("paymentCashOnPickup"); + String cod = (String)context.get("paymentCOD"); + String codPrePayDelivery = (String)context.get("paymentCODPrePayDelivery"); + String mocc = (String)context.get("paymentMOCC"); + String moneyXferAccepted = (String)context.get("paymentMoneyXferAccepted"); + String personalCheck = (String)context.get("paymentPersonalCheck"); + + // PayPal + if (UtilValidate.isNotEmpty(payPal) && "on".equals(payPal)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "PayPal", itemDocument); + UtilXml.addChildElementValue(itemElem, "PayPalEmailAddress", (String)context.get("payPalEmail"), itemDocument); + } + // Visa/Master Card + if (UtilValidate.isNotEmpty(visaMC) && "on".equals(visaMC)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "VisaMC", itemDocument); + } + // American Express + if (UtilValidate.isNotEmpty(amEx) && "on".equals(amEx)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "AmEx", itemDocument); + } + // Discover + if (UtilValidate.isNotEmpty(discover) && "on".equals(discover)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "Discover", itemDocument); + } + // Credit Card Accepted + if (UtilValidate.isNotEmpty(ccAccepted) && "on".equals(ccAccepted)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "CCAccepted", itemDocument); + } + // Cash In Person + if (UtilValidate.isNotEmpty(cashInPerson) && "on".equals(cashInPerson)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "CashInPerson", itemDocument); + } + // Cash on Pickup + if (UtilValidate.isNotEmpty(cashOnPickup) && "on".equals(cashOnPickup)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "CashOnPickup", itemDocument); + } + // Cash on Delivery + if (UtilValidate.isNotEmpty(cod) && "on".equals(cod)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "COD", itemDocument); + } + // Cash On Delivery After Paid + if (UtilValidate.isNotEmpty(codPrePayDelivery) && "on".equals(codPrePayDelivery)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "CODPrePayDelivery", itemDocument); + } + // Money order/cashiers check + if (UtilValidate.isNotEmpty(mocc) && "on".equals(mocc)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "MOCC", itemDocument); + } + // Direct transfer of money + if (UtilValidate.isNotEmpty(moneyXferAccepted) && "on".equals(moneyXferAccepted)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "MoneyXferAccepted", itemDocument); + } + // Personal Check + if (UtilValidate.isNotEmpty(personalCheck) && "on".equals(personalCheck)) { + UtilXml.addChildElementValue(itemElem, "PaymentMethods", "PersonalCheck", itemDocument); + } + } + + public static Map getEbayCategories(DispatchContext dctx, Map context) { + Locale locale = (Locale) context.get("locale"); + String categoryCode = (String)context.get("categoryCode"); + Map result = null; + + try { + String configString = "ebayExport.properties"; + + // get the Developer Key + String devID = UtilProperties.getPropertyValue(configString, "eBayExport.devID"); + + // get the Application Key + String appID = UtilProperties.getPropertyValue(configString, "eBayExport.appID"); + + // get the Certifcate Key + String certID = UtilProperties.getPropertyValue(configString, "eBayExport.certID"); + + // get the Token + String token = UtilProperties.getPropertyValue(configString, "eBayExport.token"); + + // get the Compatibility Level + String compatibilityLevel = UtilProperties.getPropertyValue(configString, "eBayExport.compatibilityLevel"); + + // get the Site ID + String siteID = UtilProperties.getPropertyValue(configString, "eBayExport.siteID"); + + // get the xmlGatewayUri + String xmlGatewayUri = UtilProperties.getPropertyValue(configString, "eBayExport.xmlGatewayUri"); + + String categoryParent = ""; + String levelLimit = ""; + + if (categoryCode != null) { + String[] params = categoryCode.split("_"); + + if (params == null || params.length != 3) { + ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.parametersNotCorrectInGetEbayCategories", locale)); + } else { + categoryParent = params[1]; + levelLimit = params[2]; + Integer level = new Integer(levelLimit); + levelLimit = (level.intValue() + 1) + ""; + } + } + + StringBuffer dataItemsXml = new StringBuffer(); + + if (!ServiceUtil.isFailure(buildCategoriesXml(context, dataItemsXml, token, siteID, categoryParent, levelLimit))) { + Map resultCat = postItem(xmlGatewayUri, dataItemsXml, devID, appID, certID, "GetCategories", compatibilityLevel, siteID); + String successMessage = (String)resultCat.get("successMessage"); + if (successMessage != null) { + result = readEbayCategoriesResponse(successMessage, locale); + } else { + ServiceUtil.returnFailure(ServiceUtil.getErrorMessage(resultCat)); + } + } + } catch (Exception e) { + Debug.logError("Exception in GetEbayCategories " + e, module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToEbay.exceptionInGetEbayCategories", locale)); + } + return result; + } + + private static Map readEbayCategoriesResponse(String msg, Locale locale) { + Map results = null; + List categories = FastList.newInstance(); + try { + Document docResponse = UtilXml.readXmlDocument(msg, true); + Element elemResponse = docResponse.getDocumentElement(); + String ack = UtilXml.childElementValue(elemResponse, "Ack", "Failure"); + if (ack != null && "Failure".equals(ack)) { + String errorMessage = ""; + List errorList = UtilXml.childElementList(elemResponse, "Errors"); + Iterator errorElemIter = errorList.iterator(); + while (errorElemIter.hasNext()) { + Element errorElement = (Element) errorElemIter.next(); + errorMessage = UtilXml.childElementValue(errorElement, "ShortMessage", ""); + } + return ServiceUtil.returnFailure(errorMessage); + } else { + // retrieve Category Array + List categoryArray = UtilXml.childElementList(elemResponse, "CategoryArray"); + Iterator categoryArrayElemIter = categoryArray.iterator(); + while (categoryArrayElemIter.hasNext()) { + Element categoryArrayElement = (Element)categoryArrayElemIter.next(); + + // retrieve Category + List category = UtilXml.childElementList(categoryArrayElement, "Category"); + Iterator categoryElemIter = category.iterator(); + while (categoryElemIter.hasNext()) { + Map categ = FastMap.newInstance(); + Element categoryElement = (Element)categoryElemIter.next(); + + String categoryCode = ("true".equalsIgnoreCase((UtilXml.childElementValue(categoryElement, "LeafCategory", "").trim())) ? "Y" : "N") + "_" + + UtilXml.childElementValue(categoryElement, "CategoryID", "").trim() + "_" + + UtilXml.childElementValue(categoryElement, "CategoryLevel", "").trim(); + categ.put("CategoryCode", categoryCode); + categ.put("CategoryName", UtilXml.childElementValue(categoryElement, "CategoryName")); + categories.add(categ); + } + } + categories = UtilMisc.sortMaps(categories, UtilMisc.toList("CategoryName")); + results = UtilMisc.toMap("categories", categories); + } + } catch (Exception e) { + return ServiceUtil.returnFailure(); + } + return results; + } + + private static String parseText(String text) { + Pattern htmlPattern = Pattern.compile("[<](.+?)[>]"); + Pattern tabPattern = Pattern.compile("\\s"); + if (null != text && text.length() > 0){ + Matcher matcher = htmlPattern.matcher(text); + text = matcher.replaceAll(""); + matcher = tabPattern.matcher(text); + text = matcher.replaceAll(" "); + } else { + text = ""; + } + return text; + } +} Propchange: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java ------------------------------------------------------------------------------ svn:executable = * Propchange: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/productsExportToEbay.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/productsExportToEbay.bsh?rev=603323&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/productsExportToEbay.bsh (added) +++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/productsExportToEbay.bsh Tue Dec 11 10:31:25 2007 @@ -0,0 +1,30 @@ +/* + * 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; + +categoryCode = parameters.get("categoryCode"); +userLogin = parameters.get("userLogin"); + +results = dispatcher.runSync("getEbayCategories", UtilMisc.toMap("categoryCode", categoryCode, "userLogin", userLogin)); + +if (results.get("categories") != null) { + context.put("categories", results.get("categories")); +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/productsExportToEbay.bsh ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/productsExportToEbay.bsh ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/actions/find/productsExportToEbay.bsh ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml?rev=603323&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml (added) +++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml Tue Dec 11 10:31:25 2007 @@ -0,0 +1,80 @@ +<?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. +--> + +<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"/> + + <description>eBay Component Site Configuration File</description> + + <request-map uri="main"> + <security https="true" auth="true"/> + <response name="success" type="view" value="main"/> + </request-map> + + <request-map uri="ProductsExportToEbay"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ProductsExportToEbay"/> + </request-map> + + <request-map uri="PostProductsToEbay"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="exportToEbay"/> + <response name="success" type="view" value="ProductsExportToEbay"/> + <response name="error" type="view" value="ProductsExportToEbay"/> + </request-map> + + <request-map uri="ManageOrdersFromEbay"> + <response name="success" type="view" value="ManageOrdersFromEbay"/> + <response name="failure" type="view" value="ManageOrdersFromEbay"/> + </request-map> + + <request-map uri="ImportOrdersSearchFromEbay"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="importOrdersSearchFromEbay"/> + <response name="success" type="view" value="ManageOrdersFromEbay"/> + <response name="failure" type="view" value="ManageOrdersFromEbay"/> + </request-map> + + <request-map uri="ImportOrderFromEbay"> + <security https="true" auth="true"/> + <event type="service-multi" path="" invoke="importOrderFromEbay"/> + <response name="success" type="view" value="ManageOrdersFromEbay"/> + <response name="error" type="view" value="ManageOrdersFromEbay"/> + <response name="failure" type="view" value="ManageOrdersFromEbay"/> + </request-map> + + <request-map uri="setEbayOrderToComplete"> + <security https="true" auth="true"/> + <event type="service" invoke="setEbayOrderToComplete"/> + <response name="success" type="view" value="ManageOrdersFromEbay"/> + <response name="failure" type="view" value="ManageOrdersFromEbay"/> + </request-map> + <!-- end of request mappings --> + + <!-- View Mappings --> + <view-map name="main" type="screen" page="component://ebay/widget/EbayScreens.xml#advancedsearch"/> + <view-map name="advancedsearch" type="screen" page="component://ebay/widget/EbayScreens.xml#advancedsearch"/> + <view-map name="keywordsearch" type="screen" page="component://ebay/widget/EbayScreens.xml#keywordsearch"/> + <view-map name="ProductsExportToEbay" type="screen" page="component://ebay/widget/EbayScreens.xml#ProductsExportToEbay"/> + <view-map name="ManageOrdersFromEbay" type="screen" page="component://ebay/widget/EbayScreens.xml#ManageOrdersFromEbay"/> + <view-map name="ListOrdersFromEbay" type="screen" page="component://ebay/widget/EbayScreens.xml#ListOrdersFromEbay"/> + <!-- end of view mappings --> +</site-conf> Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml ------------------------------------------------------------------------------ svn:executable = * Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/web.xml?rev=603323&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/web.xml (added) +++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/web.xml Tue Dec 11 10:31:25 2007 @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> +<!-- +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. +--> + +<web-app> + <display-name>Open For Business - Google Base</display-name> + <description>eBay component of the Open For Business Project</description> + + <context-param> + <param-name>entityDelegatorName</param-name> + <param-value>default</param-value> + <description>The Name of the Entity Delegator to use, defined in entityengine.xml</description> + </context-param> + <context-param> + <param-name>localDispatcherName</param-name> + <param-value>ebay</param-value> + <description>A unique name used to identify/recognize the local dispatcher for the Service Engine</description> + </context-param> + <context-param> + <param-name>mainDecoratorLocation</param-name> + <param-value>component://ebay/widget/EbayScreens.xml</param-value> + <description>The location of the main-decorator screen to use for this webapp; referred to as a context variable in screen def XML files.</description> + </context-param> + + <filter> + <filter-name>ContextFilter</filter-name> + <display-name>ContextFilter</display-name> + <filter-class>org.ofbiz.webapp.control.ContextFilter</filter-class> + <init-param> + <param-name>disableContextSecurity</param-name> + <param-value>N</param-value> + </init-param> + <init-param> + <param-name>allowedPaths</param-name> + <param-value>/control:/select:/index.html:/index.jsp:/default.html:/default.jsp:/images:/includes/maincss.css</param-value> + </init-param> + <init-param> + <param-name>errorCode</param-name> + <param-value>403</param-value> + </init-param> + <init-param> + <param-name>redirectPath</param-name> + <param-value>/control/main</param-value> + </init-param> + </filter> + <filter-mapping> + <filter-name>ContextFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <listener><listener-class>org.ofbiz.webapp.control.ControlEventListener</listener-class></listener> + <listener><listener-class>org.ofbiz.webapp.control.LoginEventListener</listener-class></listener> + + <servlet> + <servlet-name>ControlServlet</servlet-name> + <display-name>ControlServlet</display-name> + <description>Main Control Servlet</description> + <servlet-class>org.ofbiz.webapp.control.ControlServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>ControlServlet</servlet-name> + <url-pattern>/control/*</url-pattern> + </servlet-mapping> + + <session-config> + <session-timeout>60</session-timeout> <!-- in minutes --> + </session-config> + + <welcome-file-list> + <welcome-file>index.jsp</welcome-file> + <welcome-file>index.html</welcome-file> + <welcome-file>index.htm</welcome-file> + </welcome-file-list> +</web-app> Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:executable = * Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl?rev=603323&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl (added) +++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl Tue Dec 11 10:31:25 2007 @@ -0,0 +1,29 @@ +<#-- +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. +--> + +<script language="JavaScript" type="text/javascript"> + function exportToEbay() { + document.products.action="<@ofbizUrl>ProductsExportToEbay</@ofbizUrl>"; + document.products.submit(); + } +</script> + +<#if productIds?has_content> + <a href="javascript:exportToEbay();" class="buttontext">${uiLabelMap.EbayExportToEbay}</a> +</#if> Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl?rev=603323&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl (added) +++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl Tue Dec 11 10:31:25 2007 @@ -0,0 +1,156 @@ +<#-- +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. +--> +<script language="JavaScript" type="text/javascript"> + function changeEbayCategory(categ, cat_desc) { + document.forms["ProductsExportToEbay"].action = "<@ofbizUrl>ProductsExportToEbay?categoryCode="+categ+"</@ofbizUrl>"; + document.forms["ProductsExportToEbay"].submit(); + } + + function activateSubmitButton() { + categ = document.forms["ProductsExportToEbay"].ebayCategory.value; + if (categ != null && categ.substring(0, 1) == 'Y') { + document.forms["ProductsExportToEbay"].submitButton.disabled = false; + } else { + document.forms["ProductsExportToEbay"].submitButton.disabled = true; + } + } +</script> +<div class="tabletext"> + <form method="post" action="<@ofbizUrl>PostProductsToEbay</@ofbizUrl>" name="ProductsExportToEbay"> + <table border="0" cellpadding="2" cellspacing="0"> + <tr> + <td align="right"><div class="tabletext">${uiLabelMap.FormFieldTitle_ebayCategory}</div></td> + <td> </td> + <td> + <input type="hidden" name="selectResult" value="${selectResult}"/> + <select class="selectBox" name="ebayCategory" onchange="changeEbayCategory(this.value, this.options[this.selectedIndex].text)"> + <#if categories?exists> + <#list categories as category> + <option value="${category.CategoryCode}">${category.CategoryName}</option> + </#list> + </#if> + </select> + </td> + </tr> + <tr> + <td align="right"><div class="tabletext">${uiLabelMap.CommonCountry}</div></td> + <td> </td> + <td> + <select class="selectBox" name="country"> + <#if countries?exists> + <#list countries as country> + <option <#if country.geoCode?has_content && country.geoCode == "US">selected="selected"</#if> value="${country.geoCode}">${country.get("geoName",locale)}</option> + </#list> + </#if> + </select> + </td> + </tr> + <tr> + <td align="right"><div class="tabletext">${uiLabelMap.FormFieldTitle_location}</div></td> + <td> </td> + <td> + <input type="text" name="location" size="50" maxlength="50"/> + </td> + </tr> + <tr> + <td align="right"><div class="tabletext">${uiLabelMap.FormFieldTitle_listingDuration}</div></td> + <td> </td> + <td> + <select class="selectBox" name="listingDuration"> + <option value="Days_1">1 ${uiLabelMap.CommonDay}</option> + <option value="Days_3">3 ${uiLabelMap.CommonDays}</option> + <option value="Days_7">7 ${uiLabelMap.CommonDays}</option> + </select> + </td> + </tr> + <tr> + <td align="right"><div class="tabletext">${uiLabelMap.FormFieldTitle_startPrice}</div></td> + <td> </td> + <td> + <input type="text" name="startPrice" size="12" maxlength="12" value="1.0"/> + </td> + </tr> + <tr> + <td align="right"><div class="tabletext">${uiLabelMap.FormFieldTitle_quantity}</div></td> + <td> </td> + <td> + <input type="text" name="qnt" size="12" maxlength="12" value="1"/> + </td> + </tr> + <tr> + <td align="center" colspan="3"><div class="tabletext">${uiLabelMap.FormFieldTitle_paymentMethodsAccepted}</div></td> + </tr> + <tr> + <td> </td> + </tr> + <tr> + <td colspan="3" class="tabletext"> + <table border="0" cellpadding="2" cellspacing="0"> + <tr> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentPayPal}</td> + <td width="2%"><input type="checkbox" name="paymentPayPal" checked="checked"/></td> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentVisaMC}</td> + <td width="2%"><input type="checkbox" name="paymentVisaMC" checked="checked"/></td> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentAmEx}</td> + <td width="2%"><input type="checkbox" name="paymentAmEx" checked="checked"/></td> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentDiscover}</td> + <td width="2%"><input type="checkbox" name="paymentDiscover" checked="checked"/></td> + </tr> + <tr> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentMOCC}</td> + <td width="2%"><input type="checkbox" name="paymentMOCC" checked="checked"/></td> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentPersonalCheck}</td> + <td width="2%"><input type="checkbox" name="paymentPersonalCheck" checked="checked"/></td> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentCCAccepted}</td> + <td width="2%"><input type="checkbox" name="paymentCCAccepted"/></td> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentCashInPerson}</td> + <td width="2%"><input type="checkbox" name="paymentCashInPerson"/></td> + </tr> + <tr> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentCashOnPickup}</td> + <td width="2%"><input type="checkbox" name="paymentCashOnPickup"/></td> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentCOD}</td> + <td width="2%"><input type="checkbox" name="paymentCOD"/></td> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentCODPrePayDelivery}</td> + <td width="2%"><input type="checkbox" name="paymentCODPrePayDelivery"/></td> + <td align="right" width="23%">${uiLabelMap.FormFieldTitle_paymentMoneyXferAccepted}</td> + <td width="2%"><input type="checkbox" name="paymentMoneyXferAccepted"/></td> + </tr> + </table> + </td> + </tr> + <tr> + <td align="right"><div class="tabletext">${uiLabelMap.FormFieldTitle_payPalEmail}</div></td> + <td> </td> + <td> + <input type="text" name="quantity" size="50" maxlength="50"/> + </td> + </tr> + <tr> + <td colspan=2> </td> + <td> + <input type="submit" value="${uiLabelMap.EbayExportToEbay}" name="submitButton" class="smallSubmit"> + </td> + </tr> + </table> + </form> + <script language="JavaScript" type="text/javascript"> + activateSubmitButton(); + </script> +</div> \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/index.jsp URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/index.jsp?rev=603323&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/index.jsp (added) +++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/index.jsp Tue Dec 11 10:31:25 2007 @@ -0,0 +1,19 @@ +<%-- +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. +--%> +<%response.sendRedirect("control/main");%> \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/index.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/index.jsp ------------------------------------------------------------------------------ svn:executable = * Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/index.jsp ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/index.jsp ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml?rev=603323&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml (added) +++ ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml Tue Dec 11 10:31:25 2007 @@ -0,0 +1,84 @@ +<?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. +--> + +<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"> + <form name="ManageOrdersFromEbay" type="single" target="ImportOrdersSearchFromEbay"> + <field name="productStoreId"> + <drop-down> + <entity-options entity-name="ProductStore" description="${storeName}" key-field-name="productStoreId"> + <entity-order-by field-name="storeName"/> + </entity-options> + </drop-down> + </field> + <field name="fromDate" title="${uiLabelMap.CommonFromDateTime}"><date-time default-value="${bsh: org.ofbiz.base.util.UtilDateTime.getDayStart(org.ofbiz.base.util.UtilDateTime.nowTimestamp())}"/></field> + <field name="thruDate" title="${uiLabelMap.CommonThruDateTime}"><date-time default-value="${bsh: org.ofbiz.base.util.UtilDateTime.getDayEnd(org.ofbiz.base.util.UtilDateTime.nowTimestamp())}"/></field> + <field name="submitButton" title="${uiLabelMap.EbayImportOrdersSearchFromEbay}"><submit button-type="button"/></field> + </form> + <form name="ListOrdersFromEbay" type="multi" use-row-submit="true" list-name="orderList" target="ImportOrderFromEbay"> + <row-actions> + <set field="canImportOrder" value="${bsh: org.ofbiz.base.util.UtilValidate.isEmpty(orderId) && org.ofbiz.base.util.UtilValidate.isEmpty(errorMessage)}" type="Boolean"/> + <set field="allowProductIdChange" value="${bsh: org.ofbiz.base.util.UtilValidate.isEmpty(orderId) && org.ofbiz.base.util.UtilValidate.isNotEmpty(errorMessage)}" type="Boolean"/> + </row-actions> + <field name="productStoreId"><hidden/></field> + <field name="externalId" title="${uiLabelMap.EbayImportEbayItem}"><display/></field> + <field name="transactionId"><display/></field> + <field name="orderId"><hyperlink target="orderview?orderId=${orderId}" description="${orderId}"/></field> + <field name="createdDate"><display/></field> + <!-- + <field name="productId" use-when="!${allowProductIdChange}"><display/></field> + <field name="productId" use-when="${allowProductIdChange}"><lookup target-form-name="LookupProduct"/></field> + --> + <field name="productId"><display/></field> + <field name="productName" entry-name="productId"><display-entity entity-name="Product" key-field-name="productId" description="${internalName}"/></field> + <field name="title"><display/></field> + <field name="quantityPurchased"><display/></field> + <field name="transactionPrice"><display/></field> + <field name="salesTaxAmount"><display/></field> + <field name="salesTaxPercent"><hidden/></field> + <field name="shippingServiceCost"><display/></field> + <field name="shippingTotalAdditionalCost"><display/></field> + <field name="amountPaid"><display/></field> + <field name="paidTime"><display/></field> + <field name="shippedTime"><display/></field> + <field name="paymentMethodUsed"><display/></field> + <field name="shippingService"><display/></field> + <field name="listingStatus"><display/></field> + <field name="eBayPaymentStatus"><display/></field> + <field name="checkoutStatus"><display/></field> + <field name="completeStatus"><display/></field> + <field name="buyerName"><display/></field> + <field name="shippingAddressStreet"><hidden/></field> + <field name="emailBuyer"><display/></field> + <field name="shippingAddressStreet2"><hidden/></field> + <field name="shippingAddressPhone"><hidden/></field> + <field name="shippingAddressStreet"><hidden/></field> + <field name="shippingAddressStreet1"><hidden/></field> + <field name="shippingAddressStreet2"><hidden/></field> + <field name="shippingAddressPostalCode"><hidden/></field> + <field name="shippingAddressCountry"><hidden/></field> + <field name="shippingAddressStateOrProvince"><hidden/></field> + <field name="shippingAddressCityName"><hidden/></field> + <field name="errorMessage"><display/></field> + <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}" use-when="${canImportOrder}"><check/></field> + <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}" use-when="!${canImportOrder}"><display/></field> + <field name="submitButton" title="${uiLabelMap.EbayImportOrdersFromEbay}" widget-style="smallSubmit"><submit/></field> + </form> +</forms> \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml ------------------------------------------------------------------------------ svn:executable = * Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayForms.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml?rev=603323&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml (added) +++ ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml Tue Dec 11 10:31:25 2007 @@ -0,0 +1,34 @@ +<?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. +--> +<menus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-menu.xsd"> + <menu name="EbayAppBar" default-menu-item-name="main" id="app-navigation" type="simple" title="${uiLabelMap.EbayApplication}" + default-selected-style="selected" selected-menuitem-context-field-name="headerItem"> + <menu-item name="export" title="${uiLabelMap.EbayExportToEbay}"><link target="advancedsearch"/></menu-item> + <menu-item name="importOrders" title="${uiLabelMap.EbayImportOrdersFromEbay}"><link target="ManageOrdersFromEbay"/></menu-item> + <menu-item name="Logout" title="Logout" align-style="col-right" selected-style="selected"> + <condition><not><if-empty field-name="userLogin"/></not></condition> + <link target="logout"/> + </menu-item> + <menu-item name="Login" title="Login" align-style="col-right" selected-style="selected"> + <condition><if-empty field-name="userLogin"/></condition> + <link target="${checkLoginUrl}"/> + </menu-item> + </menu> +</menus> Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml ------------------------------------------------------------------------------ svn:executable = * Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayMenus.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml?rev=603323&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml (added) +++ ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml Tue Dec 11 10:31:25 2007 @@ -0,0 +1,171 @@ +<?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. +--> + +<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd"> + + <screen name="main-decorator"> + <section> + <actions> + <property-map resource="EbayUiLabels" map-name="uiLabelMap" global="true"/> + <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/> + <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> + <property-map resource="WorkEffortUiLabels" map-name="uiLabelMap" global="true"/> + <set field="activeApp" value="ebay" global="true"/> + + <!-- The two default (global) stylesheets are added to the list + of stylesheets to the first and second position --> + <set field="layoutSettings.styleSheets[+0]" value="/images/maincss.css" global="true"/> + <!-- The default (global) java scripts --> + <set field="layoutSettings.javaScripts[]" value="/images/calendar1.js" global="true"/> + <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> + <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> + + <set field="layoutSettings.companyName" from-field="uiLabelMap.EbayCompanyName" global="true"/> + <set field="layoutSettings.companySubtitle" from-field="uiLabelMap.EbayApplication" global="true"/> + <set field="applicationMenuName" value="EbayAppBar" global="true"/> + <set field="applicationMenuLocation" value="component://ebay/widget/EbayMenus.xml" global="true"/> + </actions> + <widgets> + <include-screen name="GlobalDecorator" location="component://common/widget/CommonScreens.xml"/> + </widgets> + </section> + </screen> + + <screen name="CommonFindDecorator"> + <section> + <actions> + <set field="headerItem" value="Ebay"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <section> + <condition> + <if-has-permission permission="EBAY" action="_VIEW"/> + </condition> + <widgets> + <decorator-section-include name="body"/> + </widgets> + <fail-widgets> + <label style="head3">${uiLabelMap.EbayViewPermissionError}</label> + </fail-widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + + <screen name="advancedsearch"> + <section> + <actions> + <set field="titleProperty" value="PageTitleAdvancedSearch"/> + + <entity-condition entity-name="ProductCategory" list-name="productCategories"> + <condition-expr field-name="showInSelect" operator="not-equals" value="N"/> + <order-by field-name="description"/> + </entity-condition> + <entity-condition entity-name="ProdCatalog" list-name="prodCatalogs"> + <order-by field-name="catalogName"/> + </entity-condition> + <script location="component://product/webapp/catalog/WEB-INF/actions/find/advancedsearchoptions.bsh"/> + </actions> + <widgets> + <decorator-screen name="CommonFindDecorator"> + <decorator-section name="body"> + <platform-specific> + <html><html-template location="component://product/webapp/catalog/find/advancedsearch.ftl"/></html> + </platform-specific> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + + <screen name="keywordsearch"> + <section> + <actions> + <set field="titleProperty" value="PageTitleSearchResults"/> + <script location="component://product/webapp/catalog/WEB-INF/actions/find/keywordsearch.bsh"/> + </actions> + <widgets> + <decorator-screen name="CommonFindDecorator"> + <decorator-section name="body"> + <platform-specific> + <html><html-template location="component://product/webapp/catalog/find/keywordsearch.ftl"/></html> + </platform-specific> + <platform-specific> + <html><html-template location="component://ebay/webapp/ebay/find/ebayExportLink.ftl"/></html> + </platform-specific> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + + <screen name="ProductsExportToEbay"> + <section> + <actions> + <set field="headerItem" value="ebay"/> + <set field="titleProperty" value="PageTitleEbayProductsExportToEbay"/> + <set field="selectResult" from-field="parameters.selectResult"/> + <entity-condition entity-name="Geo" list-name="countries"> + <condition-expr field-name="geoTypeId" value="COUNTRY"/> + <order-by field-name="geoName"/> + </entity-condition> + <script location="component://ebay/webapp/ebay/WEB-INF/actions/find/productsExportToEbay.bsh"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <container> + <label style="head1">${uiLabelMap.PageTitleEbayProductsExportToEbay}</label> + </container> + <platform-specific><html><html-template location="component://ebay/webapp/ebay/find/productsExportToEbay.ftl"/></html></platform-specific> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + + <screen name="ManageOrdersFromEbay"> + <section> + <actions> + <set field="titleProperty" value="EbayImportOrdersFromEbay"/> + <set field="orderList" from-field="parameters.orderList"/> + </actions> + <widgets> + <decorator-screen name="main-decorator"> + <decorator-section name="body"> + <container> + <label style="head1">${uiLabelMap.EbayImportOrdersSearchFromEbay}</label> + </container> + <include-form name="ManageOrdersFromEbay" location="component://ebay/widget/EbayForms.xml"/> + <container> + <label style="head1">${uiLabelMap.EbayImportOrdersFromEbay}</label> + </container> + <include-form name="ListOrdersFromEbay" location="component://ebay/widget/EbayForms.xml"/> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> +</screens> \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml ------------------------------------------------------------------------------ svn:executable = * Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml |
Free forum by Nabble | Edit this page |