Author: jacopoc
Date: Sun Oct 28 22:51:01 2007 New Revision: 589499 URL: http://svn.apache.org/viewvc?rev=589499&view=rev Log: Applied new patch from Marco Risaliti (OFBIZ-1372), plus additional cleanups I did in the process, to complete the task of pulling out of the product component the code related to the integration with Google Base. Added: ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseSecurityData.xml ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/GoogleBaseSearchEvents.java Modified: ofbiz/trunk/applications/product/data/ProductTypeData.xml ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java ofbiz/trunk/specialpurpose/googlebase/ (props changed) ofbiz/trunk/specialpurpose/googlebase/build.xml ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/web.xml ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/googleExportLink.ftl ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseForms.xml ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseMenus.xml ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseScreens.xml Modified: ofbiz/trunk/applications/product/data/ProductTypeData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/data/ProductTypeData.xml?rev=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/applications/product/data/ProductTypeData.xml (original) +++ ofbiz/trunk/applications/product/data/ProductTypeData.xml Sun Oct 28 22:51:01 2007 @@ -138,7 +138,6 @@ <GoodIdentificationType description="SKU" goodIdentificationTypeId="SKU" hasTable="N" parentTypeId=""/> <GoodIdentificationType description="UPCA" goodIdentificationTypeId="UPCA" hasTable="N" parentTypeId=""/> <GoodIdentificationType description="UPCE" goodIdentificationTypeId="UPCE" hasTable="N" parentTypeId=""/> - <GoodIdentificationType description="Google Id" goodIdentificationTypeId="GOOGLE_ID" hasTable="N" parentTypeId=""/> <InventoryItemType description="Serialized" hasTable="N" inventoryItemTypeId="SERIALIZED_INV_ITEM" parentTypeId=""/> <InventoryItemType description="Non-Serialized" hasTable="N" inventoryItemTypeId="NON_SERIAL_INV_ITEM" parentTypeId=""/> Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java?rev=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchEvents.java Sun Oct 28 22:51:01 2007 @@ -455,99 +455,6 @@ return "success"; } - public static String searchExportProductListToGoogle(HttpServletRequest request, HttpServletResponse response) { - LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); - Locale locale = UtilHttp.getLocale(request); - GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); - String selectResult = (String) request.getParameter("selectResult"); - List productExportList = new ArrayList(); - String errMsg = null; - - try { - boolean beganTransaction = TransactionUtil.begin(DEFAULT_TX_TIMEOUT); - try { - if (UtilValidate.isEmpty(selectResult)) { - // If the passed list of product ids is empty, get the list from the search parameters in the request - EntityListIterator eli = getProductSearchResults(request); - if (eli == null) { - errMsg = UtilProperties.getMessage(resource,"productsearchevents.no_results_found_probably_error_constraints", UtilHttp.getLocale(request)); - Debug.logError(errMsg, module); - request.setAttribute("_ERROR_MESSAGE_", errMsg); - return "error"; - } - - GenericValue searchResultView = null; - while ((searchResultView = (GenericValue) eli.next()) != null) { - productExportList.add(searchResultView.getString("mainProductId")); - } - eli.close(); - } else { - if (selectResult.startsWith("[")) { - productExportList = StringUtil.toList(selectResult); - } else { - productExportList.add(selectResult); - } - } - String webSiteUrl = (String) request.getParameter("webSiteUrl"); - String imageUrl = (String) request.getParameter("imageUrl"); - String actionType = (String) request.getParameter("actionType"); - String statusId = (String) request.getParameter("statusId"); - String testMode = (String) request.getParameter("testMode"); - String trackingCodeId = (String) request.getParameter("trackingCodeId"); - - // Export all or selected products to Google Base - try { - Map inMap = UtilMisc.toMap("selectResult", productExportList, - "webSiteUrl", webSiteUrl, - "imageUrl", imageUrl, - "actionType", actionType, - "statusId", statusId, - "testMode", testMode); - inMap.put("trackingCodeId", trackingCodeId); - inMap.put("userLogin", userLogin); - Map exportResult = dispatcher.runSync("exportToGoogle", inMap); - if (ServiceUtil.isError(exportResult)) { - List errorMessages = (List)exportResult.get(ModelService.ERROR_MESSAGE_LIST); - if (UtilValidate.isNotEmpty(errorMessages)) { - request.setAttribute("_ERROR_MESSAGE_LIST_", errorMessages); - } else { - request.setAttribute("_ERROR_MESSAGE_", ServiceUtil.getErrorMessage(exportResult)); - } - return "error"; - } else if (ServiceUtil.isFailure(exportResult)) { - List eventMessages = (List)exportResult.get(ModelService.ERROR_MESSAGE_LIST); - if (UtilValidate.isNotEmpty(eventMessages)) { - request.setAttribute("_EVENT_MESSAGE_LIST_", eventMessages); - } else { - request.setAttribute("_EVENT_MESSAGE_", ServiceUtil.getErrorMessage(exportResult)); - } - } else { - request.setAttribute("_EVENT_MESSAGE_", exportResult.get("successMessage")); - } - } catch (GenericServiceException e) { - errMsg = UtilProperties.getMessage(resource, "productsearchevents.exceptionCallingExportToGoogle", locale); - Debug.logError(e, errMsg, module); - request.setAttribute("_ERROR_MESSAGE_", errMsg); - return "error"; - } - } catch (GenericEntityException e) { - errMsg = UtilProperties.getMessage(resource, "productsearchevents.error_getting_search_results", locale); - Debug.logError(e, errMsg, module); - request.setAttribute("_ERROR_MESSAGE_", errMsg); - return "error"; - } finally { - TransactionUtil.commit(beganTransaction); - } - } catch (GenericTransactionException e) { - errMsg = UtilProperties.getMessage(resource, "productsearchevents.error_getting_search_results", locale); - Debug.logError(e, errMsg, module); - request.setAttribute("_ERROR_MESSAGE_", errMsg); - return "error"; - } - - return "success"; - } - public static EntityListIterator getProductSearchResults(HttpServletRequest request) { HttpSession session = request.getSession(); GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator"); Propchange: ofbiz/trunk/specialpurpose/googlebase/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Sun Oct 28 22:51:01 2007 @@ -0,0 +1 @@ +build Modified: ofbiz/trunk/specialpurpose/googlebase/build.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/build.xml?rev=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/build.xml (original) +++ ofbiz/trunk/specialpurpose/googlebase/build.xml Sun Oct 28 22:51:01 2007 @@ -1,21 +1,21 @@ <?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. +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="."> Modified: ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties?rev=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties (original) +++ ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels.properties Sun Oct 28 22:51:01 2007 @@ -18,11 +18,13 @@ ##################################################################### GoogleBaseApplication=Google Base Integration GoogleBaseCompanyName=Ofbiz +GoogleBaseExportToGoogle=Export To Google Base 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 +GoogleBaseViewPermissionError=You do not have permission to view this page. ("GOOGLEBASE_VIEW" needed) FormFieldTitle_webSiteUrl=Web Site Url FormFieldTitle_trackingCodeId=Tracking Code Id @@ -41,3 +43,7 @@ productsExportToGoogle.missingParameterProductCategoryId=Missing parameter productCategoryId productsExportToGoogle.noProductsAvailableInProductCategory=No products available in the selected productCategoryId productsExportToGoogle.productItemsSentCorrecltyToGoogle=Product items sent correclty to Google Base + +googlebasesearchevents.no_results_found_probably_error_constraints=No results found, probably because there was an error or were no constraints. +googlebasesearchevents.exceptionCallingExportToGoogle=Exception during exporting product to Google Base. +googlebasesearchevents.error_getting_search_results=Error getting search results: ${errSearchResult}. Modified: ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties?rev=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties (original) +++ ofbiz/trunk/specialpurpose/googlebase/config/GoogleBaseUiLabels_it.properties Sun Oct 28 22:51:01 2007 @@ -18,11 +18,13 @@ ##################################################################### GoogleBaseApplication=Applicazione Per Esportare i Prodotti Su Google Base GoogleBaseCompanyName=Ofbiz +GoogleBaseExportToGoogle=Esporta Su Google Base 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 +GoogleBaseViewPermissionError=Tu non sei autorizzato per vedere questa pagina. (necessario permesso "GOOGLEBASE_VIEW") FormFieldTitle_webSiteUrl=Url Sito Web FormFieldTitle_trackingCodeId=Codice Tracciatura @@ -40,4 +42,8 @@ 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 +productsExportToGoogle.productItemsSentCorrecltyToGoogle=Prodotti inviati correttamente su Google Base + +googlebasesearchevents.no_results_found_probably_error_constraints=No results found, probably because there was an error or were no constraints. +googlebasesearchevents.exceptionCallingExportToGoogle=Exception during exporting product to Google Base. +googlebasesearchevents.error_getting_search_results=Error getting search results: ${errSearchResult}. Added: ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseSecurityData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseSecurityData.xml?rev=589499&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseSecurityData.xml (added) +++ ofbiz/trunk/specialpurpose/googlebase/data/GoogleBaseSecurityData.xml Sun Oct 28 22:51:01 2007 @@ -0,0 +1,30 @@ +<?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> + <!-- Google Base component security --> + <SecurityPermission description="View operations in the Google Base application." permissionId="GOOGLEBASE_VIEW"/> + + <SecurityGroupPermission groupId="FLEXADMIN" permissionId="GOOGLEBASE_VIEW"/> + <SecurityGroupPermission groupId="FULLADMIN" permissionId="GOOGLEBASE_VIEW"/> + <SecurityGroupPermission groupId="VIEWADMIN" permissionId="GOOGLEBASE_VIEW"/> + <SecurityGroupPermission groupId="BIZADMIN" permissionId="GOOGLEBASE_VIEW"/> + +</entity-engine-xml> Modified: ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml?rev=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml (original) +++ ofbiz/trunk/specialpurpose/googlebase/ofbiz-component.xml Sun Oct 28 22:51:01 2007 @@ -1,21 +1,21 @@ <?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. +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" @@ -26,6 +26,7 @@ <classpath type="jar" location="build/lib/*"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/GoogleBaseTypeData.xml"/> + <entity-resource type="data" reader-name="seed" loader="main" location="data/GoogleBaseSecurityData.xml"/> <service-resource type="model" loader="main" location="servicedef/services.xml"/> @@ -33,7 +34,7 @@ title="Google Base" server="default-server" location="webapp/googlebase" - base-permission="OFBTOOLS" + base-permission="OFBTOOLS,GOOGLEBASE" mount-point="/googlebase" app-bar-display="true"/> </ofbiz-component> Added: ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/GoogleBaseSearchEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/GoogleBaseSearchEvents.java?rev=589499&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/GoogleBaseSearchEvents.java (added) +++ ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/GoogleBaseSearchEvents.java Sun Oct 28 22:51:01 2007 @@ -0,0 +1,143 @@ +/******************************************************************************* + * 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.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.StringUtil; +import org.ofbiz.base.util.UtilHttp; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.base.util.UtilValidate; +import org.ofbiz.entity.GenericEntityException; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.transaction.GenericTransactionException; +import org.ofbiz.entity.transaction.TransactionUtil; +import org.ofbiz.entity.util.EntityListIterator; +import org.ofbiz.product.product.ProductSearchEvents; +import org.ofbiz.service.GenericServiceException; +import org.ofbiz.service.LocalDispatcher; +import org.ofbiz.service.ModelService; +import org.ofbiz.service.ServiceUtil; + +public class GoogleBaseSearchEvents { + + public static final String module = GoogleBaseSearchEvents.class.getName(); + public static final String resource = "GoogleBaseUiLabels"; + public static final int DEFAULT_TX_TIMEOUT = 600; + + public static String searchExportProductListToGoogle(HttpServletRequest request, HttpServletResponse response) { + LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); + Locale locale = UtilHttp.getLocale(request); + GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); + String selectResult = (String) request.getParameter("selectResult"); + List productExportList = new ArrayList(); + String errMsg = null; + + try { + boolean beganTransaction = TransactionUtil.begin(DEFAULT_TX_TIMEOUT); + try { + if (UtilValidate.isEmpty(selectResult)) { + // If the passed list of product ids is empty, get the list from the search parameters in the request + EntityListIterator eli = ProductSearchEvents.getProductSearchResults(request); + if (eli == null) { + errMsg = UtilProperties.getMessage(resource,"googlebasesearchevents.no_results_found_probably_error_constraints", UtilHttp.getLocale(request)); + Debug.logError(errMsg, module); + request.setAttribute("_ERROR_MESSAGE_", errMsg); + return "error"; + } + + GenericValue searchResultView = null; + while ((searchResultView = (GenericValue) eli.next()) != null) { + productExportList.add(searchResultView.getString("mainProductId")); + } + eli.close(); + } else { + if (selectResult.startsWith("[")) { + productExportList = StringUtil.toList(selectResult); + } else { + productExportList.add(selectResult); + } + } + String webSiteUrl = (String) request.getParameter("webSiteUrl"); + String imageUrl = (String) request.getParameter("imageUrl"); + String actionType = (String) request.getParameter("actionType"); + String statusId = (String) request.getParameter("statusId"); + String testMode = (String) request.getParameter("testMode"); + String trackingCodeId = (String) request.getParameter("trackingCodeId"); + + // Export all or selected products to Google Base + try { + Map inMap = UtilMisc.toMap("selectResult", productExportList, + "webSiteUrl", webSiteUrl, + "imageUrl", imageUrl, + "actionType", actionType, + "statusId", statusId, + "testMode", testMode); + inMap.put("trackingCodeId", trackingCodeId); + inMap.put("userLogin", userLogin); + Map exportResult = dispatcher.runSync("exportToGoogle", inMap); + if (ServiceUtil.isError(exportResult)) { + List errorMessages = (List)exportResult.get(ModelService.ERROR_MESSAGE_LIST); + if (UtilValidate.isNotEmpty(errorMessages)) { + request.setAttribute("_ERROR_MESSAGE_LIST_", errorMessages); + } else { + request.setAttribute("_ERROR_MESSAGE_", ServiceUtil.getErrorMessage(exportResult)); + } + return "error"; + } else if (ServiceUtil.isFailure(exportResult)) { + List eventMessages = (List)exportResult.get(ModelService.ERROR_MESSAGE_LIST); + if (UtilValidate.isNotEmpty(eventMessages)) { + request.setAttribute("_EVENT_MESSAGE_LIST_", eventMessages); + } else { + request.setAttribute("_EVENT_MESSAGE_", ServiceUtil.getErrorMessage(exportResult)); + } + } else { + request.setAttribute("_EVENT_MESSAGE_", exportResult.get("successMessage")); + } + } catch (GenericServiceException e) { + errMsg = UtilProperties.getMessage(resource, "googlebasesearchevents.exceptionCallingExportToGoogle", locale); + Debug.logError(e, errMsg, module); + request.setAttribute("_ERROR_MESSAGE_", errMsg); + return "error"; + } + } catch (GenericEntityException e) { + errMsg = UtilProperties.getMessage(resource, "googlebasesearchevents.error_getting_search_results", locale); + Debug.logError(e, errMsg, module); + request.setAttribute("_ERROR_MESSAGE_", errMsg); + return "error"; + } finally { + TransactionUtil.commit(beganTransaction); + } + } catch (GenericTransactionException e) { + errMsg = UtilProperties.getMessage(resource, "googlebasesearchevents.error_getting_search_results", locale); + Debug.logError(e, errMsg, module); + request.setAttribute("_ERROR_MESSAGE_", errMsg); + return "error"; + } + return "success"; + } +} Modified: 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=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml (original) +++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/controller.xml Sun Oct 28 22:51:01 2007 @@ -1,21 +1,21 @@ <?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. +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" @@ -43,7 +43,7 @@ <request-map uri="searchExportProductListToGoogle"> <security https="true" auth="true"/> - <event type="java" path="org.ofbiz.product.product.ProductSearchEvents" invoke="searchExportProductListToGoogle"/> + <event type="java" path="org.ofbiz.googlebase.GoogleBaseSearchEvents" invoke="searchExportProductListToGoogle"/> <response name="success" type="view" value="ProductsExportToGoogle"/> <response name="error" type="view" value="ProductsExportToGoogle"/> </request-map> Modified: 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=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/web.xml (original) +++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/WEB-INF/web.xml Sun Oct 28 22:51:01 2007 @@ -1,22 +1,22 @@ <?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. +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> Modified: ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/googleExportLink.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/googleExportLink.ftl?rev=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/googleExportLink.ftl (original) +++ ofbiz/trunk/specialpurpose/googlebase/webapp/googlebase/find/googleExportLink.ftl Sun Oct 28 22:51:01 2007 @@ -25,5 +25,5 @@ </script> <#if productIds?has_content> - <a href="javascript:exportToGoogle();" class="buttontext">${uiLabelMap.ProductExportToGoogle}</a> + <a href="javascript:exportToGoogle();" class="buttontext">${uiLabelMap.GoogleBaseExportToGoogle}</a> </#if> Modified: ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseForms.xml?rev=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseForms.xml (original) +++ ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseForms.xml Sun Oct 28 22:51:01 2007 @@ -1,21 +1,21 @@ <?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. +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. --> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -53,6 +53,6 @@ </entity-options> </drop-down> </field> - <field name="submitButton" title="${uiLabelMap.ProductExportToGoogle}"><submit button-type="button"/></field> + <field name="submitButton" title="${uiLabelMap.GoogleBaseExportToGoogle}"><submit button-type="button"/></field> </form> </forms> Modified: ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseMenus.xml?rev=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseMenus.xml (original) +++ ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseMenus.xml Sun Oct 28 22:51:01 2007 @@ -20,7 +20,7 @@ <menus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-menu.xsd"> <menu name="GoogleBaseAppBar" default-menu-item-name="main" id="app-navigation" type="simple" title="${uiLabelMap.GoogleBaseApplication}" default-selected-style="selected" selected-menuitem-context-field-name="headerItem"> - <menu-item name="googlebase" title="${uiLabelMap.ProductExportToGoogle}"><link target="advancedsearch"/></menu-item> + <menu-item name="googlebase" title="${uiLabelMap.GoogleBaseExportToGoogle}"><link target="advancedsearch"/></menu-item> <menu-item name="Logout" title="Logout" align-style="col-right" selected-style="selected"> <condition><not><if-empty field-name="userLogin"/></not></condition> Modified: ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseScreens.xml?rev=589499&r1=589498&r2=589499&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseScreens.xml (original) +++ ofbiz/trunk/specialpurpose/googlebase/widget/GoogleBaseScreens.xml Sun Oct 28 22:51:01 2007 @@ -1,21 +1,21 @@ <?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. +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. --> <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -58,15 +58,14 @@ <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> <section> - <!-- do check for CATALOG, _VIEW permission --> <condition> - <if-has-permission permission="CATALOG" action="_VIEW"/> + <if-has-permission permission="GOOGLEBASE" action="_VIEW"/> </condition> <widgets> <decorator-section-include name="body"/> </widgets> <fail-widgets> - <label style="head3">${uiLabelMap.ProductCatalogViewPermissionError}</label> + <label style="head3">${uiLabelMap.GoogleBaseViewPermissionError}</label> </fail-widgets> </section> </decorator-section> |
Free forum by Nabble | Edit this page |