svn commit: r1655803 - in /ofbiz/trunk: ./ applications/product/ applications/product/config/ applications/product/dtd/ applications/product/src/org/ofbiz/product/category/ applications/product/src/org/ofbiz/product/category/ftl/ framework/webapp/confi...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1655803 - in /ofbiz/trunk: ./ applications/product/ applications/product/config/ applications/product/dtd/ applications/product/src/org/ofbiz/product/category/ applications/product/src/org/ofbiz/product/category/ftl/ framework/webapp/confi...

jleroux@apache.org
Author: jleroux
Date: Thu Jan 29 19:06:49 2015
New Revision: 1655803

URL: http://svn.apache.org/r1655803
Log:
This implements OFBIZ-5312 "Proposal: URL-Generation Changes (mostly for SEO reasons but not only)" by merging the "SEO branch" in trunk

After some efforts to take into consideration Anil's justified concerns (simply put: keep the current behaviour), the modifications are finally light, which is greater for reviews. Most important are:
* Product component
  ** I have moved the OfbizCatalogAltUrlTransform and OfbizCatalogUrlTransform classes to a ftl subdirectory with the new FTL macros implementation: CatalogAltUrlSeoTransform, CatalogUrlSeoFilter, CatalogAltUrlSeoTransform, CatalogUrlSeoTransform, SeoTransform, UrlRegexpTransform
  ** A bunch of new filters have been added CatalogUrlSeoFilter, controlServlet, SeoCatalogUrlServlet, SeoContentUrlFilter, SeoContextFilter, SeoControlServlet, UrlRegexpContextFilter
  ** 2 util classes: SeoConfigUtil, SeoUrlUtil
  ** By default ofbizCatalogAltUrl and ofbizCatalogUrl macros now use the new implementations by CatalogAltUrlSeoTransform and CatalogUrlSeoTransform. This can be changed back in freemarkerTransforms.properties
  ** A SeoConfig.xml file define some SEO parameters, the SeoConfig.xsd can be sued as documentation, globally please refer to OFBIZ-5312.
* Framework webapp component
  ** By default ofbizUrl macro now uses the new implementations by UrlRegexpTransform. This can be changed back in freemarkerTransforms.properties
* Ecommerce component
  ** A new ecomseo webapp clones the ecommerce webapp on the model of ecomclone. There is not much there: mostly a controller with a new JspViewHandler class (in ecommerce) and a web.xml file

With these changes we can have both worlds running side by side. So you can use eitherb http://localhost:8080/ecommerce/control/main as root or http://localhost:8080/ecomseo, but also if you want http://localhost:8080/ecommerce/. Then everything follows.

From my reviews and tests all is working as expected. I only found a trivial bug that I can also reproduce in current trunk see OFBIZ-5305 (sometimes not locally, weird).

Of course, all the tests passes.

Added:
    ofbiz/trunk/applications/product/config/SeoConfig.xml
      - copied, changed from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/config/SeoConfig.xml
    ofbiz/trunk/applications/product/dtd/
      - copied from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/dtd/
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlSeoFilter.java
      - copied unchanged from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/CatalogUrlSeoFilter.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/ControlServlet.java
      - copied unchanged from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/ControlServlet.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/SeoCatalogUrlServlet.java
      - copied unchanged from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/SeoCatalogUrlServlet.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/SeoConfigUtil.java
      - copied unchanged from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/SeoConfigUtil.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/SeoContentUrlFilter.java
      - copied, changed from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/SeoContentUrlFilter.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/SeoContextFilter.java
      - copied unchanged from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/SeoContextFilter.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/SeoControlServlet.java
      - copied unchanged from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/SeoControlServlet.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/SeoUrlUtil.java
      - copied unchanged from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/SeoUrlUtil.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/UrlRegexpContextFilter.java
      - copied unchanged from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/UrlRegexpContextFilter.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/ftl/
      - copied from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/ftl/
    ofbiz/trunk/specialpurpose/ecommerce/src/org/ofbiz/ecommerce/webapp/
      - copied from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/specialpurpose/ecommerce/src/org/ofbiz/ecommerce/webapp/
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/controller.xml   (with props)
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/web.xml   (with props)
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/error/
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/error/error.jsp   (with props)
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/index.jsp   (with props)
Removed:
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/OfbizCatalogAltUrlTransform.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/OfbizCatalogUrlTransform.java
Modified:
    ofbiz/trunk/   (props changed)
    ofbiz/trunk/applications/product/build.xml
    ofbiz/trunk/applications/product/config/freemarkerTransforms.properties
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/ftl/OfbizCatalogAltUrlTransform.java
    ofbiz/trunk/framework/webapp/config/freemarkerTransforms.properties
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/WebAppUtil.java
    ofbiz/trunk/specialpurpose/ecommerce/ofbiz-component.xml

Propchange: ofbiz/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 29 19:06:49 2015
@@ -1,4 +1,5 @@
 /ofbiz/branches/2013_RemoveJavolution:1462755
+/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23:1535171-1654698
 /ofbiz/branches/addbirt:831210-885099,885686-886087
 /ofbiz/branches/boostrap_theme:1635411,1635465
 /ofbiz/branches/dojo1.4:951708-952957

Modified: ofbiz/trunk/applications/product/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/build.xml?rev=1655803&r1=1655802&r2=1655803&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/build.xml (original)
+++ ofbiz/trunk/applications/product/build.xml Thu Jan 29 19:06:49 2015
@@ -34,7 +34,9 @@ under the License.
         <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/lib/scripting" includes="*.jar"/>
         <fileset dir="../../framework/base/build/lib" includes="*.jar"/>
+        <fileset dir="../../framework/catalina/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"/>

Copied: ofbiz/trunk/applications/product/config/SeoConfig.xml (from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/config/SeoConfig.xml)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/SeoConfig.xml?p2=ofbiz/trunk/applications/product/config/SeoConfig.xml&p1=ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/config/SeoConfig.xml&r1=1654698&r2=1655803&rev=1655803&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/config/SeoConfig.xml (original)
+++ ofbiz/trunk/applications/product/config/SeoConfig.xml Thu Jan 29 19:06:49 2015
@@ -7,7 +7,7 @@
         <!-- enable/disable
           1. if enable, the product seo url will be /product-name-product-id.html or /category-name-product-name-product-id.html
           2. if disable, the CatalogUrlServlet.makeCatalogUrl will be used -->
-        <allowed-context-paths>/:/ecommerce</allowed-context-paths>
+        <allowed-context-paths>/:/ecomseo</allowed-context-paths>
         <!-- if category-url is enabled, only context paths listed here will be allowed to use the new seo transformers -->
         <category-name>disable</category-name>
         <!-- enable/disable
@@ -50,13 +50,13 @@
         </url-config>
 
         <url-config>
-            <description>sample: remove /ecommerce/main</description>
-            <url-pattern>^/ecommerce/main$</url-pattern>
+            <description>sample: remove /ecomseo/main</description>
+            <url-pattern>^/ecomseo/main$</url-pattern>
             <seo>
-                <replacement>/ecommerce/</replacement>
+                <replacement>/ecomseo/</replacement>
             </seo>
             <forward>
-                <replacement>/ecommerce/</replacement>
+                <replacement>/ecomseo/</replacement>
                 <responsecode>301</responsecode>
             </forward>
         </url-config>

Modified: ofbiz/trunk/applications/product/config/freemarkerTransforms.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/freemarkerTransforms.properties?rev=1655803&r1=1655802&r2=1655803&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/freemarkerTransforms.properties (original)
+++ ofbiz/trunk/applications/product/config/freemarkerTransforms.properties Thu Jan 29 19:06:49 2015
@@ -21,6 +21,8 @@
 
 # entries are in the form: key=transform name, property=transform class name
 
-ofbizCatalogAltUrl=org.ofbiz.product.category.OfbizCatalogAltUrlTransform
-ofbizCatalogUrl=org.ofbiz.product.category.CatalogUrlDirective
+#ofbizCatalogAltUrl=org.ofbiz.product.category.ftl.OfbizCatalogAltUrlTransform
+#ofbizCatalogUrl=org.ofbiz.product.category.ftl.CatalogUrlDirective
+ofbizCatalogAltUrl=org.ofbiz.product.category.ftl.CatalogAltUrlSeoTransform
+ofbizCatalogUrl=org.ofbiz.product.category.ftl.CatalogUrlSeoTransform
 

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java?rev=1655803&r1=1655802&r2=1655803&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java Thu Jan 29 19:06:49 2015
@@ -524,7 +524,7 @@ public class CategoryServices {
                 }
             }
         } catch (GenericEntityException e) {
-            e.printStackTrace();
+            Debug.logWarning(e, module);
             return "error";
         }
         return "success";

Copied: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/SeoContentUrlFilter.java (from r1654698, ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/SeoContentUrlFilter.java)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/SeoContentUrlFilter.java?p2=ofbiz/trunk/applications/product/src/org/ofbiz/product/category/SeoContentUrlFilter.java&p1=ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/SeoContentUrlFilter.java&r1=1654698&r2=1655803&rev=1655803&view=diff
==============================================================================
--- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/src/org/ofbiz/product/category/SeoContentUrlFilter.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/SeoContentUrlFilter.java Thu Jan 29 19:06:49 2015
@@ -35,7 +35,7 @@ import javax.servlet.http.HttpServletRes
 import javolution.util.FastList;
 
 import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.StringUtil;
+import org.ofbiz.base.util.UtilCodec;
 import org.ofbiz.base.util.UtilHttp;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilValidate;
@@ -46,7 +46,6 @@ import org.ofbiz.entity.condition.Entity
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.webapp.control.ContextFilter;
-import org.owasp.esapi.errors.EncodingException;
 
 public class SeoContentUrlFilter extends ContextFilter {
     public final static String module = SeoContentUrlFilter.class.getName();
@@ -124,14 +123,10 @@ public class SeoContentUrlFilter extends
             if (contentAssocDataResources.size() > 0) {
                 GenericValue contentAssocDataResource = EntityUtil.getFirst(contentAssocDataResources);
                 url = contentAssocDataResource.getString("drObjectInfo");
-                try {
-                    url = StringUtil.defaultWebEncoder.decodeFromURL(url);
-                    String mountPoint = request.getContextPath();
-                    if (!(mountPoint.equals("/")) && !(mountPoint.equals(""))) {
-                        url = mountPoint + url;
-                    }
-                } catch (EncodingException e) {
-                    Debug.logError(e, module);
+                url = UtilCodec.getDecoder("url").decode(url);
+                String mountPoint = request.getContextPath();
+                if (!(mountPoint.equals("/")) && !(mountPoint.equals(""))) {
+                    url = mountPoint + url;
                 }
             }
         } catch (Exception e) {

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/ftl/OfbizCatalogAltUrlTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/ftl/OfbizCatalogAltUrlTransform.java?rev=1655803&r1=1654698&r2=1655803&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/ftl/OfbizCatalogAltUrlTransform.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/ftl/OfbizCatalogAltUrlTransform.java Thu Jan 29 19:06:49 2015
@@ -25,13 +25,12 @@ import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 
-import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.template.FreeMarkerWorker;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
 import org.ofbiz.product.category.CatalogUrlFilter;
 import org.ofbiz.product.category.CategoryContentWrapper;
 import org.ofbiz.product.product.ProductContentWrapper;
@@ -122,12 +121,8 @@ public class OfbizCatalogAltUrlTransform
                         }
                         // make the link
                         if (fullPath){
-                            try {
-                                OfbizUrlBuilder builder = OfbizUrlBuilder.from(request);
-                                builder.buildHostPart(newURL, "", secure);
-                            } catch (WebAppConfigurationException e) {
-                                Debug.logError(e.getMessage(), module);
-                            }
+                            OfbizUrlBuilder builder = OfbizUrlBuilder.from(request);
+                            builder.buildHostPart(newURL, url, secure);
                         }
                         newURL.append(url);
                         out.write(newURL.toString());
@@ -136,11 +131,11 @@ public class OfbizCatalogAltUrlTransform
                         LocalDispatcher dispatcher = FreeMarkerWorker.getWrappedObject("dispatcher", env);
                         Locale locale = (Locale) args.get("locale");
                         if (UtilValidate.isNotEmpty(productId)) {
-                            GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false);
+                            GenericValue product = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne();
                             ProductContentWrapper wrapper = new ProductContentWrapper(dispatcher, product, locale, "text/html");
                             url = CatalogUrlFilter.makeProductUrl(delegator, wrapper, null, ((StringModel) prefix).getAsString(), previousCategoryId, productCategoryId, productId);
                         } else {
-                            GenericValue productCategory = delegator.findOne("ProductCategory", UtilMisc.toMap("productCategoryId", productCategoryId), false);
+                            GenericValue productCategory = EntityQuery.use(delegator).from("ProductCategory").where("productCategoryId", productCategoryId).queryOne();
                             CategoryContentWrapper wrapper = new CategoryContentWrapper(dispatcher, productCategory, locale, "text/html");
                             url = CatalogUrlFilter.makeCategoryUrl(delegator, wrapper, null, ((StringModel) prefix).getAsString(), previousCategoryId, productCategoryId, productId, viewSize, viewIndex, viewSort, searchString);
                         }
@@ -152,6 +147,8 @@ public class OfbizCatalogAltUrlTransform
                     throw new IOException(e.getMessage());
                 } catch (GenericEntityException e) {
                     throw new IOException(e.getMessage());
+                } catch (WebAppConfigurationException e) {
+                    throw new IOException(e.getMessage());
                 }
             }
         };

Modified: ofbiz/trunk/framework/webapp/config/freemarkerTransforms.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/config/freemarkerTransforms.properties?rev=1655803&r1=1655802&r2=1655803&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/config/freemarkerTransforms.properties (original)
+++ ofbiz/trunk/framework/webapp/config/freemarkerTransforms.properties Thu Jan 29 19:06:49 2015
@@ -21,7 +21,8 @@
 
 # entries are in the form: key=transform name, property=transform class name
 
-ofbizUrl=org.ofbiz.webapp.ftl.OfbizUrlTransform
+#ofbizUrl=org.ofbiz.webapp.ftl.OfbizUrlTransform
+ofbizUrl=org.ofbiz.product.category.ftl.UrlRegexpTransform
 ofbizContentUrl=org.ofbiz.webapp.ftl.OfbizContentTransform
 ofbizCurrency=org.ofbiz.webapp.ftl.OfbizCurrencyTransform
 ofbizAmount=org.ofbiz.webapp.ftl.OfbizAmountTransform

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/WebAppUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/WebAppUtil.java?rev=1655803&r1=1655802&r2=1655803&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/WebAppUtil.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/WebAppUtil.java Thu Jan 29 19:06:49 2015
@@ -66,7 +66,7 @@ public final class WebAppUtil {
         String servletMapping = null;
         WebXml webXml = getWebXml(webAppInfo);
         for (ServletDef servletDef : webXml.getServlets().values()) {
-            if ("org.ofbiz.webapp.control.ControlServlet".equals(servletDef.getServletClass())) {
+            if ("org.ofbiz.webapp.control.ControlServlet".equals(servletDef.getServletClass()) || "org.ofbiz.product.category.SeoControlServlet".equals(servletDef.getServletClass())) {
                 String servletName = servletDef.getServletName();
                 // Catalina servlet mappings: key = url-pattern, value = servlet-name.
                 for (Entry<String, String> entry : webXml.getServletMappings().entrySet()) {

Modified: ofbiz/trunk/specialpurpose/ecommerce/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/ofbiz-component.xml?rev=1655803&r1=1655802&r2=1655803&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/ofbiz-component.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/ofbiz-component.xml Thu Jan 29 19:06:49 2015
@@ -68,5 +68,11 @@ under the License.
         location="webapp/ecomclone"
         mount-point="/ecomclone"
         app-bar-display="false"/>
+    <webapp name="ecomseo"
+        title="eCommerce Clone"
+        server="default-server"
+        location="webapp/ecomseo"
+        mount-point="/ecomseo"
+        app-bar-display="false"/>
 </ofbiz-component>
 

Added: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/controller.xml?rev=1655803&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/controller.xml (added)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/controller.xml Thu Jan 29 19:06:49 2015
@@ -0,0 +1,27 @@
+<?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://ecommerce/webapp/ecommerce/WEB-INF/controller.xml"/>
+    <description>OFBiz: eCommerce SEO Controller Configuration File</description>
+    
+    <handler name="jsp" type="view" class="org.ofbiz.ecommerce.webapp.view.JspViewHandler"/>
+</site-conf>

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/controller.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/controller.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/controller.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/web.xml?rev=1655803&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/web.xml (added)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/web.xml Thu Jan 29 19:06:49 2015
@@ -0,0 +1,166 @@
+<?xml version="1.0"?>
+<!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 - demostore</display-name>
+    <description>Demo Store for the Open For Business Project</description>
+
+    <context-param>
+        <param-name>webSiteId</param-name>
+        <param-value>WebStore</param-value>
+        <description>A unique ID used to look up the WebSite entity</description>
+    </context-param>
+    <context-param>
+        <param-name>localDispatcherName</param-name>
+        <param-value>ecommerce</param-value>
+        <description>A unique name used to identify/recognize the local dispatcher for the Service Engine</description>
+    </context-param>
+    <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>mainDecoratorLocation</param-name>
+        <param-value>component://ecommerce/widget/CommonScreens.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>
+    <context-param>
+        <param-name>forceHttpSession</param-name>
+        <param-value>true</param-value>
+        <description>
+            Forces the JSESSIONID cookie to be sent via http rather https, helps prevent lost sessions in web apps that
+            frequently switch between http and https.
+        </description>
+    </context-param>
+    <context-param>
+        <param-name>defaultPage</param-name>
+        <param-value>/main</param-value>
+        <description>Default page uri. Important: please DO add or remove /control to match url-pattern of SeoControlServlet.
+        </description>
+    </context-param>
+
+    <filter>
+        <filter-name>SeoCatalogUrlFilter</filter-name>
+        <display-name>SeoCatalogUrlFilter</display-name>
+        <filter-class>org.ofbiz.product.category.CatalogUrlSeoFilter</filter-class>
+        <init-param><param-name>defaultLocaleString</param-name><param-value>en_US</param-value></init-param>
+    </filter>
+    <filter>
+        <filter-name>SeoContentUrlFilter</filter-name>
+        <display-name>SeoContentUrlFilter</display-name>
+        <filter-class>org.ofbiz.product.category.SeoContentUrlFilter</filter-class>
+        <init-param>
+            <param-name>defaultLocaleString</param-name>
+            <param-value>en_US</param-value>
+        </init-param>
+        <init-param><param-name>viewRequest</param-name><param-value>ViewBlogArticle</param-value></init-param>
+    </filter>
+    <filter>
+        <filter-name>SeoContextFilter</filter-name>
+        <display-name>SeoContextFilter</display-name>
+        <filter-class>org.ofbiz.product.category.SeoContextFilter</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>/error:/control:/products:/select:/index.html:/index.jsp:/robots.txt:/default.html:/default.jsp:/images</param-value>
+        </init-param>
+    </filter>
+    <filter-mapping>
+        <filter-name>SeoCatalogUrlFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    <filter-mapping>
+        <filter-name>SeoContentUrlFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    <filter-mapping>
+        <filter-name>SeoContextFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <listener><listener-class>org.ofbiz.webapp.control.ControlEventListener</listener-class></listener>
+    <!-- NOTE: not all app servers support mounting implementations of the HttpSessionActivationListener interface -->
+    <!-- <listener><listener-class>org.ofbiz.webapp.control.ControlActivationEventListener</listener-class></listener> -->
+
+    <!-- this listener will save any abandoned cart info -->
+    <listener><listener-class>org.ofbiz.order.shoppingcart.CartEventListener</listener-class></listener>
+    <!-- this listener will clean up info -->
+    <listener><listener-class>org.ofbiz.webapp.control.LoginEventListener</listener-class></listener>
+
+    <servlet>
+        <servlet-name>SeoControlServlet</servlet-name>
+        <display-name>SeoControlServlet</display-name>
+        <description>Main SEO Control Servlet</description>
+        <servlet-class>org.ofbiz.product.category.SeoControlServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <!-- un-comment for Worldpay
+    <servlet>
+        <servlet-name>select</servlet-name>
+        <display-name>SelectHandler</display-name>
+        <description>WorldPay Select Handler Service</description>
+        <servlet-class>com.worldpay.select.merchant.SelectHandler</servlet-class>
+        <load-on-startup>5</load-on-startup>
+    </servlet>
+    -->
+    <servlet>
+        <servlet-name>SeoCatalogUrlServlet</servlet-name>
+        <display-name>SeoCatalogUrlServlet</display-name>
+        <description>SEO Catalog (Category/Product) URL Servlet</description>
+        <servlet-class>org.ofbiz.product.category.SeoCatalogUrlServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>SeoControlServlet</servlet-name>
+        <url-pattern>/*</url-pattern>
+    </servlet-mapping>
+    <!-- un-comment for Worldpay
+    <servlet-mapping>
+        <servlet-name>select</servlet-name>
+        <url-pattern>/select/*</url-pattern>
+    </servlet-mapping>
+    -->
+    <servlet-mapping>
+        <servlet-name>SeoCatalogUrlServlet</servlet-name>
+        <url-pattern>/products/*</url-pattern>
+    </servlet-mapping>
+
+    <session-config>
+        <session-timeout>60</session-timeout>
+    </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>
+
+    <error-page>
+        <error-code>404</error-code>
+        <location>/error/404.jsp</location>
+    </error-page>
+</web-app>

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/error/error.jsp
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/error/error.jsp?rev=1655803&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/error/error.jsp (added)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/error/error.jsp Thu Jan 29 19:06:49 2015
@@ -0,0 +1,53 @@
+<%--
+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.
+--%>
+
+<%@ page import="org.ofbiz.base.util.*" %>
+<html>
+<head>
+<title>Open For Business Message</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<% String errorMsg = (String) request.getAttribute("_ERROR_MESSAGE_"); %>
+
+<body bgcolor="#FFFFFF">
+<div align="center">
+  <br/>
+  <table width="100%" border="1" height="200">
+    <tr>
+      <td>
+        <table width="100%" border="0" height="200">
+          <tr bgcolor="#CC6666">
+            <td height="45">
+              <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF"><b>:ERROR MESSAGE:</b></font></div>
+            </td>
+          </tr>
+          <tr>
+            <td>
+              <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=UtilFormatOut.replaceString(errorMsg, "\n", "<br/>")%></font></div>
+            </td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+</div>
+<div align="center"></div>
+</body>
+</html>

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/error/error.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/error/error.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/error/error.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/index.jsp
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/index.jsp?rev=1655803&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/index.jsp (added)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/index.jsp Thu Jan 29 19:06:49 2015
@@ -0,0 +1,20 @@
+<%--
+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.
+--%>
+
+<%response.sendRedirect("control/main");%>

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/index.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomseo/index.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain