Author: jacopoc
Date: Sun Oct 28 02:41:52 2007 New Revision: 589315 URL: http://svn.apache.org/viewvc?rev=589315&view=rev Log: Isolated Google Base integration into an indipendent specialpurpose component. Mostly based on the patch contributed by Marco Risaliti in OFBIZ-1372 Added: ofbiz/trunk/specialpurpose/googlebase/ ofbiz/trunk/specialpurpose/googlebase/build.xml (with props) ofbiz/trunk/specialpurpose/googlebase/config/ ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties (with props) ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties (with props) ofbiz/trunk/specialpurpose/googlebase/config/googleBaseExport.properties (with props) ofbiz/trunk/specialpurpose/googlebase/data/ ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseTypeData.xml (with props) ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml (with props) ofbiz/trunk/specialpurpose/googlebase/servicedef/ ofbiz/trunk/specialpurpose/googlebase/servicedef/services.xml (with props) ofbiz/trunk/specialpurpose/googlebase/src/ ofbiz/trunk/specialpurpose/googlebase/src/org/ ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/ ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java (with props) ofbiz/trunk/specialpurpose/googlebase/webapp/ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml (with props) ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/web.xml (with props) ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/googleExportLink.ftl (with props) ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/index.jsp (with props) ofbiz/trunk/specialpurpose/googlebase/widget/ ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseForms.xml (with props) ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseMenus.xml (with props) ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseScreens.xml (with props) Removed: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductsExportToGoogle.java Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties ofbiz/trunk/applications/product/config/productsExport.properties ofbiz/trunk/applications/product/servicedef/services.xml ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml ofbiz/trunk/applications/product/webapp/catalog/find/ExportForms.xml ofbiz/trunk/applications/product/webapp/catalog/find/keywordsearch.ftl ofbiz/trunk/applications/product/widget/catalog/FindScreens.xml ofbiz/trunk/specialpurpose/build.xml ofbiz/trunk/specialpurpose/component-load.xml Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?rev=589315&r1=589314&r2=589315&view=diff ============================================================================== --- ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original) +++ ofbiz/trunk/applications/product/config/ProductUiLabels.properties Sun Oct 28 02:41:52 2007 @@ -193,7 +193,6 @@ PageTitlePickListOptions=Pick List Options PageTitlePickingMoveStock=Picking : Move Stock PageTitlePickingViewStartedPicks=Picking : View Started Picks -PageTitleProductsExportToGoogle=Products Export on Google Base PageTitleProductsExportToEbay=Products Export on eBay PageTitleQuickAddProductVariants=Quick Add Product Variants PageTitleSearchInventoryItems=Search Inventory Items @@ -569,12 +568,6 @@ ProductExpireResultsFrom=Expire Results From ProductExplodeOrderItems=Explode Order Items ProductExportToeBay=Export To eBay -ProductExportDeactivated=Deactivated -ProductExportPublish=Publish -ProductExportPublishDraft=Publish Draft -ProductExportTestMode=(Yes=Validate the xml document request to Google Base, No=Send the xml document request to Google Base) -ProductExportToGoogle=Export To Google Base -ProductExportNoTrackingRequested=Not Requested ProductFacilities=Facilities ProductFacilitiesList=Facilities List ProductFacility=Facility @@ -1514,16 +1507,6 @@ productsExportToEbay.exceptionDuringBuildingDataItemsToEbay=Exception occurred during building data items to eBay productsExportToEbay.exceptionInExportToEbay=Exception in exportToEbay productsExportToEbay.productItemsSentCorrecltyToEbay=Product items sent correclty to eBay -productsExportToGoogle.cannotRetrieveUserLogin=Cannot retrieve User Login -productsExportToGoogle.errorDuringAuthenticationToGoogle=Error during authentication to Google Account -productsExportToGoogle.errorInTheResponseFromGoogle=Error in the response from Google : -productsExportToGoogle.exceptionDuringBuildingDataItemsToGoogle=Exception occurred during building data items to Google Base -productsExportToGoogle.exceptionInExportProductCategoryToGoogle=Exception in exportProductCategoryToGoogle -productsExportToGoogle.exceptionInExportToGoogle=Exception in exportToGoogle -productsExportToGoogle.exceptionReadingResponseFromGoogle=Exception reading response from Google -productsExportToGoogle.missingParameterProductCategoryId=Missing parameter productCategoryId -productsExportToGoogle.noProductsAvailableInProductCategory=No products available in the selected productCategoryId -productsExportToGoogle.productItemsSentCorrecltyToGoogle=Product items sent correclty to Google Base productsearchevents.added_x_product_category_members=Added ${numAdded} product category members. productsearchevents.error_getting_search_results=Error getting search results: ${errSearchResult}. productsearchevents.expired_x_items=Expired ${numExpired} items. @@ -1531,7 +1514,6 @@ productsearchevents.no_results_found_probably_error_constraints=No results found, probably because there was an error or were no constraints. productsearchevents.removed_x_items=removed ${numRemoved} items. productsearchevents.thruDate_not_formatted_properly=The thruDate is not formatted properly: ${errDateFormat}. -productsearchevents.exceptionCallingExportToGoogle=Exception calling exportToGoogle productservices.both_productId_and_productIdTo_cannot_be_defined=Both productId and productIdTo cannot be defined. productservices.both_productId_and_productIdTo_cannot_be_null=Both productId and productIdTo cannot be null. productservices.cannot_build_feature_tree_full=Cannot build feature tree: featureList is null. @@ -1906,9 +1888,6 @@ FormFieldTitle_editLink=Edit Link FormFieldTitle_monthsInPastLimit=Months In Past Limit FormFieldTitle_picklistBinId=Picklist Bin -FormFieldTitle_webSiteUrl=Web Site Url -FormFieldTitle_trackingCodeId=Tracking Code Id -FormFieldTitle_actionType=Action Type FormFieldTitle_geoCode=Country FormFieldTitle_location=Location FormFieldTitle_ebayCategory=eBay Category @@ -1927,4 +1906,3 @@ FormFieldTitle_paymentPersonalCheck=Personal check FormFieldTitle_listingDuration=Listing Duration FormFieldTitle_startPrice=Start Price -FormFieldTitle_testMode=Test mode Modified: ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties?rev=589315&r1=589314&r2=589315&view=diff ============================================================================== --- ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties (original) +++ ofbiz/trunk/applications/product/config/ProductUiLabels_it.properties Sun Oct 28 02:41:52 2007 @@ -185,7 +185,6 @@ PageTitlePickListOptions=Opzioni Lista di Prelievo PageTitlePickingMoveStock=Prelievo : Muovi Giacenza PageTitlePickingViewStartedPicks=Prelievo : Mostra Inizio Prelievo -PageTitleProductsExportToGoogle=Esportazioni Prodotti su Google Base PageTitleProductsExportToEbay=Esportazioni Prodotti su eBay PageTitleQuickAddProductVariants=Aggiunta Veloce Varianti Prodotto PageTitleSearchInventoryItems=Ricerca Righe Inventario @@ -554,12 +553,6 @@ ProductExpireResultsFrom=Risultati Scaduti Da ProductExplodeOrderItems=Esplodi Righe Ordine ProductExportToeBay=Esportazione Su eBay -ProductExportDeactivated=Disattiva -ProductExportPublish=Pubblica -ProductExportPublishDraft=Pubblica come Bozza -ProductExportTestMode=(Si=Valida la richiesta del documento xml su Google Base, No=Invia la richiesta del documento xml a Google Base) -ProductExportToGoogle=Esportazione Su Google Base -ProductExportNoTrackingRequested=Non Richiesto ProductFacilities=Stabilimenti ProductFacilitiesList=Lista Stabilimenti ProductFacility=Stabilimento @@ -1473,16 +1466,6 @@ productsExportToEbay.exceptionDuringBuildingDataItemsToEbay=Eccezione accaduta durante la creazione dei dati prodotti per eBay productsExportToEbay.exceptionInExportToEbay=Eccezione in exportToEbay productsExportToEbay.productItemsSentCorrecltyToEbay=Prodotti inviati correttamente su eBay -productsExportToGoogle.cannotRetrieveUserLogin=Non \u00e8 ricavare User Login -productsExportToGoogle.errorDuringAuthenticationToGoogle=Errore durante l\'autenticazione su Google Account -productsExportToGoogle.errorInTheResponseFromGoogle=Errore nella risposta di Google : -productsExportToGoogle.exceptionDuringBuildingDataItemsToGoogle=Eccezione accaduta durante la creazione dei dati prodotti per Google Base -productsExportToGoogle.exceptionInExportProductCategoryToGoogle=Eccezione in exportProductCategoryToGoogle -productsExportToGoogle.exceptionInExportToGoogle=Eccezione in exportToGoogle -productsExportToGoogle.exceptionReadingResponseFromGoogle=Eccezione leggendo la risposta da Google -productsExportToGoogle.missingParameterProductCategoryId=Parametro productCategoryId mancante -productsExportToGoogle.noProductsAvailableInProductCategory=Nessun prodotto disponibile nella categoria prodotto selezionata -productsExportToGoogle.productItemsSentCorrecltyToGoogle=Prodotti inviati correttamente su Google Base productsearchevents.added_x_product_category_members=Aggiunti ${numAdded} membri prodotto categoria. productsearchevents.error_getting_search_results=Errore leggendo i risultati di ricerca: ${errSearchResult}. productsearchevents.expired_x_items=${numExpired} righe Scadute. @@ -1490,7 +1473,6 @@ productsearchevents.no_results_found_probably_error_constraints=Nessun risultato trovato, probabilmente perch\u00e9 c'era un'errore o nessuna costrizione. productsearchevents.removed_x_items=${numRemoved} righe cancellate. productsearchevents.thruDate_not_formatted_properly=La Data A non \u00e8 stata formattata propriamente: ${errDateFormat}. -productsearchevents.exceptionCallingExportToGoogle=Eccezione durante l'esecuzione di exportToGoogle productservices.both_productId_and_productIdTo_cannot_be_defined=Entrambi productId e productIdTo non sono stati definiti. productservices.both_productId_and_productIdTo_cannot_be_null=Entrambi productId e productIdTo non possono essere nulli. productservices.cannot_build_feature_tree_full=Non \u00e8 possibli costruire l'albero delle caratteristiche build feature tree: featureList \u00e8 nulla. @@ -1865,9 +1847,6 @@ FormFieldTitle_editLink=Aggiorna Link FormFieldTitle_monthsInPastLimit=Mesi Nel Limite Passato FormFieldTitle_picklistBinId=Lista di Prelievo -FormFieldTitle_webSiteUrl=Url Sito Web -FormFieldTitle_trackingCodeId=Codice Tracciatura -FormFieldTitle_actionType=Tipo Azione FormFieldTitle_geoCode=Paese FormFieldTitle_location=Localit\u00e0 FormFieldTitle_ebayCategory=Categoria eBay @@ -1886,4 +1865,3 @@ FormFieldTitle_paymentPersonalCheck=Assegno Personale FormFieldTitle_listingDuration=Durata Asta FormFieldTitle_startPrice=Prezzo di Partenza -FormFieldTitle_testMode=In Modo Test Modified: ofbiz/trunk/applications/product/config/productsExport.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/productsExport.properties?rev=589315&r1=589314&r2=589315&view=diff ============================================================================== --- ofbiz/trunk/applications/product/config/productsExport.properties (original) +++ ofbiz/trunk/applications/product/config/productsExport.properties Sun Oct 28 02:41:52 2007 @@ -19,13 +19,6 @@ #### # OFBiz Product Export Settings #### -# Google Product Search -productsExport.google.developerKey= -productsExport.google.authenticationUrl=https://www.google.com/accounts/ClientLogin -productsExport.google.accountEmail= -productsExport.google.accountPassword= -productsExport.google.postItemsUrl=http://www.google.com/base/feeds/items/batch - # eBay productsExport.eBay.devID= productsExport.eBay.appID= Modified: ofbiz/trunk/applications/product/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services.xml?rev=589315&r1=589314&r2=589315&view=diff ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services.xml Sun Oct 28 02:41:52 2007 @@ -1153,25 +1153,6 @@ <auto-attributes include="pk" mode="IN" optional="false"/> </service> <!-- Products Export Services --> - <service name="exportToGoogle" engine="java" - location="org.ofbiz.product.product.ProductsExportToGoogle" invoke="exportToGoogle" auth="true"> - <description>Export products to Google Base</description> - <attribute type="List" mode="IN" name="selectResult" optional="false"/> - <attribute type="String" mode="IN" name="webSiteUrl" optional="false"/> - <attribute type="String" mode="IN" name="imageUrl" optional="true"/> - <attribute type="String" mode="IN" name="actionType" optional="false"/> - <attribute type="String" mode="IN" name="statusId" optional="false"/> - <attribute type="String" mode="IN" name="testMode" optional="false"/> - <attribute type="String" mode="IN" name="trackingCodeId" optional="true"/> - </service> - <service name="exportProductCategoryToGoogle" engine="java" - location="org.ofbiz.product.product.ProductsExportToGoogle" invoke="exportProductCategoryToGoogle" auth="true"> - <description>Export products in a category to Google Base</description> - <attribute type="String" mode="IN" name="productCategoryId" optional="false"/> - <attribute type="String" mode="IN" name="actionType" optional="false"/> - <attribute type="String" mode="IN" name="webSiteUrl" optional="false"/> - <attribute type="String" mode="IN" name="imageUrl" optional="true"/> - </service> <service name="exportToEbay" engine="java" location="org.ofbiz.product.product.ProductsExportToEbay" invoke="exportToEbay" auth="true"> <description>Export products to eBay</description> Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml?rev=589315&r1=589314&r2=589315&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml Sun Oct 28 02:41:52 2007 @@ -2444,25 +2444,6 @@ <request-map uri="LookupFacilityLocation"><security auth="true" https="true"/><response name="success" type="view" value="LookupFacilityLocation"/></request-map> <request-map uri="LookupWorkEffort"><security https="true" auth="true"/><response name="success" type="view" value="LookupWorkEffort"/></request-map> - <request-map uri="ProductsExportToGoogle"> - <security https="true" auth="true"/> - <response name="success" type="view" value="ProductsExportToGoogle"/> - </request-map> - - <request-map uri="exportProductsToGoogle"> - <security https="true" auth="true"/> - <event type="service" path="" invoke="exportToGoogle"/> - <response name="success" type="view" value="ProductsExportToGoogle"/> - <response name="error" type="view" value="ProductsExportToGoogle"/> - </request-map> - - <request-map uri="searchExportProductListToGoogle"> - <security https="true" auth="true"/> - <event type="java" path="org.ofbiz.product.product.ProductSearchEvents" invoke="searchExportProductListToGoogle"/> - <response name="success" type="view" value="ProductsExportToGoogle"/> - <response name="error" type="view" value="ProductsExportToGoogle"/> - </request-map> - <request-map uri="ProductsExportToEbay"> <security https="true" auth="true"/> <response name="success" type="view" value="ProductsExportToEbay"/> @@ -2628,7 +2609,6 @@ <view-map name="ListShipmentMethodTypes" type="screen" page="component://product/widget/catalog/ShippingScreens.xml#ListShipmentMethodTypes"/> <view-map name="ListCarrierShipmentMethods" type="screen" page="component://product/widget/catalog/ShippingScreens.xml#ListCarrierShipmentMethods"/> - <view-map name="ProductsExportToGoogle" type="screen" page="component://product/widget/catalog/FindScreens.xml#ProductsExportToGoogle"/> <view-map name="ProductsExportToEbay" type="screen" page="component://product/widget/catalog/FindScreens.xml#ProductsExportToEbay"/> <!-- Lookup request mappings --> Modified: ofbiz/trunk/applications/product/webapp/catalog/find/ExportForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/find/ExportForms.xml?rev=589315&r1=589314&r2=589315&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/find/ExportForms.xml (original) +++ ofbiz/trunk/applications/product/webapp/catalog/find/ExportForms.xml Sun Oct 28 02:41:52 2007 @@ -20,42 +20,6 @@ <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"> - <form name="ProductsExportToGoogle" type="single" target="searchExportProductListToGoogle"> - <field name="selectResult"><hidden/></field> - <field name="webSiteUrl"><text size="50" maxlength="250"/></field> - <!--<field name="imageUrl"><text size="50" maxlength="250"/></field>--> - <field name="actionType" widget-style="selectBox"> - <drop-down no-current-selected-key="insert"> - <option key="insert" description="${uiLabelMap.CommonInsert}"/> - <option key="update" description="${uiLabelMap.CommonUpdate}"/> - <option key="delete" description="${uiLabelMap.CommonDelete}"/> - </drop-down> - </field> - <field name="statusId"> - <drop-down no-current-selected-key="draft"> - <!-- - <option key="deactivate" description="${uiLabelMap.ProductExportDeactivated}"/> - --> - <option key="draft" description="${uiLabelMap.ProductExportPublishDraft}"/> - <option key="publish" description="${uiLabelMap.ProductExportPublish}"/> - </drop-down> - </field> - <field name="testMode" tooltip="${uiLabelMap.ProductExportTestMode}"> - <drop-down no-current-selected-key="N"> - <option key="N" description="${uiLabelMap.CommonNo}"/> - <option key="Y" description="${uiLabelMap.CommonYes}"/> - </drop-down> - </field> - <field name="trackingCodeId"> - <drop-down no-current-selected-key="_NA_"> - <option key="_NA_" description="${uiLabelMap.ProductExportNoTrackingRequested}"/> - <entity-options entity-name="TrackingCode" description="${description}"> - <entity-order-by field-name="description"/> - </entity-options> - </drop-down> - </field> - <field name="submitButton" title="${uiLabelMap.ProductExportToGoogle}"><submit button-type="button"/></field> - </form> <form name="ProductsExportToEbay" type="single" target="PostProductsToEbay"> <field name="selectResult"><hidden/></field> <field name="country" widget-style="selectBox"> Modified: ofbiz/trunk/applications/product/webapp/catalog/find/keywordsearch.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/find/keywordsearch.ftl?rev=589315&r1=589314&r2=589315&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/find/keywordsearch.ftl (original) +++ ofbiz/trunk/applications/product/webapp/catalog/find/keywordsearch.ftl Sun Oct 28 02:41:52 2007 @@ -63,11 +63,6 @@ e.checked = !e.checked; } - function exportToGoogle() { - document.products.action="<@ofbizUrl>ProductsExportToGoogle</@ofbizUrl>"; - document.products.submit(); - } - function exportToeBay() { document.products.action="<@ofbizUrl>ProductsExportToEbay</@ofbizUrl>"; document.products.submit(); @@ -226,7 +221,6 @@ <div class="tabletext"> <b>${uiLabelMap.ProductSearchExportProductList}:</b> <a href="<@ofbizUrl>searchExportProductList?clearSearch=N</@ofbizUrl>" class="buttontext">${uiLabelMap.ProductSearchExport}</a> <#if productIds?has_content> - <a href="javascript:exportToGoogle();" class="buttontext">${uiLabelMap.ProductExportToGoogle}</a> <a href="javascript:exportToeBay();" class="buttontext">${uiLabelMap.ProductExportToeBay}</a> </#if> </div> Modified: ofbiz/trunk/applications/product/widget/catalog/FindScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/FindScreens.xml?rev=589315&r1=589314&r2=589315&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/FindScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/FindScreens.xml Sun Oct 28 02:41:52 2007 @@ -132,24 +132,6 @@ </widgets> </section> </screen> - - <screen name="ProductsExportToGoogle"> - <section> - <actions> - <set field="titleProperty" value="PageTitleProductsExportToGoogle"/> - </actions> - <widgets> - <decorator-screen name="CommonProductDecorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> - <container> - <label style="head1">${uiLabelMap.PageTitleProductsExportToGoogle}</label> - </container> - <include-form name="ProductsExportToGoogle" location="component://product/webapp/catalog/find/ExportForms.xml"/> - </decorator-section> - </decorator-screen> - </widgets> - </section> - </screen> <screen name="ProductsExportToEbay"> <section> Modified: ofbiz/trunk/specialpurpose/build.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/build.xml?rev=589315&r1=589314&r2=589315&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/build.xml (original) +++ ofbiz/trunk/specialpurpose/build.xml Sun Oct 28 02:41:52 2007 @@ -20,7 +20,7 @@ <project name="OFBiz Special Purpose Applications Build" default="build" basedir="."> <filelist id="application-builds" dir="." - files="pos/build.xml, hhfacility/build.xml, assetmaint/build.xml, oagis/build.xml, bi/build.xml"/> + files="pos/build.xml, hhfacility/build.xml, assetmaint/build.xml, oagis/build.xml, bi/build.xml, googlebase/build.xml"/> <!-- ================================================================== --> <!-- Removes all created files and directories --> Modified: ofbiz/trunk/specialpurpose/component-load.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/component-load.xml?rev=589315&r1=589314&r2=589315&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/component-load.xml (original) +++ ofbiz/trunk/specialpurpose/component-load.xml Sun Oct 28 02:41:52 2007 @@ -27,4 +27,5 @@ <load-component component-location="projectmgr"/> <load-component component-location="oagis"/> <load-component component-location="bi"/> + <load-component component-location="googlebase"/> </component-loader> Added: ofbiz/trunk/specialpurpose/googlebase/build.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/build.xml?rev=589315&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/build.xml (added) +++ ofbiz/trunk/specialpurpose/googlebase/build.xml Sun Oct 28 02:41:52 2007 @@ -0,0 +1,116 @@ +<?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. +--> + +<project name="OFBiz - Google Base Component" default="jar" basedir="."> + + <!-- ================================================================== --> + <!-- Initialization of all property settings --> + <!-- ================================================================== --> + + <target name="init"> + <property environment="env"/> + <property name="desc" value="Google Base Component"/> + <property name="name" value="ofbiz-googlebase"/> + <property name="src.dir" value="src"/> + <property name="dtd.dir" value="dtd"/> + <property name="lib.dir" value="lib"/> + <property name="build.dir" value="build"/> + </target> + + <target name="classpath"> + <path id="local.class.path"> + <fileset dir="../../framework/base/lib" includes="*.jar"/> + <fileset dir="../../framework/base/lib/commons" includes="*.jar"/> + <fileset dir="../../framework/base/lib/j2eespecs" includes="*.jar"/> + <fileset dir="../../framework/base/build/lib" includes="*.jar"/> + <fileset dir="../../framework/entity/lib" includes="*.jar"/> + <fileset dir="../../framework/entity/build/lib" includes="*.jar"/> + <fileset dir="../../framework/security/build/lib" includes="*.jar"/> + <fileset dir="../../framework/service/lib" includes="*.jar"/> + <fileset dir="../../framework/service/build/lib" includes="*.jar"/> + <fileset dir="../../framework/minilang/build/lib" includes="*.jar"/> + <fileset dir="../../framework/webapp/lib" includes="*.jar"/> + <fileset dir="../../framework/webapp/build/lib" includes="*.jar"/> + <fileset dir="../../framework/common/build/lib" includes="*.jar"/> + <fileset dir="../../framework/workflow/build/lib" includes="*.jar"/> + <fileset dir="../../applications/product/build/lib" includes="*.jar"/> + </path> + </target> + + <!-- ================================================================== --> + <!-- Removes all created files and directories --> + <!-- ================================================================== --> + + <target name="clean" depends="clean-lib"> + <delete dir="${build.dir}"/> + </target> + + <target name="clean-lib" depends="init"> + <delete dir="${build.dir}/lib"/> + </target> + + <!-- ================================================================== --> + <!-- Makes sure the needed directory structure is in place --> + <!-- ================================================================== --> + + <target name="prepare" depends="clean-lib"> + <mkdir dir="${build.dir}/classes"/> + <mkdir dir="${build.dir}/lib"/> + </target> + + <target name="prepare-docs" depends="init"> + <mkdir dir="${build.dir}/javadocs"/> + </target> + + <!-- ================================================================== --> + <!-- Compilation of the source files --> + <!-- ================================================================== --> + + <target name="classes" depends="prepare,classpath"> + <javac debug="on" source="1.5" deprecation="on" destdir="${build.dir}/classes"> + <classpath> + <path refid="local.class.path"/> + </classpath> + <src path="${src.dir}"/> + </javac> + <copy todir="${build.dir}/classes"> + <fileset dir="${src.dir}" includes="**/*.properties,**/*.xml,**/*.bsh,**/*.logic,**/*.js,**/*.jacl,**/*.py"/> + </copy> + </target> + + <target name="jar" depends="classes"> + <jar jarfile="${build.dir}/lib/${name}.jar" basedir="${build.dir}/classes"/> + </target> + + <!-- ================================================================== --> + <!-- Build JavaDoc --> + <!-- ================================================================== --> + + <target name="docs" depends="prepare-docs,classpath"> + <javadoc packagenames="org.ofbiz.googlebase.*" + classpathref="local.class.path" + destdir="${build.dir}/javadocs" + windowtitle="Open for Business - ${desc}"> + <sourcepath path="${src.dir}"/> + </javadoc> + </target> + + <target name="all" depends="jar,docs"/> +</project> Propchange: ofbiz/trunk/specialpurpose/googlebase/build.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/googlebase/build.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/googlebase/build.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties?rev=589315&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties (added) +++ ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties Sun Oct 28 02:41:52 2007 @@ -0,0 +1,43 @@ +##################################################################### +# 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. +##################################################################### +GoogleBaseApplication=Google Base Integration +GoogleBaseCompanyName=Ofbiz +GoogleBaseExportDeactivated=Deactivated +GoogleBaseExportPublish=Publish +GoogleBaseExportPublishDraft=Publish Draft +GoogleBaseExportTestMode=(Yes=Validate the xml document request to Google Base, No=Send the xml document request to Google Base) +GoogleBaseExportNoTrackingRequested=Not Requested + +FormFieldTitle_webSiteUrl=Web Site Url +FormFieldTitle_trackingCodeId=Tracking Code Id +FormFieldTitle_actionType=Action Type +FormFieldTitle_testMode=Test mode + +PageTitleGoogleBaseProductsExportToGoogle=Export Products to Google Base + +productsExportToGoogle.cannotRetrieveUserLogin=Cannot retrieve User Login +productsExportToGoogle.errorDuringAuthenticationToGoogle=Error during authentication with Google Account +productsExportToGoogle.errorInTheResponseFromGoogle=Error in the response from Google: +productsExportToGoogle.exceptionDuringBuildingDataItemsToGoogle=Exception occurred during building data items to Google Base +productsExportToGoogle.exceptionInExportProductCategoryToGoogle=Exception in exportProductCategoryToGoogle +productsExportToGoogle.exceptionInExportToGoogle=Exception in exportToGoogle +productsExportToGoogle.exceptionReadingResponseFromGoogle=Exception reading response from Google +productsExportToGoogle.missingParameterProductCategoryId=Missing parameter productCategoryId +productsExportToGoogle.noProductsAvailableInProductCategory=No products available in the selected productCategoryId +productsExportToGoogle.productItemsSentCorrecltyToGoogle=Product items sent correclty to Google Base Propchange: ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties?rev=589315&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties (added) +++ ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties Sun Oct 28 02:41:52 2007 @@ -0,0 +1,43 @@ +##################################################################### +# 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. +##################################################################### +GoogleBaseApplication=Applicazione Per Esportare i Prodotti Su Google Base +GoogleBaseCompanyName=Ofbiz +GoogleBaseExportDeactivated=Disattiva +GoogleBaseExportPublish=Pubblica +GoogleBaseExportPublishDraft=Pubblica come Bozza +GoogleBaseExportTestMode=(Si=Valida la richiesta del documento xml su Google Base, No=Invia la richiesta del documento xml a Google Base) +GoogleBaseExportNoTrackingRequested=Non Richiesto + +FormFieldTitle_webSiteUrl=Url Sito Web +FormFieldTitle_trackingCodeId=Codice Tracciatura +FormFieldTitle_actionType=Tipo Azione +FormFieldTitle_testMode=In Modo Test + +PageTitleGoogleBaseProductsExportToGoogle=Esportazioni Prodotti su Google Base + +productsExportToGoogle.cannotRetrieveUserLogin=Non \u00e8 ricavare User Login +productsExportToGoogle.errorDuringAuthenticationToGoogle=Errore durante l\'autenticazione su Google Account +productsExportToGoogle.errorInTheResponseFromGoogle=Errore nella risposta di Google : +productsExportToGoogle.exceptionDuringBuildingDataItemsToGoogle=Eccezione accaduta durante la creazione dei dati prodotti per Google Base +productsExportToGoogle.exceptionInExportProductCategoryToGoogle=Eccezione in exportProductCategoryToGoogle +productsExportToGoogle.exceptionInExportToGoogle=Eccezione in exportToGoogle +productsExportToGoogle.exceptionReadingResponseFromGoogle=Eccezione leggendo la risposta da Google +productsExportToGoogle.missingParameterProductCategoryId=Parametro productCategoryId mancante +productsExportToGoogle.noProductsAvailableInProductCategory=Nessun prodotto disponibile nella categoria prodotto selezionata +productsExportToGoogle.productItemsSentCorrecltyToGoogle=Prodotti inviati correttamente su Google Base \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/googlebase/config/googleBaseExport.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/config/googleBaseExport.properties?rev=589315&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/config/googleBaseExport.properties (added) +++ ofbiz/trunk/specialpurpose/googlebase/config/googleBaseExport.properties Sun Oct 28 02:41:52 2007 @@ -0,0 +1,27 @@ +############################################################################### +# 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 Product Export Settings +#### +# Google Base Export Products +googleBaseExport.developerKey= +googleBaseExport.authenticationUrl=https://www.google.com/accounts/ClientLogin +googleBaseExport.accountEmail= +googleBaseExport.accountPassword= +googleBaseExport.postItemsUrl=http://www.google.com/base/feeds/items/batch Propchange: ofbiz/trunk/specialpurpose/googlebase/config/googleBaseExport.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/googlebase/config/googleBaseExport.properties ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/googlebase/config/googleBaseExport.properties ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseTypeData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseTypeData.xml?rev=589315&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseTypeData.xml (added) +++ ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseTypeData.xml Sun Oct 28 02:41:52 2007 @@ -0,0 +1,25 @@ +<?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. +--> + +<entity-engine-xml> + + <GoodIdentificationType description="Google Id" goodIdentificationTypeId="GOOGLE_ID" hasTable="N" parentTypeId=""/> + +</entity-engine-xml> Propchange: ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseTypeData.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseTypeData.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseTypeData.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml?rev=589315&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml (added) +++ ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml Sun Oct 28 02:41:52 2007 @@ -0,0 +1,39 @@ +<?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. +--> + +<ofbiz-component name="googlebase" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd"> + <resource-loader name="main" type="component"/> + <classpath type="dir" location="config"/> + <classpath type="jar" location="build/lib/*"/> + + <entity-resource type="data" reader-name="seed" loader="main" location="data/GoogleBaseTypeData.xml"/> + + <service-resource type="model" loader="main" location="servicedef/services.xml"/> + + <webapp name="googlebase" + title="Google Base" + server="default-server" + location="webapp/googlebase" + base-permission="OFBTOOLS" + mount-point="/googlebase" + app-bar-display="true"/> +</ofbiz-component> Propchange: ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/specialpurpose/googlebase/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/servicedef/services.xml?rev=589315&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/servicedef/services.xml (added) +++ ofbiz/trunk/specialpurpose/googlebase/servicedef/services.xml Sun Oct 28 02:41:52 2007 @@ -0,0 +1,46 @@ +<?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. +--> + +<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd"> + <description>Google Base Component Services</description> + <vendor>OFBiz</vendor> + <version>1.0</version> + + <service name="exportToGoogle" engine="java" + location="org.ofbiz.googlebase.ProductsExportToGoogle" invoke="exportToGoogle" auth="true"> + <description>Export products to Google Base</description> + <attribute type="List" mode="IN" name="selectResult" optional="false"/> + <attribute type="String" mode="IN" name="webSiteUrl" optional="false"/> + <attribute type="String" mode="IN" name="imageUrl" optional="true"/> + <attribute type="String" mode="IN" name="actionType" optional="false"/> + <attribute type="String" mode="IN" name="statusId" optional="false"/> + <attribute type="String" mode="IN" name="testMode" optional="false"/> + <attribute type="String" mode="IN" name="trackingCodeId" optional="true"/> + </service> + <service name="exportProductCategoryToGoogle" engine="java" + location="org.ofbiz.googlebase.ProductsExportToGoogle" invoke="exportProductCategoryToGoogle" auth="true"> + <description>Export products in a category to Google Base</description> + <attribute type="String" mode="IN" name="productCategoryId" optional="false"/> + <attribute type="String" mode="IN" name="actionType" optional="false"/> + <attribute type="String" mode="IN" name="webSiteUrl" optional="false"/> + <attribute type="String" mode="IN" name="imageUrl" optional="true"/> + </service> +</services> Propchange: ofbiz/trunk/specialpurpose/googlebase/servicedef/services.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/googlebase/servicedef/services.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/googlebase/servicedef/services.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java?rev=589315&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java (added) +++ ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java Sun Oct 28 02:41:52 2007 @@ -0,0 +1,526 @@ +/******************************************************************************* + * 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.googlebase; + +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.net.URLEncoder; +import java.sql.Timestamp; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; + +import javolution.util.FastList; +import javolution.util.FastMap; + +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilFormatOut; +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.GenericEntityException; +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.LocalDispatcher; +import org.ofbiz.service.ModelService; +import org.ofbiz.service.ServiceUtil; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +public class ProductsExportToGoogle { + + private static final String resource = "GoogleBaseUiLabels"; + private static final String module = ProductsExportToGoogle.class.getName(); + + public static Map exportToGoogle(DispatchContext dctx, Map context) { + Locale locale = (Locale) context.get("locale"); + GenericDelegator delegator = dctx.getDelegator(); + LocalDispatcher dispatcher = dctx.getDispatcher(); + + Map result = null; + try { + String configString = "googleBaseExport.properties"; + + // get the Developer Key + String developerKey = UtilProperties.getPropertyValue(configString, "googleBaseExport.developerKey"); + + // get the Authentication Url + String authenticationUrl = UtilProperties.getPropertyValue(configString, "googleBaseExport.authenticationUrl"); + + // get the Google Account Email + String accountEmail = UtilProperties.getPropertyValue(configString, "googleBaseExport.accountEmail"); + + // get the Google Account Password + String accountPassword = UtilProperties.getPropertyValue(configString, "googleBaseExport.accountPassword"); + + // get the Url to Post Items + String postItemsUrl = UtilProperties.getPropertyValue(configString, "googleBaseExport.postItemsUrl"); + + StringBuffer dataItemsXml = new StringBuffer(); + + result = buildDataItemsXml(dctx, context, dataItemsXml); + if (!ServiceUtil.isFailure(result)) { + String token = authenticate(authenticationUrl, accountEmail, accountPassword); + if (token != null) { + result = postItem(token, postItemsUrl, developerKey, dataItemsXml, locale, (String)context.get("testMode"), (List)result.get("newProductsInGoogle"), (List)result.get("productsRemovedFromGoogle"), dispatcher, delegator); + } else { + Debug.logError("Error during authentication to Google Account", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.errorDuringAuthenticationToGoogle", locale)); + } + } else { + return ServiceUtil.returnFailure(ServiceUtil.getErrorMessage(result)); + } + } catch (Exception e) { + Debug.logError("Exception in exportToGoogle", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.exceptionInExportToGoogle", locale)); + } + return result; + } + + public static Map exportProductCategoryToGoogle(DispatchContext dctx, Map context) { + LocalDispatcher dispatcher = dctx.getDispatcher(); + Locale locale = (Locale) context.get("locale"); + String productCategoryId = (String) context.get("productCategoryId"); + String actionType = (String) context.get("actionType"); + String webSiteUrl = (String) context.get("webSiteUrl"); + String imageUrl = (String) context.get("imageUrl"); + GenericValue userLogin = (GenericValue)context.get("userLogin"); + if (userLogin == null) { + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.cannotRetrieveUserLogin", locale)); + } + + try { + if (UtilValidate.isNotEmpty(productCategoryId)) { + List productsList = FastList.newInstance(); + Map result = dispatcher.runSync("getProductCategoryMembers", UtilMisc.toMap("categoryId", productCategoryId)); + + if (result.get("categoryMembers") != null) { + List productCategoryMembers = (List)result.get("categoryMembers"); + if (productCategoryMembers != null) { + Iterator i = productCategoryMembers.iterator(); + while (i.hasNext()) { + GenericValue prodCatMemb = (GenericValue) i.next(); + + if (prodCatMemb != null) { + String productId = prodCatMemb.getString("productId"); + + if (productId != null) { + GenericValue prod = prodCatMemb.getRelatedOne("Product"); + Timestamp salesDiscontinuationDate = prod.getTimestamp("salesDiscontinuationDate"); + // do not consider discontinued product + if (salesDiscontinuationDate == null) { + productsList.add(productId); + } + } + } + } + } + } + + if (productsList.size() == 0) { + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.noProductsAvailableInProductCategory", locale)); + } else { + Map paramIn = FastMap.newInstance(); + paramIn.put("selectResult", productsList); + paramIn.put("webSiteUrl", webSiteUrl); + paramIn.put("imageUrl", imageUrl); + paramIn.put("actionType", actionType); + paramIn.put("statusId", "publish"); + paramIn.put("testMode", "N"); + paramIn.put("userLogin", userLogin); + result = dispatcher.runSync("exportToGoogle", paramIn); + + if (ServiceUtil.isError(result)) { + return ServiceUtil.returnFailure(ServiceUtil.getErrorMessage(result)); + } + } + } else { + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.missingParameterProductCategoryId", locale)); + } + } catch (Exception e) { + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.exceptionInExportProductCategoryToGoogle", locale)); + } + + return ServiceUtil.returnSuccess(); + } + + private static String authenticate(String authenticationUrl, String accountEmail, String accountPassword) { + String postOutput = null; + String token = null; + try { + postOutput = makeLoginRequest(authenticationUrl, accountEmail, accountPassword); + } catch (IOException e) { + Debug.logError("Could not connect to authentication server: " + e.toString(), module); + return token; + } + + // Parse the result of the login request. If everything went fine, the + // response will look like + // HTTP/1.0 200 OK + // Server: GFE/1.3 + // Content-Type: text/plain + // SID=DQAAAGgA...7Zg8CTN + // LSID=DQAAAGsA...lk8BBbG + // Auth=DQAAAGgA...dk3fA5N + // so all we need to do is look for "Auth" and get the token that comes after it + + StringTokenizer tokenizer = new StringTokenizer(postOutput, "=\n "); + + while (tokenizer.hasMoreElements()) { + if ("Auth".equals(tokenizer.nextToken())) { + if (tokenizer.hasMoreElements()) { + token = tokenizer.nextToken(); + } + break; + } + } + if (token == null) { + Debug.logError("Authentication error. Response from server:\n" + postOutput, module); + } + return token; + } + + private static String makeLoginRequest(String authenticationUrl, String accountEmail, String accountPassword) throws IOException { + // Open connection + URL url = new URL(authenticationUrl); + HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); + + // Set properties of the connection + urlConnection.setRequestMethod("POST"); + urlConnection.setDoInput(true); + urlConnection.setDoOutput(true); + urlConnection.setUseCaches(false); + urlConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + + // Form the POST parameters + StringBuffer content = new StringBuffer(); + content.append("Email=").append(URLEncoder.encode(accountEmail, "UTF-8")); + content.append("&Passwd=").append(URLEncoder.encode(accountPassword, "UTF-8")); + content.append("&source=").append(URLEncoder.encode("Google Base data API for OFBiz", "UTF-8")); + content.append("&service=").append(URLEncoder.encode("gbase", "UTF-8")); + + OutputStream outputStream = urlConnection.getOutputStream(); + outputStream.write(content.toString().getBytes("UTF-8")); + outputStream.close(); + + // Retrieve the output + int responseCode = urlConnection.getResponseCode(); + InputStream inputStream; + if (responseCode == HttpURLConnection.HTTP_OK) { + inputStream = urlConnection.getInputStream(); + } else { + inputStream = urlConnection.getErrorStream(); + } + + return toString(inputStream); + } + + private static String toString(InputStream inputStream) throws IOException { + String string; + StringBuffer outputBuilder = new StringBuffer(); + 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 token, String postItemsUrl, String developerKey, StringBuffer dataItems, + Locale locale, String testMode, List newProductsInGoogle, List productsRemovedFromGoogle, LocalDispatcher dispatcher, GenericDelegator delegator) throws IOException { + if (Debug.verboseOn()) { + Debug.logVerbose("Request To Google Base :\n" + dataItems.toString(), module); + } + + HttpURLConnection connection = (HttpURLConnection)(new URL(postItemsUrl)).openConnection(); + + // Test Mode Yes (add the dry-run=true) + if (UtilValidate.isNotEmpty(testMode) && "Y".equals(testMode)) { + connection.setRequestProperty("dry-run", "true"); + } + + connection.setDoInput(true); + connection.setDoOutput(true); + connection.setRequestMethod("POST"); + connection.setRequestProperty("Content-Type", "application/atom+xml"); + connection.setRequestProperty("Authorization", "GoogleLogin auth=" + token); + connection.setRequestProperty("X-Google-Key", "key=" + developerKey); + + OutputStream outputStream = connection.getOutputStream(); + outputStream.write(dataItems.toString().getBytes()); + outputStream.close(); + + int responseCode = connection.getResponseCode(); + InputStream inputStream; + Map result = FastMap.newInstance(); + String response = ""; + if (responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_OK) { + inputStream = connection.getInputStream(); + response = toString(inputStream); + if (response != null && response.length() > 0) { + result = readResponseFromGoogle(response, newProductsInGoogle, productsRemovedFromGoogle, dispatcher, delegator, locale); + //String msg = ServiceUtil.getErrorMessage(result); + if (ServiceUtil.isError(result)) { + result = ServiceUtil.returnFailure((List)result.get(ModelService.ERROR_MESSAGE_LIST)); + } else { + result = ServiceUtil.returnSuccess(); + } + } + } else { + inputStream = connection.getErrorStream(); + response = toString(inputStream); + result = ServiceUtil.returnFailure(response); + } + + if (Debug.verboseOn()) { + Debug.logVerbose("Response From Google Base :\n" + response, module); + } + return result; + } + + private static Map buildDataItemsXml(DispatchContext dctx, Map context, StringBuffer dataItemsXml) { + Locale locale = (Locale)context.get("locale"); + List newProductsInGoogle = FastList.newInstance(); + List productsRemovedFromGoogle = FastList.newInstance(); + try { + GenericDelegator delegator = dctx.getDelegator(); + LocalDispatcher dispatcher = dctx.getDispatcher(); + List selectResult = (List)context.get("selectResult"); + String webSiteUrl = (String)context.get("webSiteUrl"); + String imageUrl = (String)context.get("imageUrl"); + String actionType = (String)context.get("actionType"); + String statusId = (String)context.get("statusId"); + String trackingCodeId = (String)context.get("trackingCodeId"); + + if (!webSiteUrl.startsWith("http://") && !webSiteUrl.startsWith("https://")) { + webSiteUrl = "http://" + webSiteUrl; + } + if (webSiteUrl.endsWith("/")) { + webSiteUrl = webSiteUrl.substring(0, webSiteUrl.length() - 1); + } + // Get the list of products to be exported to Google Base + List productsList = delegator.findByCondition("Product", new EntityExpr("productId", EntityOperator.IN, selectResult), null, null); + + // Get the tracking code + if (UtilValidate.isEmpty(trackingCodeId) || "_NA_".equals(trackingCodeId)) { + trackingCodeId = ""; + } else { + trackingCodeId = "?atc=" + trackingCodeId; + } + + try { + Document feedDocument = UtilXml.makeEmptyXmlDocument("feed"); + Element feedElem = feedDocument.getDocumentElement(); + feedElem.setAttribute("xmlns", "http://www.w3.org/2005/Atom"); + feedElem.setAttribute("xmlns:openSearch", "http://a9.com/-/spec/opensearchrss/1.0/"); + feedElem.setAttribute("xmlns:g", "http://base.google.com/ns/1.0"); + feedElem.setAttribute("xmlns:batch", "http://schemas.google.com/gdata/batch"); + feedElem.setAttribute("xmlns:app", "http://purl.org/atom/app#"); + + // Iterate the product list getting all the relevant data + Iterator productsListItr = productsList.iterator(); + int index = 0; + String itemActionType = null; + while(productsListItr.hasNext()) { + itemActionType = actionType; + GenericValue prod = (GenericValue)productsListItr.next(); + String price = getProductPrice(dispatcher, prod); + if (price == null) { + Debug.logInfo("Price not found for product [" + prod.getString("productId")+ "]; product will not be exported.", module); + continue; + } + // TODO: improve this (i.e. get the relative path from the properies file) + String link = webSiteUrl + "/ecommerce/control/product/~product_id=" + prod.getString("productId") + trackingCodeId; + String title = UtilFormatOut.encodeXmlValue(prod.getString("productName")); + String description = UtilFormatOut.encodeXmlValue(prod.getString("description")); + String imageLink = ""; + if (UtilValidate.isNotEmpty(prod.getString("largeImageUrl"))) { + imageLink = webSiteUrl + prod.getString("largeImageUrl"); + } else if (UtilValidate.isNotEmpty(prod.getString("mediumImageUrl"))) { + imageLink = webSiteUrl + prod.getString("mediumImageUrl"); + } else if (UtilValidate.isNotEmpty(prod.getString("smallImageUrl"))) { + imageLink = webSiteUrl + prod.getString("smallImageUrl"); + } + + String googleProductId = null; + if (!"insert".equals(actionType)) { + try { + GenericValue googleProduct = delegator.findByPrimaryKey("GoodIdentification", UtilMisc.toMap("productId", prod.getString("productId"), "goodIdentificationTypeId", "GOOGLE_ID")); + if (UtilValidate.isNotEmpty(googleProduct)) { + googleProductId = googleProduct.getString("idValue"); + } + } catch(GenericEntityException gee) { + Debug.logError("Unable to get the Google id for product [" + prod.getString("productId") + "]: " + gee.getMessage(), module); + } + } + if ("update".equals(actionType) && UtilValidate.isEmpty(googleProductId)) { + itemActionType = "insert"; + } + Element entryElem = UtilXml.addChildElement(feedElem, "entry", feedDocument); + Element batchElem = UtilXml.addChildElement(entryElem, "batch:operation", feedDocument); + batchElem.setAttribute("type", itemActionType); + + // status is draft or deactivate + if (statusId != null && ("draft".equals(statusId) || "deactivate".equals(statusId))) { + Element appControlElem = UtilXml.addChildElement(entryElem, "app:control", feedDocument); + UtilXml.addChildElementValue(appControlElem, "app:draft", "yes", feedDocument); + + // status is deactivate + if ("deactivate".equals(statusId)) { + UtilXml.addChildElement(appControlElem, "gm:disapproved", feedDocument); + } + } + + UtilXml.addChildElementValue(entryElem, "title", title, feedDocument); + + Element contentElem = UtilXml.addChildElementValue(entryElem, "content", description, feedDocument); + contentElem.setAttribute("type", "xhtml"); + + if (UtilValidate.isNotEmpty(googleProductId)) { + UtilXml.addChildElementValue(entryElem, "id", googleProductId, feedDocument); + } else { + UtilXml.addChildElementValue(entryElem, "id", link, feedDocument); + } + + Element linkElem = UtilXml.addChildElement(entryElem, "link", feedDocument); + linkElem.setAttribute("rel", "alternate"); + linkElem.setAttribute("type", "text/html"); + linkElem.setAttribute("href", link); + + UtilXml.addChildElementValue(entryElem, "g:item_type", "products", feedDocument); + UtilXml.addChildElementValue(entryElem, "g:price", price, feedDocument); + + // if the product has an image it will be published on Google Product Search + if (UtilValidate.isNotEmpty(imageLink)) { + UtilXml.addChildElementValue(entryElem, "g:image_link", imageLink, feedDocument); + } + // if the product is exported to google for the first time, we add it to the list + if ("insert".equals(itemActionType)) { + newProductsInGoogle.add(prod.getString("productId")); + productsRemovedFromGoogle.add(null); + } else if ("delete".equals(itemActionType)) { + newProductsInGoogle.add(null); + productsRemovedFromGoogle.add(prod.getString("productId")); + } else { + newProductsInGoogle.add(null); + productsRemovedFromGoogle.add(null); + } + index++; + } + + dataItemsXml.append(UtilXml.writeXmlDocument(feedDocument)); + } catch (Exception e) { + Debug.logError("Exception during building data items to Google", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.exceptionDuringBuildingDataItemsToGoogle", locale)); + } + } catch (Exception e) { + Debug.logError("Exception during building data items to Google", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.exceptionDuringBuildingDataItemsToGoogle", locale)); + } + Map result = ServiceUtil.returnSuccess(); + result.put("newProductsInGoogle", newProductsInGoogle); + result.put("productsRemovedFromGoogle", productsRemovedFromGoogle); + return result; + } + + private static String getProductPrice(LocalDispatcher dispatcher, GenericValue product) { + String priceString = null; + try { + Map map = dispatcher.runSync("calculateProductPrice", UtilMisc.toMap("product", product)); + boolean validPriceFound = ((Boolean)map.get("validPriceFound")).booleanValue(); + boolean isSale = ((Boolean)map.get("isSale")).booleanValue(); + if (validPriceFound) { + priceString = UtilFormatOut.formatPrice((Double)map.get("price")); + } + } catch(Exception e){ + Debug.logError("Exception calculating price for product [" + product.getString("productId") + "]", module); + } + return priceString; + } + + private static Map readResponseFromGoogle(String msg, List newProductsInGoogle, List productsRemovedFromGoogle, LocalDispatcher dispatcher, GenericDelegator delegator, Locale locale) { + List message = FastList.newInstance(); + try { + Document docResponse = UtilXml.readXmlDocument(msg, true); + Element elemResponse = docResponse.getDocumentElement(); + List atomEntryList = UtilXml.childElementList(elemResponse, "atom:entry"); + Iterator atomEntryElemIter = atomEntryList.iterator(); + int index = 0; + while (atomEntryElemIter.hasNext()) { + Element atomEntryElement = (Element)atomEntryElemIter.next(); + String id = UtilXml.childElementValue(atomEntryElement, "atom:id", ""); + if (UtilValidate.isNotEmpty(id) && newProductsInGoogle.get(index) != null) { + String productId = (String)newProductsInGoogle.get(index); + try { + GenericValue googleProductId = delegator.makeValue("GoodIdentification"); + googleProductId.set("goodIdentificationTypeId", "GOOGLE_ID"); + googleProductId.set("productId", productId); + googleProductId.set("idValue", id); + delegator.createOrStore(googleProductId); + } catch (GenericEntityException gee) { + Debug.logError("Unable to create or update Google id for product [" + productId + "]: " + gee.getMessage(), module); + } + } + if (UtilValidate.isNotEmpty(id) && productsRemovedFromGoogle.get(index) != null) { + String productId = (String)productsRemovedFromGoogle.get(index); + try { + int count = delegator.removeByAnd("GoodIdentification", UtilMisc.toMap("goodIdentificationTypeId", "GOOGLE_ID", "productId", productId)); + } catch (GenericEntityException gee) { + Debug.logError("Unable to remove Google id for product [" + productId + "]: " + gee.getMessage(), module); + } + } + String title = UtilXml.childElementValue(atomEntryElement, "atom:title", ""); + List batchStatusList = UtilXml.childElementList(atomEntryElement, "batch:status"); + Iterator batchStatusEntryElemIter = batchStatusList.iterator(); + while (batchStatusEntryElemIter.hasNext()) { + Element batchStatusEntryElement = (Element)batchStatusEntryElemIter.next(); + if (UtilValidate.isNotEmpty(batchStatusEntryElement.getAttribute("reason"))) { + message.add(title + " " + batchStatusEntryElement.getAttribute("reason")); + } + } + String errors = UtilXml.childElementValue(atomEntryElement, "batch:status", ""); + if (UtilValidate.isNotEmpty(errors)) { + message.add(title + " " + errors); + } + index++; + } + } catch (Exception e) { + 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); + } + return ServiceUtil.returnSuccess(); + } +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml?rev=589315&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml (added) +++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml Sun Oct 28 02:41:52 2007 @@ -0,0 +1,60 @@ +<?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>Google Base 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="ProductsExportToGoogle"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ProductsExportToGoogle"/> + </request-map> + + <request-map uri="exportProductsToGoogle"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="exportToGoogle"/> + <response name="success" type="view" value="ProductsExportToGoogle"/> + <response name="error" type="view" value="ProductsExportToGoogle"/> + </request-map> + + <request-map uri="searchExportProductListToGoogle"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.product.product.ProductSearchEvents" invoke="searchExportProductListToGoogle"/> + <response name="success" type="view" value="ProductsExportToGoogle"/> + <response name="error" type="view" value="ProductsExportToGoogle"/> + </request-map> + + <!-- end of request mappings --> + + <!-- View Mappings --> + <view-map name="main" type="screen" page="component://googlebase/widget/GoogleBaseScreens.xml#advancedsearch"/> + <view-map name="advancedsearch" type="screen" page="component://googlebase/widget/GoogleBaseScreens.xml#advancedsearch"/> + <view-map name="keywordsearch" type="screen" page="component://googlebase/widget/GoogleBaseScreens.xml#keywordsearch"/> + + <view-map name="ProductsExportToGoogle" type="screen" page="component://googlebase/widget/GoogleBaseScreens.xml#ProductsExportToGoogle"/> + <!-- end of view mappings --> +</site-conf> Propchange: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/web.xml?rev=589315&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/web.xml (added) +++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/web.xml Sun Oct 28 02:41:52 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>Google Base 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>googlebase</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://googlebase/widget/GoogleBaseScreens.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/googlebase/webapp/googlebase/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml |
Free forum by Nabble | Edit this page |