Modified: ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java Tue Apr 26 09:39:01 2011 @@ -329,13 +329,13 @@ public class HtmlFormRenderer extends Ht * @see org.ofbiz.widget.form.FormStringRenderer#renderHyperlinkField(java.io.Writer, java.util.Map, org.ofbiz.widget.form.ModelFormField.HyperlinkField) */ public void renderHyperlinkField(Appendable writer, Map<String, Object> context, HyperlinkField hyperlinkField) throws IOException { - this.request.setAttribute("image", hyperlinkField.getImage()); + this.request.setAttribute("image", hyperlinkField.getImageLocation(context)); ModelFormField modelFormField = hyperlinkField.getModelFormField(); String description = encode(hyperlinkField.getDescription(context), modelFormField, context); String confirmation = encode(hyperlinkField.getConfirmation(context), modelFormField, context); WidgetWorker.makeHyperlinkByType(writer, hyperlinkField.getLinkType(), modelFormField.getWidgetStyle(), hyperlinkField.getTargetType(), hyperlinkField.getTarget(context), hyperlinkField.getParameterMap(context), description, hyperlinkField.getTargetWindow(context), confirmation, modelFormField, - this.request, this.response, context); + this.request, this.response, context); this.appendTooltip(writer, context, modelFormField); //appendWhitespace(writer); } @@ -343,13 +343,13 @@ public class HtmlFormRenderer extends Ht public void makeHyperlinkString(Appendable writer, ModelFormField.SubHyperlink subHyperlink, Map<String, Object> context) throws IOException { if (subHyperlink == null) { return; - } + } if (subHyperlink.shouldUse(context)) { writer.append(' '); String description = encode(subHyperlink.getDescription(context), subHyperlink.getModelFormField(), context); WidgetWorker.makeHyperlinkByType(writer, subHyperlink.getLinkType(), subHyperlink.getLinkStyle(), subHyperlink.getTargetType(), subHyperlink.getTarget(context), subHyperlink.getParameterMap(context), description, subHyperlink.getTargetWindow(context), subHyperlink.getConfirmation(context), subHyperlink.getModelFormField(), - this.request, this.response, context); + this.request, this.response, context); } } @@ -525,9 +525,9 @@ public class HtmlFormRenderer extends Ht ModelFormField modelFormField = dateTimeField.getModelFormField(); String paramName = modelFormField.getParameterName(context); String defaultDateTimeString = dateTimeField.getDefaultDateTimeString(context); - + String event = modelFormField.getEvent(); - String action = modelFormField.getAction(context); + String action = modelFormField.getAction(context); Map<String, String> uiLabelMap = UtilGenerics.checkMap(context.get("uiLabelMap")); if (uiLabelMap == null) { @@ -597,14 +597,14 @@ public class HtmlFormRenderer extends Ht writer.append(idName); writer.append('"'); } - + if (UtilValidate.isNotEmpty(event) && UtilValidate.isNotEmpty(action)) { writer.append(" "); writer.append(event); writer.append("=\""); writer.append(action); writer.append('"'); - } + } writer.append("/>"); @@ -1087,7 +1087,7 @@ public class HtmlFormRenderer extends Ht writer.append(confirmation); writer.append("'); \" "); } - + writer.append(" href=\"javascript:document."); writer.append(modelForm.getCurrentFormName(context)); writer.append(".submit()\">"); @@ -1112,7 +1112,7 @@ public class HtmlFormRenderer extends Ht } writer.append(" src=\""); - this.appendContentUrl(writer, submitField.getImageLocation()); + this.appendContentUrl(writer, submitField.getImageLocation(context)); writer.append('"'); event = modelFormField.getEvent(); @@ -1124,7 +1124,7 @@ public class HtmlFormRenderer extends Ht writer.append(action); writer.append('"'); } - + if (UtilValidate.isNotEmpty(confirmation)) { writer.append("onclick=\" return confirm('"); writer.append(confirmation); @@ -2921,7 +2921,7 @@ public class HtmlFormRenderer extends Ht writer.append(titleText); } } - + public void renderContainerFindField(Appendable writer, Map<String, Object> context, ContainerField containerField) throws IOException { writer.append("<div "); String id = containerField.getModelFormField().getIdName(); Modified: ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java (original) +++ ofbiz/branches/jackrabbit20100709/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java Tue Apr 26 09:39:01 2011 @@ -493,10 +493,11 @@ public class HtmlMenuRenderer extends Ht // the text Image img = link.getImage(); - if (img == null) { - writer.append(link.getText(context)); - } else { + if (img != null) { renderImage(writer, context, img); + writer.append(" " + link.getText(context)); + } else { + writer.append(link.getText(context)); } if (UtilValidate.isNotEmpty(target)) { Modified: ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlFormMacroLibrary.ftl (original) +++ ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlFormMacroLibrary.ftl Tue Apr 26 09:39:01 2011 @@ -297,7 +297,7 @@ ${item.description}</span> <input type="hidden" name="_useRowSubmit" value="Y"/> </#if> </#macro> -<#macro renderFormClose focusFieldName formName> +<#macro renderFormClose focusFieldName formName containerId hasRequiredField> </form><#lt/> <#if focusFieldName?has_content> <script language="JavaScript" type="text/javascript"> @@ -310,6 +310,16 @@ ${item.description}</span> } </script><#lt/> </#if> + <#if containerId?has_content && hasRequiredField?has_content> + <script type="text/javascript"> + jQuery("#${containerId}").validate({ + submitHandler: + function(form) { + form.submit(); + } + }); + </script> + </#if> </#macro> <#macro renderMultiFormClose> </form><#lt/> Modified: ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlScreenMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlScreenMacroLibrary.ftl?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlScreenMacroLibrary.ftl (original) +++ ofbiz/branches/jackrabbit20100709/framework/widget/templates/htmlScreenMacroLibrary.ftl Tue Apr 26 09:39:01 2011 @@ -70,7 +70,7 @@ under the License. <#if id?has_content><#assign idText = " id=\"${id}\""/></#if> <#if style?has_content> <#if style=="h1"> - <h1${idText}>${text}</h1> + <h1${idText}>${text}</h1> <#elseif style=="h2"> <h2${idText}>${text}</h2> <#elseif style=="h3"> @@ -82,10 +82,10 @@ under the License. <#elseif style=="h6"> <h6${idText}>${text}</h6> <#else> - <span${idText} class="${style}">${text}</span> + <span${idText} class="${style}">${text}</span> </#if> <#else> - <span${idText}>${text}</span> + <span${idText}>${text}</span> </#if> </#if> </#macro> @@ -100,7 +100,7 @@ under the License. </form><#rt/> </#if> <a <#if id?has_content>id="${id}"</#if> <#if style?has_content>class="${style}"</#if> <#if name?has_content>name="${name}"</#if> <#if targetWindow?has_content>target="${targetWindow}"</#if> href="<#if "hidden-form"==linkType>javascript:document.${uniqueItemName}.submit()<#else>${linkUrl}</#if>"><#rt/> -<#if imgStr?has_content>${imgStr}<#else><#if text?has_content>${text}</#if></#if></a> +<#if imgStr?has_content>${imgStr}</#if><#if text?has_content>${text}</#if></a> <#else> <div id="${uniqueItemName}"></div> @@ -267,7 +267,7 @@ ${menuString} <input name="mode" value="DRAGDROPBOTTOM" type="hidden"/> </form> <a href="javascript:document.movePortletLeft_${portletKey}.submit()"> </a></li> - </#if> + </#if> <#if nextColumnSeqId?has_content> <li class="move-right"> <form method="post" action="updatePortletSeqDragDrop" name="movePortletRight_${portletKey}"> @@ -278,7 +278,7 @@ ${menuString} <input name="mode" value="DRAGDROPBOTTOM" type="hidden"/> </form> <a href="javascript:document.movePortletRight_${portletKey}.submit()"> </a></li> - </#if> + </#if> <#if prevPortletId?has_content> <li class="move-up"> <form method="post" action="updatePortletSeqDragDrop" name="movePortletUp_${portletKey}"> @@ -291,7 +291,7 @@ ${menuString} <input name="mode" value="DRAGDROPBEFORE" type="hidden"/> </form> <a href="javascript:document.movePortletUp_${portletKey}.submit()"> </a></li> - </#if> + </#if> <#if nextPortletId?has_content> <li class="move-down"> <form method="post" action="updatePortletSeqDragDrop" name="movePortletDown_${portletKey}"> @@ -304,7 +304,7 @@ ${menuString} <input name="mode" value="DRAGDROPAFTER" type="hidden"/> </form> <a href="javascript:document.movePortletDown_${portletKey}.submit()"> </a></li> - </#if> + </#if> </ul> <br class="clear"/> </div> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebay/config/EbayUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebay/config/EbayUiLabels.xml?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ebay/config/EbayUiLabels.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebay/config/EbayUiLabels.xml Tue Apr 26 09:39:01 2011 @@ -19,6 +19,9 @@ under the License. --> <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <property key="EbayAddCatalogToStore"> + <value xml:lang="en">Add Catalog To Store</value> + </property> <property key="EbayAddEbayConfiguration"> <value xml:lang="en">Add Ebay Configuration</value> <value xml:lang="it">Aggiungi configurazione eBay</value> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebay/widget/EbayForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebay/widget/EbayForms.xml?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ebay/widget/EbayForms.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebay/widget/EbayForms.xml Tue Apr 26 09:39:01 2011 @@ -177,10 +177,10 @@ under the License. <field name="xmlGatewayUri"><text size="40"/></field> <field name="apiServerUrl"><text size="40"/></field> <field name="customXml"><textarea cols="60" rows="5"/></field> - <field name="webSiteId" title="${uiLabelMap.ProductWebSite}"> - <drop-down> + <field name="websiteId" field-name="webSiteId" parameter-name="webSiteId" title="${uiLabelMap.ProductWebSite}"> + <drop-down no-current-selected-key="${ebayConfig.webSiteId}"> <option key="" description="- ${uiLabelMap.CommonSelectAny} -"/> - <entity-options description="${siteName}" entity-name="WebSite"> + <entity-options description="${siteName} [${webSiteId}]" entity-name="WebSite" key-field-name="webSiteId"> <entity-order-by field-name="siteName"/> </entity-options> </drop-down> @@ -259,10 +259,10 @@ under the License. </entity-options> </drop-down> </field> - <field name="webSiteId" title="${uiLabelMap.ProductWebSite}"> - <drop-down> + <field name="websiteId" field-name="webSiteId" parameter-name="webSiteId" title="${uiLabelMap.ProductWebSite}"> + <drop-down no-current-selected-key="${parameters.webSiteId}"> <option key="" description="- ${uiLabelMap.CommonSelectAny} -"/> - <entity-options entity-name="WebSite" description="${siteName} [${webSiteId}]"> + <entity-options entity-name="WebSite" description="${siteName} [${webSiteId}]" key-field-name="webSiteId"> <entity-order-by field-name="siteName"/> </entity-options> </drop-down> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/data/DemoEbayStoreData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/data/DemoEbayStoreData.xml?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/data/DemoEbayStoreData.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/data/DemoEbayStoreData.xml Tue Apr 26 09:39:01 2011 @@ -123,7 +123,7 @@ <ProductStoreCatalog productStoreId="90102" prodCatalogId="eBayCatalog" fromDate="2010-01-01 16:19:47.058"/> <ProductStoreFacility productStoreId="90102" facilityId="WebStoreWarehouse" fromDate="2010-01-01 16:19:47.058"/> - <WebSite webSiteId="EBAY_STORE2" siteName="eBay Store1" standardContentPrefix="http://demo.ofbiz.org" productStoreId="90102"/> + <WebSite webSiteId="EBAY_STORE2" siteName="eBay Store2" standardContentPrefix="http://demo.ofbiz.org" productStoreId="90102"/> <EbayConfig productStoreId="90102" devId="63655096-de90-4e82-bae4-67566f15bf53" appId="Company0-9f43-4ad4-96f7-19753fbc4e8d" certId="57a28c38-d491-4236-b702-a87e1d10e9a2" compatibilityLevel="643" siteId="0" xmlGatewayUri="https://api.sandbox.ebay.com/ws/api.dll" apiServerUrl="https://api.sandbox.ebay.com/wsapi" webSiteId="EBAY_STORE2"> <token><![CDATA[AgAAAA**AQAAAA**aAAAAA**xaa5Sw**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wFk4CoAJGCqA6dj6x9nY+seQ**QkwBAA**AAMAAA**Gw+sbEXV/KlY0mtzVtkoyvyI/cqJTPLFljiknR9nqxJIB+lxOif0atqUMsOFqTz8Kvqc7F3Ri7JK5jPOaNyxW0+MKeKMoOcWTUTav4kmvTdeqdVLUi6kAtttD6uK/kRN1CyBqe3e9xd7GLLPedOyrtoB0j7mS1sMyu2uPCyeY/QROIxR8ljRSjmcGUco1STOmZ0bqlEudZ+FBKjLxigbnY15I2m09lEOMfmCIIs02im2wp+EPcin72wMMo+RP++Dfl/pL1tYntCEimHJilAtJsAarSUTyXbOwEqG47/jX2u+XXXjF3xlcAwP/i/P4G+qf4NbWOlZY2BrNuOZJw4PRYPMuBgfcAUnHnS7aw/eXlJ0FCCJVgSIwJdTXbQCI5SjluFWGHvC7zsCgqV0AzT6VozlY//2wJTX4RL/b5+O04DkVUtce0/bhkzXPssEOUaVKka97+89zhwuGPjTqBO8+HnAxHVMrKZPcxn2brU4zIi4K7D94zPTfOQfYfRuPmvpsTojmBgLqYABXAOStKKGzT+4EJ0m6qPVV7/frzwTmNj28+SfJOy1LgnvRKMu6+tv6ZBxGbK4aAjot/MV+8arhYEuq0U2x/laCJhfuYAKGW+AZHCDVEhEMGN6VOgHe6X0qymiQKwZaWM3VztThnczYp9GFmiEwlJqtRJvHxVdyVrvWaUxgF4eIQzHAaVjLmXT/3szBapbuO52Q7z/wdjez1rLraqqKDXJsJxuwLIUNuXGkLOgkIYUNTFGcix0u0yJ]]></token> <customXml><![CDATA[<custom-xml><Currency>USD</Currency><UseTaxTable>false</UseTaxTable><DispatchTimeMax>3</DispatchTimeMax><ReturnPolicy><ReturnsAcceptedOption>ReturnsNotAccepted</ReturnsAcceptedOption></ReturnPolicy><ShippingDetails><ShippingType>Flat</ShippingType><ShippingServiceOptions><ShippingService>UPS2ndDay</ShippingService><ShippingServicePriority>1</ShippingServicePriority><ShippingServiceCost>5</ShippingServiceCost><ShippingServiceAdditionalCost>2</ShippingServiceAdditionalCost><ShippingSurcharge>1</ShippingSurcharge></ShippingServiceOptions></ShippingDetails></custom-xml>]]></customXml> Propchange: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/lib/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Apr 26 09:39:01 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/specialpurpose/ebaystore/lib:951708-952957 /ofbiz/branches/jquery/specialpurpose/ebaystore/lib:952958-1044489 /ofbiz/branches/multitenant20100310/specialpurpose/ebaystore/lib:921280-927264 -/ofbiz/trunk/specialpurpose/ebaystore/lib:962442-1094239 +/ofbiz/trunk/specialpurpose/ebaystore/lib:962442-1096699 Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayEvents.java Tue Apr 26 09:39:01 2011 @@ -427,6 +427,7 @@ public class EbayEvents { public static List<StoreCustomCategoryType> getStoreChildCategories(HttpServletRequest request) throws ApiException, SdkException, Exception { List<StoreCustomCategoryType> categories = FastList.newInstance(); + List<StoreCustomCategoryType> csCateList = FastList.newInstance(); EbayStoreSiteFacade sf = null; String categoryId = null; @@ -445,22 +446,21 @@ public class EbayEvents { sf = getSiteFacade(apiContext,request); if (UtilValidate.isNotEmpty(sf)) { Map<SiteCodeType, List<StoreCustomCategoryType>> csCateMaps = sf.getSiteStoreCategoriesMap(); - List<StoreCustomCategoryType> csCateList = csCateMaps.get(apiContext.getSite()); + csCateList = csCateMaps.get(apiContext.getSite()); if (UtilValidate.isNotEmpty(csCateList)) { - for (StoreCustomCategoryType csCate : csCateList) { - StoreCustomCategoryType[] categoryChildCategories = csCate.getChildCategory(); - if (categoryChildCategories.length > 0) { - for (StoreCustomCategoryType childCategory : categoryChildCategories) { - StoreCustomCategoryType[] categoryChild2 = childCategory.getChildCategory(); - if (categoryChild2.length > 0) { - for (StoreCustomCategoryType categoryChild3 : categoryChild2) { - categories.add(categoryChild3); - } - } else { - categories.add(childCategory); + if (UtilValidate.isNotEmpty(categoryId)) { + // find child of selected ebay categories + for (StoreCustomCategoryType csCate : csCateList) { + if (categoryId.equals(String.valueOf(csCate.getCategoryID()))) { + StoreCustomCategoryType [] childCategories = csCate.getChildCategory(); + for (StoreCustomCategoryType childCategoryId : childCategories) { + categories.add(childCategoryId); } } - } else { + } + } else { + // find first level of ebay categories + for (StoreCustomCategoryType csCate : csCateList) { categories.add(csCate); } } @@ -832,12 +832,27 @@ public class EbayEvents { } StorefrontType storeFront = new StorefrontType(); if (UtilValidate.isNotEmpty(requestParams.get("ebayStore1Category"))) { - storeFront.setStoreCategoryID(new Long(requestParams.get("ebayStore1Category").toString())); - attributeMapList.put("StoreCategoryID", requestParams.get("ebayStore1Category").toString()); + String ebayStore1Category = (String)requestParams.get("ebayStore1Category"); + if (ebayStore1Category.contains("false")) { + request.setAttribute("_ERROR_MESSAGE_","Please select ebay store category with low level of categories."); + return "error"; + } else { + if (ebayStore1Category.contains("true")) ebayStore1Category = ebayStore1Category.substring(0,ebayStore1Category.indexOf(":")); + } + storeFront.setStoreCategoryID(new Long(ebayStore1Category)); + attributeMapList.put("StoreCategoryID", ebayStore1Category); + } if (UtilValidate.isNotEmpty(requestParams.get("ebayStore2Category"))) { - storeFront.setStoreCategory2ID(new Long(requestParams.get("ebayStore2Category").toString())); - attributeMapList.put("StoreCategory2ID", requestParams.get("ebayStore2Category").toString()); + String ebayStore2Category = (String)requestParams.get("ebayStore2Category"); + if (ebayStore2Category.contains("false")) { + request.setAttribute("_ERROR_MESSAGE_","Please select ebay store category with low level of categories."); + return "error"; + } else { + if (ebayStore2Category.contains("true")) ebayStore2Category = ebayStore2Category.substring(0,ebayStore2Category.indexOf(":")); + } + storeFront.setStoreCategory2ID(new Long(ebayStore2Category)); + attributeMapList.put("StoreCategory2ID", ebayStore2Category); } if (UtilValidate.isNotEmpty(requestParams.get("ebayStore1Category")) || UtilValidate.isNotEmpty(requestParams.get("ebayStore2Category"))) { item.setStorefront(storeFront); Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java Tue Apr 26 09:39:01 2011 @@ -56,6 +56,7 @@ import com.ebay.soap.eBLBaseComponents.S import com.ebay.soap.eBLBaseComponents.StoreFontType; import com.ebay.soap.eBLBaseComponents.StoreThemeArrayType; import com.ebay.soap.eBLBaseComponents.StoreThemeType; +import com.ebay.soap.eBLBaseComponents.StoreCustomCategoryType; public class EbayStoreOptions { @@ -276,4 +277,64 @@ public class EbayStoreOptions { } } } + + public static String retrieveEbayStoreCategoryByParent(HttpServletRequest request, HttpServletResponse response) { + List<StoreCustomCategoryType> results = FastList.newInstance(); + try { + Map paramMap = UtilHttp.getCombinedMap(request); + if (paramMap.get("productStoreId") != null) { + String ebayStoreCategory = (String)paramMap.get("ebayCategoryId"); + // when change category should be remove old category from session + if (ebayStoreCategory.indexOf("CH_") != -1) { + ebayStoreCategory = ebayStoreCategory.replace("CH_", ""); + if (UtilValidate.isNotEmpty(ebayStoreCategory)) { + ApiContext apiContext = EbayEvents.getApiContext(request); + Map<String,Object> addItemObject = EbayEvents.getAddItemListingObject(request, apiContext); + String refName = "itemCateFacade_".concat(ebayStoreCategory); + if (UtilValidate.isNotEmpty(addItemObject.get(refName))) { + addItemObject.remove(refName); + } + } + ebayStoreCategory = ""; + } + request.setAttribute("productStoreId", paramMap.get("productStoreId")); + request.setAttribute("categoryId", ebayStoreCategory); + ApiContext apiContext = EbayEvents.getApiContext(request); + EbayStoreSiteFacade sf = EbayEvents.getSiteFacade(apiContext,request); + results = EbayEvents.getStoreChildCategories(request); + if (UtilValidate.isNotEmpty(results)) { + List<Map<String,Object>> categories = FastList.newInstance(); + for (StoreCustomCategoryType category : results) { + Map<String,Object> context = FastMap.newInstance(); + context.put("CategoryCode", category.getCategoryID()); + context.put("CategoryName", category.getName()); + String isLeaf = "false"; + if (category.getChildCategory().length == 0) { + isLeaf = "true"; + } else { + isLeaf = "false"; + } + //String isLeaf = String.valueOf(category.getChildCategory().!= null ? "true" : "false"); + context.put("IsLeafCategory", isLeaf); + categories.add(context); + } + if (categories.size() > 0) { + toJsonObjectList(categories,response); + } + } + } + } catch (GenericServiceException e) { + Debug.logError(e.getMessage(), module); + } catch (EventHandlerException e) { + Debug.logError(e.getMessage(), module); + } catch (ApiException e) { + Debug.logError(e.getMessage(), module); + } catch (SdkException e) { + Debug.logError(e.getMessage(), module); + } catch (Exception e) { + Debug.logError(e.getMessage(), module); + } + return "success"; + } + } Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/PrepareProductListing.groovy Tue Apr 26 09:39:01 2011 @@ -81,7 +81,8 @@ request.setAttribute("productStoreId", productStoreId); categories = EbayEvents.getChildCategories(request); context.categories = categories; - + storeCategories = EbayEvents.getStoreChildCategories(request); + context.storeCategories = storeCategories; // point product tab id productId = null; Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml Tue Apr 26 09:39:01 2011 @@ -110,6 +110,23 @@ <response name="success" type="view" value="LeaveFeedback"/> <response name="error" type="view" value="LeaveFeedback"/> </request-map> + <!-- Associate catalog to Ebay Store --> + <request-map uri="AssociateCatalog"> + <security auth="true" https="true"/> + <response name="success" type="view" value="AssociateCatalog"/> + </request-map> + <request-map uri="associateCatalogToStore"> + <security auth="true" https="true"/> + <event type="service" invoke="createProductStoreCatalog"/> + <response name="success" type="view-last"/> + <response name="error" type="view-last"/> + </request-map> + <request-map uri="removeCatalogFromStore"> + <security auth="true" https="true"/> + <event type="service" invoke="deleteProductStoreCatalog"/> + <response name="success" type="view-last"/> + <response name="error" type="view-last"/> + </request-map> <!-- Automation Preferences --> <request-map uri="automationPreferences"> <security auth="true" https="true"/> @@ -277,7 +294,7 @@ <request-map uri="retrieveEbayStoreCategoryByParent"> <security https="true" auth="true"/> <event type="java" path="org.ofbiz.ebaystore.EbayStoreOptions" invoke="retrieveEbayStoreCategoryByParent"/> - <response name="success" type="view" value="main"/> + <response name="success" type="request" value="json"/> </request-map> <request-map uri="clearExpListing"> <security https="true" auth="true"/> @@ -552,6 +569,8 @@ <view-map name="FeedbackStore" type="screen" page="component://ebaystore/widget/EbayAccountScreens.xml#FeedbackStore"/> <view-map name="Feedback" type="screen" page="component://ebaystore/widget/EbayAccountScreens.xml#Feedback"/> <view-map name="LeaveFeedback" type="screen" page="component://ebaystore/widget/EbayAccountScreens.xml#LeaveFeedback"/> + <!-- Associate Catalog to Ebay Store--> + <view-map name="AssociateCatalog" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#AssociateCatalog"/> <!-- AutomationPreferences --> <view-map name="AutomationPreferences" type="screen" page="component://ebaystore/widget/EbaySellingManagerScreens.xml#EbayAutomationPreferences"/> <!-- Selling Manager --> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/store/productsearchExport.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/store/productsearchExport.ftl?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/store/productsearchExport.ftl (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/webapp/ebaystore/store/productsearchExport.ftl Tue Apr 26 09:39:01 2011 @@ -233,6 +233,7 @@ under the License. <#assign requireEbayInventory = addItemObj.requireEbayInventory?if_exists> <#assign item = addItem.getItem()?if_exists> <#assign primaryCate = item.getPrimaryCategory()?if_exists> + <#assign storeFront = item.getStorefront()?if_exists> <#if isProductId == item.getSKU()?if_exists> <input type="hidden" name="productId" value="${item.getSKU()?if_exists}"/> <#assign smallImageUrl = ""> @@ -320,24 +321,25 @@ under the License. <td> <div> <div id="loading"></div> - <select id="ebayStore1Category" name="ebayStore1Category"> + <select id="ebayStore1Category" name="ebayStore1Category" onchange="retrieveEbayCategoryByParent('<@ofbizUrl>retrieveEbayStoreCategoryByParent</@ofbizUrl>',this.value,'${productStoreId}','ebayStore1Category')"> <option value="">Please select</option> + <option value="">------</option> <#if storeCategories?exists> <#if storeFront?has_content> - <#if !storeFront.isLeafCategory()?has_content> + <#--if !storeFront.isLeafCategory()?has_content> <#assign leafCate = "false"> <#else> <#assign leafCate = "true"> - </#if> + </#if--> <#assign storeCate1Id = storeFront.getStoreCategoryID()?if_exists> <option selected="selected" value="${storeFront.getStoreCategoryID()?if_exists}" >${storeFront.getStoreCategoryID()?if_exists}</option> <#else> <#list storeCategories as csCate> - <#if !csCate.IsLeafCategory?has_content> + <#--if !csCate.IsLeafCategory?has_content> <#assign leafCate = "false"> <#else> CH_${storeFront.getStoreCategoryID()?if_exists}<#assign leafCate = "true"> - </#if> + </#if--> <#assign categoryId = csCate.getCategoryID()?if_exists> <option value="${csCate.getCategoryID()?if_exists}" >${csCate.getName()?if_exists}</option> </#list> @@ -353,24 +355,24 @@ under the License. <td> <div> <div id="loading"></div> - <select id="ebayStore2Category" name="ebayStore2Category"> + <select id="ebayStore2Category" name="ebayStore2Category" onchange="retrieveEbayCategoryByParent('<@ofbizUrl>retrieveEbayStoreCategoryByParent</@ofbizUrl>',this.value,'${productStoreId}','ebayStore2Category')"> <option value="">Please select</option> <#if storeCategories?exists> <#if storeFront?has_content> - <#if !storeFront.isLeafCategory()?has_content> + <#--if !storeFront.isLeafCategory()?has_content> <#assign leafCate = "false"> <#else> <#assign leafCate = "true"> - </#if> - <#assign storeCate1Id = storeFront.getStoreCategoryID()?if_exists> - <option selected="selected" value="${storeFront.getStoreCategoryID()?if_exists}" >${storeFront.getStoreCategoryID()?if_exists}</option> + </#if--> + <#assign storeCate2Id = storeFront.getStoreCategory2ID()?if_exists> + <option selected="selected" value="${storeFront.getStoreCategory2ID()?if_exists}" >${storeFront.getStoreCategory2ID()?if_exists}</option> <#else> <#list storeCategories as csCate> - <#if !csCate.IsLeafCategory?has_content> + <#--if !csCate.IsLeafCategory?has_content> <#assign leafCate = "false"> <#else> CH_${storeFront.getStoreCategoryID()?if_exists}<#assign leafCate = "true"> - </#if> + </#if--> <#assign categoryId = csCate.getCategoryID()?if_exists> <option value="${csCate.getCategoryID()?if_exists}" >${csCate.getName()?if_exists}</option> </#list> @@ -378,7 +380,7 @@ under the License. </#if> </select> </div> - <input type="hidden" name="storeCate2Id" value="${storeCate1Id?if_exists}"/> + <input type="hidden" name="storeCate2Id" value="${storeCate2Id?if_exists}"/> </td> </tr> <tr> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreForms.xml?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreForms.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreForms.xml Tue Apr 26 09:39:01 2011 @@ -120,6 +120,28 @@ value="${bsh:billingAccount != null ? or <field name="currentPasswordVerify"><password/></field> <field name="submitButton" title="${uiLabelMap.CommonCreate}"><submit button-type="button"/></field> </form> + <form name="AddCatalog" type="single" target="associateCatalogToStore"> + <field name="productStoreId"><hidden /></field> + <field name="catalogName" parameter-name="prodCatalogId"> + <drop-down> + <list-options list-name="prodCatalogList" key-name="prodCatalogId" description="${catalogName}"/> + </drop-down> + </field> + <field name="submit" title="${uiLabelMap.CommonAdd}"><submit/></field> + </form> + <form name="CatalogList" type="list" list-name="prodStoreCatalogList" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="productStoreId"><display/></field> + <field name="prodCatalogId"> + <display-entity entity-name="ProdCatalog" description="${catalogName}" key-field-name="prodCatalogId"/> + </field> + <field name="delete" widget-style="buttontext"> + <hyperlink target="removeCatalogFromStore" description="${uiLabelMap.CommonDelete}"> + <parameter param-name="productStoreId"/> + <parameter param-name="prodCatalogId"/> + <parameter param-name="fromDate"/> + </hyperlink> + </field> + </form> <form name="errorMessageList" type="list" target="" list-name="errorMsgList" view-size="30" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <field name="createDatetime"><display/></field> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreMenus.xml?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreMenus.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreMenus.xml Tue Apr 26 09:39:01 2011 @@ -38,6 +38,11 @@ <parameter param-name="productStoreId" value="${parameters.productStoreId}"/> </link> </menu-item> + <menu-item name="associateCatalogToStore" title="${uiLabelMap.EbayAddCatalogToStore}"> + <link target="AssociateCatalog"> + <parameter param-name="productStoreId" value="${parameters.productStoreId}"/> + </link> + </menu-item> <menu-item name="ebayExportAllCategoryToEbayStore" title="${uiLabelMap.EbayExportAllCategoryToEbayStore}"> <link target="exportCategoryEbayStore"> <parameter param-name="productStoreId" value="${parameters.productStoreId}"/> Modified: ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreScreens.xml?rev=1096705&r1=1096704&r2=1096705&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreScreens.xml (original) +++ ofbiz/branches/jackrabbit20100709/specialpurpose/ebaystore/widget/EbayStoreScreens.xml Tue Apr 26 09:39:01 2011 @@ -160,6 +160,42 @@ under the License. </widgets> </section> </screen> + <screen name="AssociateCatalog"> + <section> + <actions> + <set field="headerItem" value="ebayStore"/> + <set field="tabButtonItem" value="associateCatalogToStore"/> + <entity-and entity-name="ProductStoreCatalog" list="prodStoreCatalogList" filter-by-date="true"> + <field-map field-name="productStoreId" from-field="parameters.productStoreId"/> + </entity-and> + <set field="prodCatalogIds" value="${groovy:org.ofbiz.entity.util.EntityUtil.getFieldListFromEntityList(prodStoreCatalogList, 'prodCatalogId', true);}" type="List"/> + <entity-condition entity-name="ProdCatalog" list="prodCatalogList"> + <condition-expr field-name="prodCatalogId" operator="not-in" from-field="prodCatalogIds" ignore-if-empty="true"/> + </entity-condition> + </actions> + <widgets> + <decorator-screen name="permission-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <screenlet title="Add Catalog To Store"> + <include-form name="AddCatalog" location="component://ebaystore/widget/EbayStoreForms.xml"/> + </screenlet> + <section> + <condition> + <not> + <if-empty field="prodStoreCatalogList"/> + </not> + </condition> + <widgets> + <screenlet title="Associated Catalog List"> + <include-form name="CatalogList" location="component://ebaystore/widget/EbayStoreForms.xml"/> + </screenlet> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> <!-- Export product listing --> <screen name="exportProductListing"> <section> Propchange: ofbiz/branches/jackrabbit20100709/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Apr 26 09:39:01 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:951708-952957 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:952958-1044489 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:921280-927264 -/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:962442-1094239 +/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:962442-1096699 Propchange: ofbiz/branches/jackrabbit20100709/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Apr 26 09:39:01 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:951708-952957 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:952958-1044489 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:921280-927264 -/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:962442-1094239 +/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:962442-1096699 Propchange: ofbiz/branches/jackrabbit20100709/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Apr 26 09:39:01 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:951708-952957 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:952958-1044489 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:921280-927264 -/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:962442-1094239 +/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:962442-1096699 |
Free forum by Nabble | Edit this page |