After mounting ecommerce as root web app, I got ScreenRenderException, caused by StringIndexOutOfBoundsException: String index out of range: -1
at org.ofbiz.product.category.CatalogUrlServlet.makeCatalogUrl(CatalogUrlServlet.java:186)
Categories and products cannot be rendered.
jleroux: I added 2 other cases to Josip's patch.
Note: you could mount the ecommerce as root web app between R9.04 and R11.04 (included)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1631203 13f79535-47bb-0310-9956-ffa450edef68
I have noticed an undesired behavior when two products are associated by the "ALSO_BOUGHT" association type.
Specifically, when a product, e.g., Tiny Gizmo (productId = "GZ-1000"), is associated to another product, e.g., Micro Chrome Widget (productIdTo = "WG-1111"), by setting productAssocTypeId equal to "ALSO_BOUGHT" in ProductAssoc, the Tiny Gizmo web page in the ecommerce site correctly shows the Micro Chrome Widget as "Customers who bought this item also bought:". Accordingly with the current software behavior, even if Micro Chrome Widget (productId = "WG-1111") was not explicitly associated to Tiny Gizmo (productIdTo = "GZ-1000"), also the Micro Chrome Widget web page shows Tiny Gizmo as "Customers who bought this item also bought:", which may be useful in cases where the 'ALSO_BOUGHT' association is meant to be necessarily bidirectional, i.e., if prodA is associated to prodB, then prodB is associated to prodA and vice-versa. However, when the user wants to express the symmetric nature of the relationship by explicitly associating both Tiny Gizmo to Micro Chrome Widget and Micro Chrome Widget to Tiny Gizmo in ProductAssoc, the system erroneously shows the associated products twice, both in the Tiny Gizmo and Micro Chrome web pages.
The undesired behavior can be reproduced as follows:
# Run OFBiz with demo data
# import the following associations from the OFBiz XML Data Import form
{code}
<ProductAssoc productId="GZ-1000" productIdTo="WG-1111" productAssocTypeId="ALSO_BOUGHT" fromDate="2014-09-02 12:00:00.000"/>
<ProductAssoc productId="WG-1111" productIdTo="GZ-1000" productAssocTypeId="ALSO_BOUGHT" fromDate="2014-09-02 12:00:00.000"/>
{code}
# click on Tiny Gizmo or Micro Chrome Widget from the main page of the ecommerce site.
The attached patch modifies the above behavior as follows:
- if only "prodA" (productId = "prodA") is associated to "prodB" (productIdTo = "prodB") in ProductAssoc, and not vice-versa, only "prodA" web page shows "prodB" as "Customers who bought this item also bought:". This means that the 'ALSO_BOUGHT' association type becomes not necessarily bidirectional by default, which is in accordance with most common algorithms for the automatic generation of "WHO BOUGHT X ALSO BOUGHT Y" recommendations that may produce bidirectional associations for some couple of products and not for others, based on conditional probabilities and actual users behavior;
- in those specific cases in which the association is actually bidirectional for a certain couple of products (prodA, prodB), i.e., both 'prodA to prodB' and 'prodB to prodA' associations are present in ProductAssoc, associated products are shown only ones in prodA and prodB web pages.
The patch simply sets the value of the parameter "bidirectional" to its default value, i.e., "false", when alsoBoughtProducts are collected by calling getAssociatedProducts() from applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1628096 13f79535-47bb-0310-9956-ffa450edef68
Entry point is the static EntityQuery.use(Delegator) method which will then return an EntityQuery instance whose methods support method chaining to set query options.
The query can then be executed using the first(), list(), iterator() and one() methods which respectively return:
- The first result from a result set
- The full list of results from a result set
- An EntityListIterator to iterate over a result set
- The single record from a query that will return only one record (such as a lookup by primary key)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627940 13f79535-47bb-0310-9956-ffa450edef68
This fix should be the right way to go but please review this commit because the syntax of these custom ant tasks is rather cryptic to me.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627818 13f79535-47bb-0310-9956-ffa450edef68
<field-to-result field="value" result-name="${key}"/>
is no more supported: converted minilang code that was still using this syntax and was broken by the refactoring.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627763 13f79535-47bb-0310-9956-ffa450edef68
From Tomcat connector configurator documentation:
enableLookups
Set to true if you want calls to request.getRemoteHost() to perform DNS lookups in order to return the actual host name of the remote client. Set to false to skip the DNS lookup and return the IP address in String form instead (thereby improving performance). By default, DNS lookups are disabled.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627490 13f79535-47bb-0310-9956-ffa450edef68
This new implementation should be slightly more flexible but with default setup will end up with the same behavior as before 1627092.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627489 13f79535-47bb-0310-9956-ffa450edef68
In RFC2045 (Section 5.1) there is:
"Content-type: text/plain; charset=us-ascii (Plain text)
Content-type: text/plain; charset="us-ascii"
are completely equivalent".
In current revision, if the 'Content-Type' of http response includes the quotation mark around the charset name, HttpClient throws out unsupported encoding exception.
This patch removes quotation marks from charset name extracted from http response header.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1627230 13f79535-47bb-0310-9956-ffa450edef68