Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java Thu Mar 24 07:23:42 2011 @@ -23,6 +23,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; +import java.math.BigDecimal; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; @@ -56,6 +57,7 @@ import org.ofbiz.service.ServiceUtil; import org.ofbiz.base.util.StringUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Node; public class ProductsExportToGoogle { @@ -83,8 +85,9 @@ public class ProductsExportToGoogle { if (token != null) { List<String> newProductsInGoogle = UtilGenerics.checkList(result.get("newProductsInGoogle"), String.class); List<String> productsRemovedFromGoogle = UtilGenerics.checkList(result.get("productsRemovedFromGoogle"), String.class); + String localeString = result.get("localeString").toString(); result = postItem(token, googleBaseConfigResult.get("postItemsUrl").toString(), googleBaseConfigResult.get("developerKey").toString(), dataItemsXml, - locale, (String)context.get("testMode"), newProductsInGoogle, productsRemovedFromGoogle, dispatcher, delegator); + locale, (String)context.get("testMode"), newProductsInGoogle, productsRemovedFromGoogle, dispatcher, delegator, localeString); } else { Debug.logError("Error during authentication to Google Account", module); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.errorDuringAuthenticationToGoogle", locale)); @@ -246,7 +249,7 @@ public class ProductsExportToGoogle { private static Map<String, Object> postItem(String token, String postItemsUrl, String developerKey, StringBuffer dataItems, Locale locale, String testMode, List<String> newProductsInGoogle, List<String> productsRemovedFromGoogle, - LocalDispatcher dispatcher, Delegator delegator) throws IOException { + LocalDispatcher dispatcher, Delegator delegator, String localeString) throws IOException { if (Debug.verboseOn()) { Debug.logVerbose("Request To Google Base :\n" + dataItems.toString(), module); } @@ -277,7 +280,7 @@ public class ProductsExportToGoogle { inputStream = connection.getInputStream(); response = toString(inputStream); if (UtilValidate.isNotEmpty(response)) { - result = readResponseFromGoogle(response, newProductsInGoogle, productsRemovedFromGoogle, dispatcher, delegator, locale); + result = readResponseFromGoogle(response, newProductsInGoogle, productsRemovedFromGoogle, dispatcher, delegator, locale, localeString); //String msg = ServiceUtil.getErrorMessage(result); if (ServiceUtil.isError(result)) { result = ServiceUtil.returnFailure(UtilGenerics.checkList(result.get(ModelService.ERROR_MESSAGE_LIST))); @@ -301,6 +304,9 @@ public class ProductsExportToGoogle { Locale locale = (Locale)context.get("locale"); List<String> newProductsInGoogle = FastList.newInstance(); List<String> productsRemovedFromGoogle = FastList.newInstance(); + String localeString = null; + String productStoreId = (String) context.get("productStoreId"); + try { Delegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); @@ -311,7 +317,56 @@ public class ProductsExportToGoogle { String trackingCodeId = (String)context.get("trackingCodeId"); String countryCode = (String)context.get("countryCode"); String webSiteMountPoint = (String)context.get("webSiteMountPoint"); - + //Tagging Links + String utmSource = null; + String utmMedium = null; + String utmTerm = null; + String utmContent = null; + String utmCampaign = null; + + if (UtilValidate.isNotEmpty(productStoreId)) { + GenericValue googleBaseConfig = null; + try { + googleBaseConfig = delegator.findOne("GoogleBaseConfig", false, UtilMisc.toMap("productStoreId", productStoreId)); + } catch (GenericEntityException e) { + Debug.logError("Unable to find value for GoogleBaseConfig", module); + e.printStackTrace(); + } + if (UtilValidate.isNotEmpty(googleBaseConfig)) { + String source = googleBaseConfig.getString("utmSource"); + String medium = googleBaseConfig.getString("utmMedium"); + String term = googleBaseConfig.getString("utmTerm"); + String content = googleBaseConfig.getString("utmContent"); + String campaign = googleBaseConfig.getString("utmCampaign"); + + if (UtilValidate.isNotEmpty(source)) { + utmSource = "?utm_source=" + source; + } else { + utmSource = ""; + } + if (UtilValidate.isNotEmpty(medium)) { + utmMedium = "&utm_medium=" + medium; + } else { + utmMedium = ""; + } + if (UtilValidate.isNotEmpty(term)) { + utmTerm = "&utm_term=" + term; + } else { + utmTerm = ""; + } + if (UtilValidate.isNotEmpty(content)) { + utmContent = "&utm_content=" + content; + } else { + utmContent = ""; + } + if (UtilValidate.isNotEmpty(campaign)) { + utmCampaign = "&utm_campaign=" + campaign; + } else { + utmCampaign = ""; + } + } + } + if (!webSiteUrl.startsWith("http://") && !webSiteUrl.startsWith("https://")) { webSiteUrl = "http://" + webSiteUrl; } @@ -329,10 +384,13 @@ public class ProductsExportToGoogle { String productCurrency = null; if ("US".equals(countryCode)) { productCurrency = "USD"; + localeString = "en_US"; } else if ("GB".equals(countryCode)) { productCurrency = "GBP"; + localeString = "en_GB"; } else if ("DE".equals(countryCode)) { productCurrency = "EUR"; + localeString = "de"; } else { Debug.logError("Exception during building data items to Google, Country Code must be either US, UK or DE: "+countryCode, module); return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.invalidCountryCode", locale)); @@ -369,15 +427,40 @@ public class ProductsExportToGoogle { continue; } // TODO: improve this (i.e. get the relative path from the properties file) - String link = webSiteUrl + "/" + webSiteMountPoint + "/control/product/~product_id=" + prod.getString("productId") + trackingCodeId; - String title = UtilFormatOut.encodeXmlValue(prod.getString("productName")); - if (UtilValidate.isEmpty(title)) { - title = UtilFormatOut.encodeXmlValue(prod.getString("internalName")); + String link = webSiteUrl + "/" + webSiteMountPoint + "/control/product/~product_id=" + prod.getString("productId") + trackingCodeId + utmSource + utmMedium + utmTerm + utmContent + utmCampaign; + String productName = null; + String productDescription = null; + String productURL = null; + List<GenericValue> productAndInfos = delegator.findByAnd("ProductContentAndInfo", UtilMisc.toMap("productId", prod.getString("productId"), "localeString", localeString, "thruDate", null)); + if (productAndInfos.size() > 0) { + for (GenericValue productContentAndInfo : productAndInfos ) { + String dataReSourceId = productContentAndInfo.getString("dataResourceId"); + GenericValue electronicText = delegator.findByPrimaryKey("ElectronicText", UtilMisc.toMap("dataResourceId", dataReSourceId)); + if ("PRODUCT_NAME".equals(productContentAndInfo.getString("productContentTypeId"))) + productName = electronicText.getString("textData"); + if ("LONG_DESCRIPTION".equals(productContentAndInfo.getString("productContentTypeId"))) + productDescription = electronicText.getString("textData"); + if ("PRODUCT_URL".equals(productContentAndInfo.getString("productContentTypeId"))) + productURL = electronicText.getString("textData") + utmSource + utmMedium + utmTerm + utmContent + utmCampaign; + } + } else { + productName = prod.getString("internalName"); + productDescription = prod.getString("longDescription"); + if (UtilValidate.isEmpty(productDescription)) { + productDescription = prod.getString("description"); + } } - String description = UtilFormatOut.encodeXmlValue(prod.getString("description")); - if (UtilValidate.isEmpty(description)) { + String title = UtilFormatOut.encodeXmlValue(productName); + if (UtilValidate.isEmpty(title)) + title = UtilFormatOut.encodeXmlValue(prod.getString("productName")); + if (UtilValidate.isEmpty(title)) + title = UtilFormatOut.encodeXmlValue(prod.getString("internalName")); + String description = UtilFormatOut.encodeXmlValue(productDescription); + if (UtilValidate.isEmpty(description)) + description = UtilFormatOut.encodeXmlValue(prod.getString("description")); + if (UtilValidate.isEmpty(description)) description = UtilFormatOut.encodeXmlValue(prod.getString("internalName")); - } + String imageLink = ""; if (UtilValidate.isNotEmpty(prod.getString("largeImageUrl"))) { imageLink = webSiteUrl + prod.getString("largeImageUrl"); @@ -386,11 +469,32 @@ public class ProductsExportToGoogle { } else if (UtilValidate.isNotEmpty(prod.getString("smallImageUrl"))) { imageLink = webSiteUrl + prod.getString("smallImageUrl"); } - + + // should use image management script task. + /*try { + List<GenericValue> productContentAndInfos = delegator.findByAnd("ProductContentAndInfo", + UtilMisc.toMap("productId", prod.getString("productId"), "productContentTypeId","DEFAULT_IMAGE")); + if (UtilValidate.isNotEmpty(productContentAndInfos)) { + imageLink = webSiteUrl + productContentAndInfos.get(0).getString("drObjectInfo"); + } else { + productContentAndInfos = delegator.findByAnd("ProductContentAndInfo", + UtilMisc.toMap("productId", prod.getString("productId"), + "productContentTypeId","IMAGE", + "statusId","IM_APPROVED", + "drIsPublic", "Y"), + UtilMisc.toList("contentId")); + if (UtilValidate.isNotEmpty(productContentAndInfos)) { + imageLink = webSiteUrl + productContentAndInfos.get(0).getString("drObjectInfo"); + } + } + } catch (Exception e) { + Debug.logError(e, module); + }*/ + String googleProductId = null; if (!"insert".equals(actionType)) { try { - googleProduct = delegator.findByPrimaryKey("GoodIdentification", UtilMisc.toMap("productId", prod.getString("productId"), "goodIdentificationTypeId", "GOOGLE_ID")); + googleProduct = delegator.findByPrimaryKey("GoodIdentification", UtilMisc.toMap("productId", prod.getString("productId"), "goodIdentificationTypeId", "GOOGLE_ID_" + localeString)); if (UtilValidate.isNotEmpty(googleProduct)) { googleProductId = googleProduct.getString("idValue"); } @@ -403,11 +507,16 @@ public class ProductsExportToGoogle { } Element entryElem = UtilXml.addChildElement(feedElem, "entry", feedDocument); Element batchElem = UtilXml.addChildElementNSElement(entryElem, "batch:operation", feedDocument, googleBaseBatchUrl); - Element batchOperationElem = UtilXml.firstChildElement(batchElem, "batch:operation"); + + Element batchOperationElem = (Element) batchElem.getFirstChild(); batchOperationElem.setAttribute("type", itemActionType); + + if("delete".equals(actionType) || "update".equals(actionType)){ + UtilXml.addChildElementNSValue(entryElem, "id", googleProductId, feedDocument, ""); + } Element appControlElem = UtilXml.addChildElementNSElement(entryElem, "app:control", feedDocument, googleBaseAppUrl); - Element appControlChildElem = UtilXml.firstChildElement(appControlElem, "app:control"); + Element appControlChildElem = (Element) appControlElem.getLastChild(); // Add the publishing priority for the product. By default it takes about 24 hours to publish your product if you submit data from Data Feed. By adding publishing priority your data // can be published in 15 - 30 minutes. UtilXml.addChildElementNSValue(appControlChildElem, "gm:publishing_priority", "high", feedDocument, googleBaseMetadataUrl); @@ -422,22 +531,18 @@ public class ProductsExportToGoogle { } } + //Add product title UtilXml.addChildElementValue(entryElem, "title", title, feedDocument); Element contentElem = UtilXml.addChildElementValue(entryElem, "content", description, feedDocument); contentElem.setAttribute("type", "xhtml"); - if (UtilValidate.isNotEmpty(googleProductId)) { - UtilXml.addChildElementNSValue(entryElem, "g:id", googleProductId, feedDocument, googleBaseNSUrl); - } else { - UtilXml.addChildElementNSValue(entryElem, "g:id", link, feedDocument, googleBaseNSUrl); - } - + UtilXml.addChildElementNSValue(entryElem, "g:id", prod.getString("productId"), feedDocument, googleBaseNSUrl); Element linkElem = UtilXml.addChildElement(entryElem, "link", feedDocument); - linkElem.setAttribute("rel", "alternate"); - linkElem.setAttribute("type", "text/html"); linkElem.setAttribute("href", link); - + linkElem.setAttribute("rel", "self"); + linkElem.setAttribute("type", "application/atom+xml"); + // item_type is the categories in which your product should belong. UtilXml.addChildElementNSValue(entryElem, "g:item_type", "products", feedDocument, googleBaseNSUrl); @@ -447,8 +552,14 @@ public class ProductsExportToGoogle { while (productCategoryMembersIter.hasNext()) { GenericValue productCategoryMember = productCategoryMembersIter.next(); GenericValue productCategory = productCategoryMember.getRelatedOne("ProductCategory"); - String productCategoryTypeId = productCategory.getString("productCategoryTypeId"); - if (UtilValidate.isNotEmpty(productCategoryTypeId) && "GOOGLE_BASE_CATEGORY".equals(productCategoryTypeId)) { + String productCategoryId = productCategory.getString("productCategoryId"); + String checkCategory = null; + if ("GB".equals(countryCode)) { + checkCategory = "UK"; + } else { + checkCategory = countryCode; + } + if (UtilValidate.isNotEmpty(productCategoryId) && (checkCategory.equals(productCategoryId.substring(0, 2)))) { String categoryDescription = ""; if (UtilValidate.isNotEmpty(productCategory.getString("categoryName"))) { categoryDescription = productCategory.getString("categoryName"); @@ -457,17 +568,14 @@ public class ProductsExportToGoogle { } else if (UtilValidate.isNotEmpty(productCategory.getString("longDescription"))) { categoryDescription = productCategory.getString("longDescription"); } - if (UtilValidate.isNotEmpty(productCategory)) { + if (UtilValidate.isNotEmpty(categoryDescription)) { UtilXml.addChildElementNSValue(entryElem, "g:product_type", StringUtil.wrapString(categoryDescription).toString() , feedDocument, googleBaseNSUrl); } } } - + //Add product price UtilXml.addChildElementNSValue(entryElem, "g:price", price, feedDocument, googleBaseNSUrl); - - // Might be nicer to load this from the product but for now we'll set it based on the country destination - UtilXml.addChildElementNSValue(entryElem, "g:currency", productCurrency, feedDocument, googleBaseNSUrl); - + // Ensure the load goes to the correct country location either US dollar, GB sterling or DE euro UtilXml.addChildElementNSValue(entryElem, "g:target_country", countryCode, feedDocument, googleBaseNSUrl); if (UtilValidate.isNotEmpty(prod.getString("brandName"))) { @@ -481,8 +589,14 @@ public class ProductsExportToGoogle { } catch (GenericEntityException gee) { Debug.logInfo("Unable to get the SKU for product [" + prod.getString("productId") + "]: " + gee.getMessage(), module); } - - UtilXml.addChildElementNSValue(entryElem, "g:condition", "new", feedDocument, googleBaseNSUrl); + + String condition = null; + if ("US".equals(countryCode) || "GB".equals(countryCode)) { + condition = "new"; + } else if ("DE".equals(countryCode)) { + condition = "new"; + } + UtilXml.addChildElementNSValue(entryElem, "g:condition", condition, feedDocument, googleBaseNSUrl); // This is a US specific requirement for product feeds // UtilXml.addChildElementValue(entryElem, "g:mpn", "", feedDocument); @@ -501,6 +615,10 @@ public class ProductsExportToGoogle { newProductsInGoogle.add(null); productsRemovedFromGoogle.add(null); } + //Add product condition + if ("Y".equals(context.get("allowRecommended"))) { + setRecommendedAttributes(prod, feedDocument, entryElem, delegator, countryCode, productCurrency); + } index++; } //Debug.logInfo("The value of generated String is ========\n" + UtilXml.writeXmlDocument(feedDocument), module); @@ -514,7 +632,8 @@ public class ProductsExportToGoogle { Map<String, Object> result = ServiceUtil.returnSuccess(); result.put("newProductsInGoogle", newProductsInGoogle); result.put("productsRemovedFromGoogle", productsRemovedFromGoogle); - Debug.log("======returning with result: " + result); + result.put("localeString", localeString); + //Debug.log("======returning with result: " + result); return result; } @@ -534,7 +653,7 @@ public class ProductsExportToGoogle { } private static Map<String, Object> readResponseFromGoogle(String msg, List<String> newProductsInGoogle, List<String> productsRemovedFromGoogle, - LocalDispatcher dispatcher, Delegator delegator, Locale locale) { + LocalDispatcher dispatcher, Delegator delegator, Locale locale, String localeString) { List<String> message = FastList.newInstance(); // Debug.log("====get xml response from google: " + msg); try { @@ -544,13 +663,18 @@ public class ProductsExportToGoogle { Iterator<? extends Element> atomEntryElemIter = atomEntryList.iterator(); int index = 0; while (atomEntryElemIter.hasNext()) { + String id = null; Element atomEntryElement = atomEntryElemIter.next(); - String id = UtilXml.childElementValue(atomEntryElement, "atom:id", ""); + Node atomId = atomEntryElement.getElementsByTagName("atom:id").item(0); + if(UtilValidate.isNotEmpty(atomId)) { + id = atomId.getTextContent(); + } + String productId = ""; if (UtilValidate.isNotEmpty(id) && newProductsInGoogle.get(index) != null) { - String productId = newProductsInGoogle.get(index); + productId = newProductsInGoogle.get(index); try { GenericValue googleProductId = delegator.makeValue("GoodIdentification"); - googleProductId.set("goodIdentificationTypeId", "GOOGLE_ID"); + googleProductId.set("goodIdentificationTypeId", "GOOGLE_ID_" + localeString); googleProductId.set("productId", productId); googleProductId.set("idValue", id); delegator.createOrStore(googleProductId); @@ -559,20 +683,23 @@ public class ProductsExportToGoogle { } } if (UtilValidate.isNotEmpty(id) && productsRemovedFromGoogle.get(index) != null) { - String productId = productsRemovedFromGoogle.get(index); + productId = productsRemovedFromGoogle.get(index); try { - delegator.removeByAnd("GoodIdentification", UtilMisc.toMap("goodIdentificationTypeId", "GOOGLE_ID", "productId", productId)); + delegator.removeByAnd("GoodIdentification", UtilMisc.toMap("goodIdentificationTypeId", "GOOGLE_ID_" + localeString, "productId", productId)); } catch (GenericEntityException gee) { Debug.logError("Unable to remove Google id for product [" + productId + "]: " + gee.getMessage(), module); } } - String title = "Google response: " + UtilXml.childElementValue(atomEntryElement, "atom:title", ""); + if (UtilValidate.isEmpty(productId)){ + productId = atomEntryElement.getElementsByTagName("g:id").item(0).getTextContent(); + } + String title = "Google response:" + UtilXml.childElementValue(atomEntryElement, "atom:title", ""); List<? extends Element> batchStatusList = UtilXml.childElementList(atomEntryElement, "batch:status"); Iterator<? extends Element> batchStatusEntryElemIter = batchStatusList.iterator(); while (batchStatusEntryElemIter.hasNext()) { Element batchStatusEntryElement = batchStatusEntryElemIter.next(); if (UtilValidate.isNotEmpty(batchStatusEntryElement.getAttribute("reason"))) { - message.add(title + " " + batchStatusEntryElement.getAttribute("reason")); + message.add(title + " " + productId + ":" + batchStatusEntryElement.getAttribute("reason")); } } String errors = UtilXml.childElementValue(atomEntryElement, "batch:status", ""); @@ -585,10 +712,8 @@ public class ProductsExportToGoogle { Debug.logError("Exception reading response from Google: " + e.getMessage(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "productsExportToGoogle.exceptionReadingResponseFromGoogle", locale)); } - - if (message.size() > 0) { - return ServiceUtil.returnError(UtilProperties.getMessage(resource, "productsExportToGoogle.errorInTheResponseFromGoogle", locale), message); - } + //Debug.logInfo("===== batch:status - message: " + message, module); + //Debug.logInfo("===== Exports: " + message.size() + " products" , null); return ServiceUtil.returnSuccess(); } @@ -620,4 +745,70 @@ public class ProductsExportToGoogle { } return buildGoogleBaseConfigContext; } + private static void setRecommendedAttributes(GenericValue product, Document feedDocument, Element entryElem, Delegator delegator, String countryCode, String productCurrency) { + if (UtilValidate.isEmpty(product) && UtilValidate.isEmpty(feedDocument) && UtilValidate.isEmpty(countryCode) && UtilValidate.isNotEmpty(entryElem)) { + Debug.logError("Required parameters in setRecommended method", module); + } + try { + //Add brand name + if (UtilValidate.isNotEmpty(product.getString("brandName"))) { + UtilXml.addChildElementNSValue(entryElem, "g:brand", product.getString("brandName"), feedDocument, googleBaseNSUrl); + } + + //Add quantity item + List<GenericValue> inventoryItems = delegator.findByAnd("InventoryItem", UtilMisc.toMap("productId", product.getString("productId"))); + if (UtilValidate.isNotEmpty(inventoryItems)) { + BigDecimal totalquantity = new BigDecimal(0); + for (GenericValue inventoryItem : inventoryItems) { + BigDecimal availableToPromiseTotal = new BigDecimal(inventoryItem.getString("availableToPromiseTotal")); + totalquantity = totalquantity.add(availableToPromiseTotal); + } + if ("DE".equals(countryCode)) { + UtilXml.addChildElementNSValue(entryElem, "g:menge", totalquantity.toString(), feedDocument, googleBaseNSUrl); + } else { + Integer intValue = totalquantity.intValue(); + UtilXml.addChildElementNSValue(entryElem, "g:quantity", intValue.toString(), feedDocument, googleBaseNSUrl); + } + } + //Add Online Only + UtilXml.addChildElementNSValue(entryElem, "g:online_only", "y", feedDocument, googleBaseNSUrl); + //Add shipping weight + if (UtilValidate.isNotEmpty(product.getString("weight")) && UtilValidate.isNotEmpty(product.getString("weightUomId"))) { + GenericValue uom = delegator.findByPrimaryKey("Uom", UtilMisc.toMap("uomId", product.getString("weightUomId"))); + String shippingWeight = product.getString("weight") + " " + uom.getString("description"); + UtilXml.addChildElementNSValue(entryElem, "g:shipping_weight", shippingWeight, feedDocument, googleBaseNSUrl); + } + List<GenericValue> productFeatureAndAppls = delegator.findByAnd("ProductFeatureAndAppl", UtilMisc.toMap("productId", product.getString("productId"))); + if (productFeatureAndAppls.size() > 0) { + for (GenericValue productFeatureAndAppl : productFeatureAndAppls) { + //Add Genre + if ("GENRE".equals(productFeatureAndAppl.getString("productFeatureTypeId"))) { + UtilXml.addChildElementNSValue(entryElem, "g:genre", productFeatureAndAppl.getString("description"), feedDocument, googleBaseNSUrl); + } + //Add color + if ("COLOR".equals(productFeatureAndAppl.getString("productFeatureTypeId"))) { + UtilXml.addChildElementNSValue(entryElem, "g:color", productFeatureAndAppl.getString("description"), feedDocument, googleBaseNSUrl); + } + //Add size + if ("SIZE".equals(productFeatureAndAppl.getString("productFeatureTypeId"))) { + UtilXml.addChildElementNSValue(entryElem, "g:size", productFeatureAndAppl.getString("description"), feedDocument, googleBaseNSUrl); + } + //Add year + if ("YEAR_MADE".equals(productFeatureAndAppl.getString("productFeatureTypeId"))) { + UtilXml.addChildElementNSValue(entryElem, "g:year", productFeatureAndAppl.getString("description"), feedDocument, googleBaseNSUrl); + } + //Add author + if ("ARTIST".equals(productFeatureAndAppl.getString("productFeatureTypeId"))) { + UtilXml.addChildElementNSValue(entryElem, "g:author", productFeatureAndAppl.getString("description"), feedDocument, googleBaseNSUrl); + } + //Add edition + if ("EDITION".equals(productFeatureAndAppl.getString("productFeatureTypeId"))) { + UtilXml.addChildElementNSValue(entryElem, "g:edition", productFeatureAndAppl.getString("description"), feedDocument, googleBaseNSUrl); + } + } + } + } catch (Exception e) { + Debug.logError(e.toString(), module); + } + } } Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/GoogleBaseAdvancedSearch.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/GoogleBaseAdvancedSearch.groovy?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/GoogleBaseAdvancedSearch.groovy (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/GoogleBaseAdvancedSearch.groovy Thu Mar 24 07:23:42 2011 @@ -32,6 +32,10 @@ if (parameters.productStoreId) { productStoreId = ProductStoreWorker.getProductStoreId(request); } googleBaseConfigList = delegator.findList("GoogleBaseConfig", null, null, null, null, false); +if (!productStoreId) { + googleBaseProductStore = EntityUtil.getFirst(googleBaseConfigList); + productStoreId = googleBaseProductStore.productStoreId; +} if (productStoreId) { productStoreCatalogs = CatalogWorker.getStoreCatalogs(delegator, productStoreId); if (productStoreCatalogs) { Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsExportToGoogle.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsExportToGoogle.groovy?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsExportToGoogle.groovy (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/actions/productsExportToGoogle.groovy Thu Mar 24 07:23:42 2011 @@ -20,6 +20,9 @@ import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.base.util.*; + +uiLabelMap = UtilProperties.getResourceBundleMap("GoogleBaseUiLabels", locale); webSiteList = []; webSite = null; @@ -38,3 +41,17 @@ if (parameters.productStoreId) { context.webSiteUrl = webSite.standardContentPrefix; parameters.webSiteUrl = webSite.standardContentPrefix;; } + +if (parameters.productStoreId) { + productStore = delegator.findByAnd("ProductStore", ["productStoreId":parameters.productStoreId]); + str = productStore[0].defaultLocaleString.toString().toUpperCase(); + localeString = str.substring(str.length()-2, str.length()); + if(localeString.equals("US")){ + context.showText = uiLabelMap.GoogleBaseExportCountryCodeUS; + }else if(localeString.equals("GB")){ + context.showText = uiLabelMap.GoogleBaseExportCountryCodeGB; + }else{ // "DE" + context.showText = uiLabelMap.GoogleBaseExportCountryCodeDE; + } + context.countryCode = localeString; +} Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml Thu Mar 24 07:23:42 2011 @@ -48,6 +48,17 @@ under the License. <response name="error" type="view" value="ProductsExportToGoogle"/> </request-map> + <request-map uri="GooglebaseAutoUpdate"> + <security https="true" auth="true"/> + <response name="success" type="view" value="GooglebaseAutoUpdate"/> + <response name="error" type="view" value="GooglebaseAutoUpdate"/> + </request-map> + <request-map uri="startStopScheduledGbase"> + <security https="true" auth="true"/> + <event type="simple" path="component://googlebase/script/org/ofbiz/googlebase/GooglebaseEvents.xml" invoke="startStopScheduledGbase"/> + <response name="success" type="view" value="GooglebaseAutoUpdate"/> + <response name="error" type="view" value="GooglebaseAutoUpdate"/> + </request-map> <!-- Request entries for GoogleBaseConfig UI --> <request-map uri="EditGoogleBaseConfigs"> <security https="true" auth="true"/> @@ -81,5 +92,6 @@ under the License. <view-map name="EditProduct" type="screen" page="component://googlebase/widget/GoogleBaseScreens.xml#EditProduct"/> <view-map name="ProductsExportToGoogle" type="screen" page="component://googlebase/widget/GoogleBaseScreens.xml#ProductsExportToGoogle"/> <view-map name="EditGoogleBaseConfigs" type="screen" page="component://googlebase/widget/GoogleBaseScreens.xml#EditGoogleBaseConfigs"/> + <view-map name="GooglebaseAutoUpdate" type="screen" page="component://googlebase/widget/GoogleBaseScreens.xml#GooglebaseAutoUpdate"/> <!-- end of view mappings --> </site-conf> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/find/GoogleBaseAdvancedSearch.ftl Thu Mar 24 07:23:42 2011 @@ -150,6 +150,28 @@ under the License. </tr> </#if> <tr> + <td class="label" align="right" valign="top"> + Filter Product Status: + </td> + <td> + <div> + <input type="checkbox" name="ACTIVE_PRODUCT" value="Y"/>Active Product + <br/> + <input type="checkbox" name="GOOGLE_SYNCED" value="Y"/>Product not currently synced with Google Base + </div> + </td> + </tr> + <tr> + <td class="label" align="right" valign="top"> + Discontinued: + </td> + <td> + <div> + <input type="checkbox" name="DISCONTINUED_PRODUCT" value="Y"/>Exclude sending discontinued product and stock is zero. + </div> + </td> + </tr> + <tr> <td class="label" align="right" valign="top"> ${uiLabelMap.ProductProductName}: </td> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/find/googleExportLink.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/find/googleExportLink.ftl?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/find/googleExportLink.ftl (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/webapp/googlebase/find/googleExportLink.ftl Thu Mar 24 07:23:42 2011 @@ -19,8 +19,18 @@ under the License. <script language="JavaScript" type="text/javascript"> function exportToGoogle() { - document.products.action="<@ofbizUrl>ProductsExportToGoogle</@ofbizUrl>"; - document.products.submit(); + var productIds = document.getElementsByName("selectResult"); + var count = 0; + for(var i=0; i<productIds.length; i++){ + if(productIds[i].checked) + count++; + } + if(count > 0){ + document.products.action="<@ofbizUrl>ProductsExportToGoogle</@ofbizUrl>"; + document.products.submit(); + } else { + alert("You have to choose any product(s)."); + } } </script> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseForms.xml?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseForms.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseForms.xml Thu Mar 24 07:23:42 2011 @@ -22,16 +22,14 @@ under the License. xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"> <form id="productsExportToGoogle" name="ProductsExportToGoogle" type="single" target="searchExportProductListToGoogle" header-row-style="header-row" default-table-style="basic-table"> + <actions> + <set field="selectResult" type="List"/> + </actions> <field name="productStoreId"><hidden/></field> <field name="selectResult"><hidden/></field> - <field name="countryCode" tooltip="${uiLabelMap.GoogleBaseExportCountryCode}"> - <drop-down no-current-selected-key="US"> - <option key="US" description="${uiLabelMap.GoogleBaseExportCountryCodeUS}"/> - <option key="GB" description="${uiLabelMap.GoogleBaseExportCountryCodeGB}"/> - <option key="DE" description="${uiLabelMap.GoogleBaseExportCountryCodeDE}"/> - <option key="IT" description="${uiLabelMap.GoogleBaseExportCountryCodeIT}"/> - </drop-down> - </field> + <field name="dummy" title=" " tooltip="Google Base Application is now available for US, UK(GB) and DE"><display/></field> + <field name="countryCode"><hidden/></field> + <field name="showText" title="Country Code" tooltip="This product store is ${countryCode}"><display/></field> <field name="webSiteId" event="onchange" action="javascript:$('productsExportToGoogle').action='${persistAction}';$('productsExportToGoogle').submit();"> <drop-down current="selected"> <list-options list-name="webSiteList" key-name="webSiteId" description="${siteName}[${webSiteId}]"/> @@ -69,6 +67,7 @@ under the License. </entity-options> </drop-down> </field> + <field name="allowRecommended" title="${uiLabelMap.GoogleBaseRecommended}"><check/></field> <field name="submitButton" title="${uiLabelMap.GoogleBaseExportToGoogle}"><submit button-type="button"/></field> </form> @@ -101,7 +100,52 @@ under the License. </drop-down> </field> <field name="accountPassword"><password/></field> + <field name="utmSource" title="Campaign Source" tooltip="Use to identify a search engine, newsletter name, or other source. Example: utm_source=google"></field> + <field name="utmMedium" title="Campaign Medium" tooltip="Use to identify a medium such as email or cost-per- click. Example: utm_medium=cpc"></field> + <field name="utmTerm" title="Campaign Term" tooltip="Used for paid search. Use to note the keywords for this ad. Example: utm_term=running+shoes"></field> + <field name="utmContent" title="Campaign Content" tooltip="Used for A/B testing and content-targeted ads. Use to differentiate ads or links that point to the same URL. Examples: utm_content=logolink or utm_content=textlink"></field> + <field name="utmCampaign" title="Campaign Name" tooltip="Used for keyword analysis. Use to identify a specific product promotion or strategic campaign. Example: utm_campaign=spring_sale"></field> <field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field> </form> + <form name="GooglebaseAutoUpdateConfig" type="list" list-name="configList" header-row-style="header-row-2" + default-table-style="basic-table hover-bar" odd-row-style="alternate-row"> + <actions> + <script location="component://googlebase/webapp/googlebase/WEB-INF/actions/autoUpdateConfig.groovy"/> + </actions> + <field name="productStoreId"><display/></field> + <field name="outOfStock" title="Update if product is out of stock"><display/></field> + <field name="backInStock" title="Update if product is back into stock"><display/></field> + <field name="webSiteUrl"><display/></field> + <field name="actionType"><display/></field> + <field name="statusId"><display/></field> + <field name="outOfStock"><display/></field> + <field name="testMode"><display/></field> + <field name="webSiteMountPoint"><display/></field> + <field name="countryCode"><display/></field> + <field name="trackingCodeId"><display/></field> + <field name="allowRecommended"><display/></field> + </form> + <form name="StartStopScheduled" type="single" target="startStopScheduledGbase" title=""> + <actions> + <entity-and entity-name="JobSandbox" list="pendingList"> + <field-map field-name="serviceName" value="autoUpdateToGoogleBase"/> + <field-map field-name="statusId" value="SERVICE_PENDING"/> + <order-by field-name="-lastUpdatedStamp"/> + </entity-and> + <entity-and entity-name="JobSandbox" list="cancelledList"> + <field-map field-name="serviceName" value="autoUpdateToGoogleBase"/> + <field-map field-name="statusId" value="SERVICE_CANCELLED"/> + <order-by field-name="-lastUpdatedStamp"/> + </entity-and> + </actions> + <field name="dummy" title=" " tooltip="Don't forget to add the scheduled job to run autoUpdateToGoogleBase service"><display /></field> + <field name="pendingJobId"><display description="${pendingList[0].jobId}"/></field> + <field name="status" use-when="${groovy: return context.pendingList[0] != null;}"><display description="RUNNING"/></field> + <field name="lastUpdatedStamp" use-when="${groovy: return context.pendingList[0] != null;}"><display description="${pendingList[0].lastUpdatedStamp}"/></field> + <field name="runTime" use-when="${groovy: return context.pendingList[0] != null;}"><display description="${pendingList[0].runTime}"/></field> + <field name="status" use-when="${groovy: return context.pendingList[0] == null;}"><display description="STOP"/></field> + <field name="StoppedTime" use-when="${groovy: return context.pendingList[0] == null;}"><display description="${cancelledList[0].cancelDateTime}"/></field> + <field name="Start/Stop Scheduled"><submit button-type="button"/></field> + </form> </forms> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseMenus.xml?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseMenus.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseMenus.xml Thu Mar 24 07:23:42 2011 @@ -21,5 +21,6 @@ under the License. <menu name="GoogleBaseAppBar" title="${uiLabelMap.GoogleBaseApplication}" extends="CommonAppBarMenu" extends-resource="component://common/widget/CommonMenus.xml"> <menu-item name="GoogleBaseConfigs" title="${uiLabelMap.GoogleBaseConfiguration}"><link target="EditGoogleBaseConfigs"/></menu-item> <menu-item name="googlebase" title="${uiLabelMap.GoogleBaseExportToGoogle}"><link target="advancedsearch"/></menu-item> + <menu-item name="GooglebaseAutoUpdate" title="${uiLabelMap.GoogleBaseAutoUpdate}"><link target="GooglebaseAutoUpdate"/></menu-item> </menu> </menus> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseScreens.xml?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseScreens.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/googlebase/widget/GoogleBaseScreens.xml Thu Mar 24 07:23:42 2011 @@ -49,6 +49,7 @@ under the License. <actions> <set field="titleProperty" value="PageTitleSearchResults"/> <script location="component://product/webapp/catalog/WEB-INF/actions/find/keywordsearch.groovy"/> + <script location="component://googlebase/webapp/googlebase/WEB-INF/actions/FilterProducts.groovy"/> </actions> <widgets> <decorator-screen name="CommonFindDecorator" location="${parameters.mainDecoratorLocation}"> @@ -128,4 +129,29 @@ under the License. </widgets> </section> </screen> + <screen name="GooglebaseAutoUpdate"> + <section> + <actions> + <set field="titleProperty" value="GooglebaseAutoUpdate"/> + <set field="headerItem" value="GooglebaseAutoUpdate"/> + <entity-condition entity-name="GoogleBaseConfig" list="googleBaseConfigList"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <section> + <widgets> + <screenlet title="Start/Stop Auto Update to Google Base Scheduled"> + <include-form name="StartStopScheduled" location="component://googlebase/widget/GoogleBaseForms.xml"/> + </screenlet> + <screenlet title="Google Base Auto Update Config - setup at [autoUpdateToGoogleBase.properties]"> + <include-form name="GooglebaseAutoUpdateConfig" location="component://googlebase/widget/GoogleBaseForms.xml"/> + </screenlet> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> </screens> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/googlecheckout/webapp/googlecheckout/redirect/redirectHeader.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/googlecheckout/webapp/googlecheckout/redirect/redirectHeader.ftl?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/googlecheckout/webapp/googlecheckout/redirect/redirectHeader.ftl (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/googlecheckout/webapp/googlecheckout/redirect/redirectHeader.ftl Thu Mar 24 07:23:42 2011 @@ -20,7 +20,7 @@ under the License. <#if parameters.redirect?exists> <html> <head> -<meta HTTP-EQUIV="REFRESH" content="0; url=${parameters.redirect}"> +<meta HTTP-EQUIV="REFRESH" content="0; url=${parameters.redirect}"/> </head> </html> Propchange: ofbiz/branches/jackrabbit20100709/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Mar 24 07:23:42 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:951708-952957 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:952958-1044489 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:921280-927264 -/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:962442-1078886 +/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:962442-1084618 Propchange: ofbiz/branches/jackrabbit20100709/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Mar 24 07:23:42 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:951708-952957 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:952958-1044489 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:921280-927264 -/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:962442-1078886 +/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:962442-1084618 Propchange: ofbiz/branches/jackrabbit20100709/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Mar 24 07:23:42 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:951708-952957 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:952958-1044489 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:921280-927264 -/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:962442-1078886 +/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:962442-1084618 Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ofbizwebsite/template/HtmlHead.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ofbizwebsite/template/HtmlHead.ftl?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ofbizwebsite/template/HtmlHead.ftl (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ofbizwebsite/template/HtmlHead.ftl Thu Mar 24 07:23:42 2011 @@ -28,7 +28,7 @@ under the License. <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <title>${(uiLabelMap.OfbizTitle)!"OFBiz, The Apache Open For Business Project"}</title> <link rel="shortcut icon" href="/ofbiz/images/favicon.ico"> - <script language="javascript" src="/images/jquery/jquery-1.4.2.min.js" type="text/javascript"></script> + <script language="javascript" src="/images/jquery/jquery-1.5.1.min.js" type="text/javascript"></script> <script language="javascript" src="/images/fieldlookup.js" type="text/javascript"></script> <script language="javascript" src="/images/selectall.js" type="text/javascript"></script> <script language="javascript" src="/ofbiz/script/search.js" type="text/javascript"></script> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Thu Mar 24 07:23:42 2011 @@ -1025,7 +1025,7 @@ <if-empty field="highInfo.estimatedStartDate"> <set field="highInfo.estimatedStartDate" from-field="lowInfo.estimatedStartDate"/> <else> - <if-compare-field to-field="lowInfo.estimatedStartDate" field="highInfo.estimatedStartDate" operator="greater"> + <if-compare-field to-field="lowInfo.estimatedStartDate" field="highInfo.estimatedStartDate" operator="greater" type="Timestamp"> <set field="highInfo.estimatedStartDate" from-field="lowInfo.estimatedStartDate"/> </if-compare-field> </else> @@ -1035,7 +1035,7 @@ <if-empty field="highInfo.estimatedCompletionDate"> <set field="highInfo.estimatedCompletionDate" from-field="lowInfo.estimatedCompletionDate"/> <else> - <if-compare-field to-field="lowInfo.estimatedCompletionDate" field="highInfo.estimatedCompletionDate" operator="less"> + <if-compare-field to-field="lowInfo.estimatedCompletionDate" field="highInfo.estimatedCompletionDate" operator="less" type="Timestamp"> <set field="highInfo.estimatedCompletionDate" from-field="lowInfo.estimatedCompletionDate"/> </if-compare-field> </else> @@ -1045,7 +1045,7 @@ <if-empty field="highInfo.actualStartDate"> <set field="highInfo.actualStartDate" from-field="lowInfo.actualStartDate"/> <else> - <if-compare-field to-field="lowInfo.actualStartDate" field="highInfo.actualStartDate" operator="greater"> + <if-compare-field to-field="lowInfo.actualStartDate" field="highInfo.actualStartDate" operator="greater" type="Timestamp"> <set field="highInfo.actualStartDate" from-field="lowInfo.actualStartDate"/> </if-compare-field> </else> @@ -1055,7 +1055,7 @@ <if-empty field="highInfo.actualCompletionDate"> <set field="highInfo.actualCompletionDate" from-field="lowInfo.actualCompletionDate"/> <else> - <if-compare-field to-field="lowInfo.actualCompletionDate" field="highInfo.actualCompletionDate" operator="less"> + <if-compare-field to-field="lowInfo.actualCompletionDate" field="highInfo.actualCompletionDate" operator="less" type="Timestamp"> <set field="highInfo.actualCompletionDate" from-field="lowInfo.actualCompletionDate"/> </if-compare-field> </else> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/WebPosEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/WebPosEvents.java?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/WebPosEvents.java (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/WebPosEvents.java Thu Mar 24 07:23:42 2011 @@ -43,7 +43,7 @@ public class WebPosEvents { HttpSession session = request.getSession(true); // get the posTerminalId - String posTerminalId = (String) request.getParameter("posTerminalId"); + String posTerminalId = request.getParameter("posTerminalId"); session.removeAttribute("shoppingCart"); session.removeAttribute("webPosSession"); WebPosEvents.getWebPosSession(request, posTerminalId); Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/session/WebPosSession.java Thu Mar 24 07:23:42 2011 @@ -26,12 +26,10 @@ import javolution.util.FastMap; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilMisc; -import org.ofbiz.base.util.UtilObject; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.DelegatorFactory; -import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.order.shoppingcart.ShoppingCart; @@ -115,7 +113,7 @@ public class WebPosSession { } public Locale getLocale() { - return (Locale) this.locale; + return this.locale; } public void setLocale(Locale locale) { @@ -249,6 +247,7 @@ public class WebPosSession { this.webPosTransaction = webPosTransaction; } + @SuppressWarnings("serial") public class UserLoginFailure extends GeneralException { public UserLoginFailure() { super(); Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/transaction/WebPosTransaction.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/transaction/WebPosTransaction.java?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/transaction/WebPosTransaction.java (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/src/org/ofbiz/webpos/transaction/WebPosTransaction.java Thu Mar 24 07:23:42 2011 @@ -28,7 +28,6 @@ import javolution.util.FastMap; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilDateTime; -import org.ofbiz.base.util.UtilFormatOut; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; @@ -328,7 +327,7 @@ public class WebPosTransaction { boolean isExternal = true; Iterator<GenericValue> i = values.iterator(); while (i.hasNext() && isExternal) { - GenericValue v = (GenericValue) i.next(); + GenericValue v = i.next(); //Debug.log("Testing [" + paymentMethodTypeId + "] - " + v, module); if (!externalCode.equals(v.getString("paymentServiceTypeEnumId"))) { isExternal = false; Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/widget/CommonScreens.xml?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/widget/CommonScreens.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/webpos/widget/CommonScreens.xml Thu Mar 24 07:23:42 2011 @@ -49,7 +49,7 @@ under the License. <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/ui/development-bundle/ui/jquery.ui.datepicker.js" global="true"/> <set field="initialLocale" type="String" value="${parameters.userLogin.lastLocale}" default-value="${groovy:locale.toString()}"/> <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-${initialLocale}.js" global="true"/> - <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.4.2.min.js" global="true"/> + <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.5.1.min.js" global="true"/> <script location="component://webpos/widget/WebPosSetup.groovy"/> Modified: ofbiz/branches/jackrabbit20100709/themes/bizznesstime/includes/header.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/themes/bizznesstime/includes/header.ftl?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/themes/bizznesstime/includes/header.ftl (original) +++ ofbiz/branches/jackrabbit20100709/themes/bizznesstime/includes/header.ftl Thu Mar 24 07:23:42 2011 @@ -127,7 +127,7 @@ under the License. </#if> </span> <span><a href="<@ofbizUrl>logout</@ofbizUrl>">${uiLabelMap.CommonLogout}</a></span> - <#if webSiteId?exists && requestAttributes._CURRENT_VIEW_?exists> + <#if webSiteId?exists && requestAttributes._CURRENT_VIEW_?exists && helpTopic?exists> <#include "component://common/webcommon/includes/helplink.ftl" /> <span><a href="javascript:lookup_popup2('showHelp?helpTopic=${helpTopic}&portalPageId=${parameters.portalPageId?if_exists}','help' ,500,500);">${uiLabelMap.CommonHelp}</a></span> </#if> Modified: ofbiz/branches/jackrabbit20100709/themes/bizznesstime/webapp/bizznesstime/css/style.css URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/themes/bizznesstime/webapp/bizznesstime/css/style.css?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/themes/bizznesstime/webapp/bizznesstime/css/style.css (original) +++ ofbiz/branches/jackrabbit20100709/themes/bizznesstime/webapp/bizznesstime/css/style.css Thu Mar 24 07:23:42 2011 @@ -2147,3 +2147,23 @@ height:22px; * html .ui-autocomplete { height: 250px; } + +/* The custom CSS for adjust the JsTree */ +.jstree-default .jstree-leaf > ins { + background-position:-36px 0; + vertical-align: top; + } +html>/**/body .jstree-default a { +white-space:normal !important; + height: auto; + } +/* IE6 and below */ +* html .jstree-default a { +white-space:normal; +height: auto; +} +/* IE7 */ +*+html .jstree-default a { +white-space:normal; +height: auto; +} Modified: ofbiz/branches/jackrabbit20100709/themes/bluelight/includes/header.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/themes/bluelight/includes/header.ftl?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/themes/bluelight/includes/header.ftl (original) +++ ofbiz/branches/jackrabbit20100709/themes/bluelight/includes/header.ftl Thu Mar 24 07:23:42 2011 @@ -162,7 +162,7 @@ under the License. <#else> <li><a href="<@ofbizUrl>${checkLoginUrl}</@ofbizUrl>">${uiLabelMap.CommonLogin}</a></li> </#if> - <#if webSiteId?exists && requestAttributes._CURRENT_VIEW_?exists> + <#if webSiteId?exists && requestAttributes._CURRENT_VIEW_?exists && helpTopic?exists> <#include "component://common/webcommon/includes/helplink.ftl" /> <li><a class="help-link <#if pageAvail?has_content> alert</#if>" href="javascript:lookup_popup2('showHelp?helpTopic=${helpTopic}&portalPageId=${parameters.portalPageId?if_exists}','help' ,500,500);" title="${uiLabelMap.CommonHelp}"></a></li> </#if> Modified: ofbiz/branches/jackrabbit20100709/themes/bluelight/webapp/bluelight/style.css URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/themes/bluelight/webapp/bluelight/style.css?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/themes/bluelight/webapp/bluelight/style.css (original) +++ ofbiz/branches/jackrabbit20100709/themes/bluelight/webapp/bluelight/style.css Thu Mar 24 07:23:42 2011 @@ -2706,3 +2706,23 @@ width:10% * html .ui-autocomplete { height: 250px; } + +/* The custom CSS for adjust the JsTree */ +.jstree-default .jstree-leaf > ins { + background-position:-36px 0; + vertical-align: top; + } +html>/**/body .jstree-default a { +white-space:normal !important; + height: auto; + } +/* IE6 and below */ +* html .jstree-default a { +white-space:normal; +height: auto; +} +/* IE7 */ +*+html .jstree-default a { +white-space:normal; +height: auto; +} Modified: ofbiz/branches/jackrabbit20100709/themes/droppingcrumbs/includes/header.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/themes/droppingcrumbs/includes/header.ftl?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/themes/droppingcrumbs/includes/header.ftl (original) +++ ofbiz/branches/jackrabbit20100709/themes/droppingcrumbs/includes/header.ftl Thu Mar 24 07:23:42 2011 @@ -152,7 +152,7 @@ under the License. <#else> <li><a href="<@ofbizUrl>${checkLoginUrl}</@ofbizUrl>">${uiLabelMap.CommonLogin}</a></li> </#if> - <#if webSiteId?exists && requestAttributes._CURRENT_VIEW_?exists> + <#if webSiteId?exists && requestAttributes._CURRENT_VIEW_?exists && helpTopic?exists> <#include "component://common/webcommon/includes/helplink.ftl" /> <li><a class="help-link <#if pageAvail?has_content> alert</#if>" href="javascript:lookup_popup2('showHelp?helpTopic=${helpTopic}&portalPageId=${parameters.portalPageId?if_exists}','help' ,500,500);" title="${uiLabelMap.CommonHelp}"></a></li> </#if> Modified: ofbiz/branches/jackrabbit20100709/themes/droppingcrumbs/webapp/droppingcrumbs/css/style.css URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/themes/droppingcrumbs/webapp/droppingcrumbs/css/style.css?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/themes/droppingcrumbs/webapp/droppingcrumbs/css/style.css (original) +++ ofbiz/branches/jackrabbit20100709/themes/droppingcrumbs/webapp/droppingcrumbs/css/style.css Thu Mar 24 07:23:42 2011 @@ -2691,3 +2691,23 @@ width:10% * html .ui-autocomplete { height: 250px; } + +/* The custom CSS for adjust the JsTree */ +.jstree-default .jstree-leaf > ins { + background-position:-36px 0; + vertical-align: top; + } +html>/**/body .jstree-default a { +white-space:normal !important; + height: auto; + } +/* IE6 and below */ +* html .jstree-default a { +white-space:normal; +height: auto; +} +/* IE7 */ +*+html .jstree-default a { +white-space:normal; +height: auto; +} Modified: ofbiz/branches/jackrabbit20100709/themes/flatgrey/includes/header.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/themes/flatgrey/includes/header.ftl?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/themes/flatgrey/includes/header.ftl (original) +++ ofbiz/branches/jackrabbit20100709/themes/flatgrey/includes/header.ftl Thu Mar 24 07:23:42 2011 @@ -123,7 +123,7 @@ under the License. <#else/> <li>${uiLabelMap.CommonWelcome}! <a href="<@ofbizUrl>${checkLoginUrl}</@ofbizUrl>">${uiLabelMap.CommonLogin}</a></li> </#if> - <#if webSiteId?exists && requestAttributes._CURRENT_VIEW_?exists> + <#if webSiteId?exists && requestAttributes._CURRENT_VIEW_?exists && helpTopic?exists> <#include "component://common/webcommon/includes/helplink.ftl" /> <li><a <#if pageAvail?has_content>class="alert"</#if> href="javascript:lookup_popup2('showHelp?helpTopic=${helpTopic}&portalPageId=${parameters.portalPageId?if_exists}','help' ,500,500);">${uiLabelMap.CommonHelp}</a></li> </#if> Modified: ofbiz/branches/jackrabbit20100709/themes/flatgrey/webapp/flatgrey/maincss.css URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/themes/flatgrey/webapp/flatgrey/maincss.css?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/themes/flatgrey/webapp/flatgrey/maincss.css (original) +++ ofbiz/branches/jackrabbit20100709/themes/flatgrey/webapp/flatgrey/maincss.css Thu Mar 24 07:23:42 2011 @@ -2137,3 +2137,23 @@ width: 30em; * html .ui-autocomplete { height: 250px; } + +/* The custom CSS for adjust the JsTree */ +.jstree-default .jstree-leaf > ins { + background-position:-36px 0; + vertical-align: top; + } +html>/**/body .jstree-default a { +white-space:normal !important; + height: auto; + } +/* IE6 and below */ +* html .jstree-default a { +white-space:normal; +height: auto; +} +/* IE7 */ +*+html .jstree-default a { +white-space:normal; +height: auto; +} Modified: ofbiz/branches/jackrabbit20100709/themes/tomahawk/includes/appbarClose.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/themes/tomahawk/includes/appbarClose.ftl?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/themes/tomahawk/includes/appbarClose.ftl (original) +++ ofbiz/branches/jackrabbit20100709/themes/tomahawk/includes/appbarClose.ftl Thu Mar 24 07:23:42 2011 @@ -72,7 +72,7 @@ under the License. </#if> </#if> <#if userLogin?exists> - <#if webSiteId?exists && requestAttributes._CURRENT_VIEW_?exists> + <#if webSiteId?exists && requestAttributes._CURRENT_VIEW_?exists && helpTopic?exists> <#include "component://common/webcommon/includes/helplink.ftl" /> <li><a class="help-link <#if pageAvail?has_content> alert</#if>" href="javascript:lookup_popup2('showHelp?helpTopic=${helpTopic}&portalPageId=${parameters.portalPageId?if_exists}','help' ,500,500);" title="${uiLabelMap.CommonHelp}"></a></li> </#if> Modified: ofbiz/branches/jackrabbit20100709/themes/tomahawk/webapp/tomahawk/css/help.css URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/themes/tomahawk/webapp/tomahawk/css/help.css?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/themes/tomahawk/webapp/tomahawk/css/help.css (original) +++ ofbiz/branches/jackrabbit20100709/themes/tomahawk/webapp/tomahawk/css/help.css Thu Mar 24 07:23:42 2011 @@ -28,7 +28,7 @@ margin-top:10px; .left-border { float:left; -width:50em; +width:35%; } .leftonly { @@ -37,7 +37,6 @@ min-height:25em; } #column-container .leftonly { -margin-left:50em; width:auto; } Modified: ofbiz/branches/jackrabbit20100709/themes/tomahawk/webapp/tomahawk/css/style.css URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/themes/tomahawk/webapp/tomahawk/css/style.css?rev=1084863&r1=1084862&r2=1084863&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/themes/tomahawk/webapp/tomahawk/css/style.css (original) +++ ofbiz/branches/jackrabbit20100709/themes/tomahawk/webapp/tomahawk/css/style.css Thu Mar 24 07:23:42 2011 @@ -2989,3 +2989,23 @@ width:10% * html .ui-autocomplete { height: 250px; } + +/* The custom CSS for adjust the JsTree */ +.jstree-default .jstree-leaf > ins { + background-position:-36px 0; + vertical-align: top; + } +html>/**/body .jstree-default a { +white-space:normal !important; + height: auto; + } +/* IE6 and below */ +* html .jstree-default a { +white-space:normal; +height: auto; +} +/* IE7 */ +*+html .jstree-default a { +white-space:normal; +height: auto; +} |
Free forum by Nabble | Edit this page |