From 46cd6a9ccdf09a5d0f862a2b8cfd362b80ba1dfc Mon Sep 17 00:00:00 2001 From: Hans Bakker Date: Mon, 14 Mar 2011 06:59:16 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=A2=20Fix=20any=20errors=20on=20GoogleBas?= =?UTF-8?q?eSearchEvents.java=20and=20ProductsExportToGoogle.java=20file.?= =?UTF-8?q?=20=E2=80=A2=20Edit=20productsExportToGoogle=20form=20to=20cons?= =?UTF-8?q?train=20the=20country=20code=20that=20getting=20it=20from=20def?= =?UTF-8?q?aultLocaleString=20field=20of=20ProductStore=20entity=20(before?= =?UTF-8?q?=20it=20was=20a=20combobox=20that=20select=20by=20user).=20?= =?UTF-8?q?=E2=80=A2=20Add=20the=20new=20type=20of=20GoodIdentificationTyp?= =?UTF-8?q?e=20entity=20that=20relate=20to=20Google=20Base=20Id=20includin?= =?UTF-8?q?g=20GOOGLE=5FID=5Fen=5FUS,=20GOOGLE=5FID=5Fen=5FGB,=20GOOGLE=5F?= =?UTF-8?q?ID=5Fde=20for=20identify=20each=20productStore=20with=20its=20l?= =?UTF-8?q?anguage.=20=E2=80=A2=20Add=20the=20Google=20Base=20Auto=20Updat?= =?UTF-8?q?e=20function.=20=E2=80=A2=20Add=20the=20new=20filter=20of=20Goo?= =?UTF-8?q?gleBaseAdvanceSearch=20including=20ACTIVE=5FPRODUCT,=20GOOGLE?= =?UTF-8?q?=5FSYNCED=20and=20DISCONTINUED=5FPRODUCT.=20=E2=80=A2=20Add=20a?= =?UTF-8?q?llowRecommended=20option=20for=20add=20the=20recommended=20attr?= =?UTF-8?q?ibute=20to=20Google=20Base=20such=20as=20QUANTITY,=20COLOR,=20?= =?UTF-8?q?=20YEAR=5FMADE=20etc.=20=E2=80=A2=20Add=20the=20Google=20Base?= =?UTF-8?q?=20help.=20A=20contribution=20of=20Antwebsystems=20employees=20?= =?UTF-8?q?M=20and=20Ton2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1081270 13f79535-47bb-0310-9956-ffa450edef68 --- googlebase/config/GoogleBaseUiLabels.xml | 8 + .../config/autoUpdateToGoogleBase.properties | 63 +++++ googlebase/data/GoogleBaseHelpData.xml | 25 ++ googlebase/data/GoogleBaseTypeData.xml | 4 + googlebase/data/helpdata/HELP_GOOGLEBASE.xml | 89 +++++++ .../org/ofbiz/googlebase/GooglebaseEvents.xml | 56 +++++ .../ofbiz/googlebase/GooglebaseServices.xml | 175 +++++++++++++ googlebase/servicedef/services.xml | 7 + .../googlebase/GoogleBaseSearchEvents.java | 21 +- .../googlebase/ProductsExportToGoogle.java | 237 ++++++++++++++---- .../WEB-INF/actions/FilterProducts.groovy | 91 +++++++ .../actions/GoogleBaseAdvancedSearch.groovy | 4 + .../WEB-INF/actions/autoUpdateConfig.groovy | 61 +++++ .../actions/googlebaseDivideList.groovy | 27 ++ .../actions/productsExportToGoogle.groovy | 17 ++ .../actions/productsToGooglebase.groovy | 65 +++++ .../webapp/googlebase/WEB-INF/controller.xml | 12 + .../find/GoogleBaseAdvancedSearch.ftl | 22 ++ .../googlebase/find/googleExportLink.ftl | 14 +- googlebase/widget/GoogleBaseForms.xml | 55 +++- googlebase/widget/GoogleBaseMenus.xml | 1 + googlebase/widget/GoogleBaseScreens.xml | 26 ++ 22 files changed, 1021 insertions(+), 59 deletions(-) create mode 100644 googlebase/config/autoUpdateToGoogleBase.properties create mode 100644 googlebase/data/GoogleBaseHelpData.xml create mode 100644 googlebase/data/helpdata/HELP_GOOGLEBASE.xml create mode 100644 googlebase/script/org/ofbiz/googlebase/GooglebaseEvents.xml create mode 100644 googlebase/script/org/ofbiz/googlebase/GooglebaseServices.xml create mode 100644 googlebase/webapp/googlebase/WEB-INF/actions/FilterProducts.groovy create mode 100644 googlebase/webapp/googlebase/WEB-INF/actions/autoUpdateConfig.groovy create mode 100644 googlebase/webapp/googlebase/WEB-INF/actions/googlebaseDivideList.groovy create mode 100644 googlebase/webapp/googlebase/WEB-INF/actions/productsToGooglebase.groovy diff --git a/googlebase/config/GoogleBaseUiLabels.xml b/googlebase/config/GoogleBaseUiLabels.xml index 031a30811..75abf53c0 100644 --- a/googlebase/config/GoogleBaseUiLabels.xml +++ b/googlebase/config/GoogleBaseUiLabels.xml @@ -72,6 +72,10 @@ ฐานข้อมูลสาธารณะทั้งหมด Google Base集成 + + Auto Update Options + อัพเดทแบบอัตโนมัติ + Ofbiz Ofbiz @@ -176,6 +180,10 @@ คุณไม่มีการอนุญาตให้แสดงหน้านี้. ("GOOGLEBASE_VIEW" ต้องการ) 你没有浏览这个页面的权限(需要GOOGLEBASE_VIEW)。 + + Allow Google Base Recommended + อนุญาติให้เพิ่มฟิลด์ที่แนะนำ + Export Products to Google Base Exporter les articles vers Google Base diff --git a/googlebase/config/autoUpdateToGoogleBase.properties b/googlebase/config/autoUpdateToGoogleBase.properties new file mode 100644 index 000000000..1c7fefe88 --- /dev/null +++ b/googlebase/config/autoUpdateToGoogleBase.properties @@ -0,0 +1,63 @@ +############################################################################### +# 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. +############################################################################### +#### +# OFBiz Auto Update To Google Base Setting +#### +# Google Base Configuration + +# separate each value by comma(',') with no space and setting of each productStore are ordered from left to right. +# for example: +# autoUpdateGoogleBase.productStoreId=9000,9001 +# autoUpdateGoogleBase.productStore.option.outOfStock=Y,N +# autoUpdateGoogleBase.productStore.option.backInStock=N,Y +# it means productStoreId:9000 has outOfStock option:Y and backInStock option:N +# and productStoreId:9001 has outOfStock option:N and backInStock option:Y +autoUpdateGoogleBase.productStoreId=9000 + +# productStore.option.outOfStock +# default value: "Y" +autoUpdateGoogleBase.productStore.option.outOfStock=Y +# productStore.option.backIntoStock +# default value: "Y" +autoUpdateGoogleBase.productStore.option.backInStock=Y + +# productStore.webSiteUrl of productStore; if null, it will get from standardContentPrefix field of WebSite entity +# default value: http://demo.ofbiz.org +autoUpdateGoogleBase.productStore.webSiteUrl=http://demo.ofbiz.org +# productStore.actionType including: "insert", "update", "delete" +# default value: "insert" +autoUpdateGoogleBase.productStore.actionType=insert +# productStore.statusId including "draft", "publish" +# default value: "draft" +autoUpdateGoogleBase.productStore.statusId=draft +# productStore.testMode including "Y", "N" +# default value: "N" +autoUpdateGoogleBase.productStore.testMode=N +# productStore.webSiteMountPoint +# default value: ecommerce +autoUpdateGoogleBase.productStore.webSiteMountPoint=ecommerce +# productStore.countryCode including "US", "GB", "DE" +# default value: "US" +autoUpdateGoogleBase.productStore.countryCode=US +# productStore.trackingCodeId +# default value: _NA_ +autoUpdateGoogleBase.productStore.trackingCodeId=_NA_ +# productStore.autoUpdateGoogleBase +# default value: "N" +autoUpdateGoogleBase.productStore.allowRecommended=N diff --git a/googlebase/data/GoogleBaseHelpData.xml b/googlebase/data/GoogleBaseHelpData.xml new file mode 100644 index 000000000..86dcb16c9 --- /dev/null +++ b/googlebase/data/GoogleBaseHelpData.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/googlebase/data/GoogleBaseTypeData.xml b/googlebase/data/GoogleBaseTypeData.xml index 333379de9..fe8320da1 100644 --- a/googlebase/data/GoogleBaseTypeData.xml +++ b/googlebase/data/GoogleBaseTypeData.xml @@ -22,4 +22,8 @@ under the License. + + + + diff --git a/googlebase/data/helpdata/HELP_GOOGLEBASE.xml b/googlebase/data/helpdata/HELP_GOOGLEBASE.xml new file mode 100644 index 000000000..9ea095a5c --- /dev/null +++ b/googlebase/data/helpdata/HELP_GOOGLEBASE.xml @@ -0,0 +1,89 @@ + + +
+ Google Base Help + The google base component provide to export products feed up to google base. + + + + Go to Google Base Component. + There are 3 main menus including Google Base Configurations, Export to Google Base and Auto Update Options. + + + +
+ How to add the Google Base Configurations? + First of all, you must add the google base configuration to each product store. + + + + At 'Add Google Base Configuration' screen. + Appropriately insert all field of the google base configuration. + Select the Product Store Id. + The Authentication Url is "https://www.google.com/accounts/ClientLogin". + The Post Items Url is "http://www.google.com/base/feeds/items/batch". + The Web Site Id is "GOOGLEBASE" (default). + Lastly, click 'Add'. + + + + Notice: The Developer Key is got from google base according to your google's account. +
+
+ How to export product feed to google base? + You can export the selected products up to google base, this function generates the feed for google base. + Addition: Filter Product Status Description. + + + "Active Product" is the product which is active in OFBiz, not in Google Base. There use "thruDate" field to check what is active or not. + "Product not currently synced with Google Base" is the product which hasn't exported to Google Base yet. + + + Addition: Discontinued Description. + If you check "Exclude sending discontinued product and stock is zero" box, the search result will only has the product which is not discontinued and is available in stock. + + + + At 'Export To Google Base' screen. + Choose the product store, you can fill in any search option. + Click 'Find'. + Select any products, then click 'Export to Google Base'. + Fill in the configurations including "Country Code", "Web Site Url". For example; Country Code = "US", Web Site Url = "http://ofbizdemo2.antwebsystems.com", Web Site Mount Point = "ecommerce", Action Type = "insert", Status ID = "Publish Draft", Test Mode = "No". + You can select 'GoogleBaseRecommended' for add more detail of google base feed elements. + Click 'Export to Google Base', the system will exports product feed to Google Base. + + + +
+
+ How to use the auto update to google base? + The auto update function repeats to export feed according to the frequency of scheduled job. So don't forget to add the scheduled job to run "autoUpdateToGoogleBase" service. + + + + Set the Auto Update to Google Base at "autoUpdateToGoogleBase.properties". + You can see that config at Google Base Auto Update Config section. + Add the scheduled job to run "autoUpdateToGoogleBase" service. + + + + Notice: After you once created the scheduled job of "autoUpdateToGoogleBase" service, you can start/stop scheduled at 'Start/Stop Auto Update to Google Base Scheduled' section. +
+
diff --git a/googlebase/script/org/ofbiz/googlebase/GooglebaseEvents.xml b/googlebase/script/org/ofbiz/googlebase/GooglebaseEvents.xml new file mode 100644 index 000000000..65f9cdaea --- /dev/null +++ b/googlebase/script/org/ofbiz/googlebase/GooglebaseEvents.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/googlebase/script/org/ofbiz/googlebase/GooglebaseServices.xml b/googlebase/script/org/ofbiz/googlebase/GooglebaseServices.xml new file mode 100644 index 000000000..176402298 --- /dev/null +++ b/googlebase/script/org/ofbiz/googlebase/GooglebaseServices.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/googlebase/widget/GoogleBaseForms.xml b/googlebase/widget/GoogleBaseForms.xml index 5193ed576..3cd7722d5 100644 --- a/googlebase/widget/GoogleBaseForms.xml +++ b/googlebase/widget/GoogleBaseForms.xml @@ -22,16 +22,14 @@ under the License. xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
+ + + - - - - + + + @@ -69,6 +67,7 @@ under the License. +
@@ -104,4 +103,44 @@ under the License. +
+ +