You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "mrisaliti@libero.it" <mr...@libero.it> on 2011/05/30 20:33:13 UTC

Re: svn commit: r1127449 [1/2] - in /ofbiz/trunk: applications/order/webapp/ordermgr/entry/cart/ applications/order/webapp/ordermgr/entry/catalog/ applications/product/src/org/ofbiz/product/category/ specialpurpose/ecommerce/data/ specialpurpose/ecommerce/...

Hi Hans,

this commit breaks the demo of ecommerce due to same missing ElettronicText 
entities.

Some NullPointerException occurs, like this:

freemarker.ext.beans.OverloadedMethodModel.exec(OverloadedMethodModel.java:
111) ... 73 more Caused by: java.lang.NullPointerException at org.ofbiz.content.
data.DataResourceWorker.writeDataResourceText(DataResourceWorker.java:799) at 
org.ofbiz.content.data.DataResourceWorker.renderDataResourceAsText
(DataResourceWorker.java:647) at

An error can be found on DemoFinAccount.xml:

<DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="FA-100-ALT" 
localeString="en"/>

but is missing the ElettronicText of this dataResourceId:

For dataResourceTypeId = "ELECTRONIC_TEXT" is mandatory to insert a record 
into ElettronicText with the reference to the dataResourceId.

Could you please fix it or revert it ?

Thanks
Marco

Il giorno 25/mag/2011, alle ore 11.25, hansbak@apache.org ha scritto:

Author: hansbak
Date: Wed May 25 09:25:16 2011
New Revision: 1127449

URL: http://svn.apache.org/viewvc?rev=1127449&view=rev
Log:
this change will introduce seo friendly urls for products and categories which 
are generated from the description. It also allows to convert url's from 
previous systems to point to the product in the current system. In the 
ecommerce demo records have been added to show this feature.

Modified:
 ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/minicart.ftl
 ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/breadcrumbs.ftl
 ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.
ftl
 ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/compareproducts.
ftl
 ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.
ftl
 
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.
java
 ofbiz/trunk/specialpurpose/ecommerce/data/DemoConfigurator.xml
 ofbiz/trunk/specialpurpose/ecommerce/data/DemoFinAccount.xml
 ofbiz/trunk/specialpurpose/ecommerce/data/DemoPopularCategoriesData.xml
 ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
 ofbiz/trunk/specialpurpose/ecommerce/data/DemoPurchasing.xml
 ofbiz/trunk/specialpurpose/ecommerce/webapp/ecomclone/WEB-INF/web.xml
 ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/web.xml
 ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/cart/showcart.ftl
 
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/ShowBestSellingCategory.
ftl
 
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/minilastviewedcategories.
ftl
 
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/miniproductsummary.
ftl
 ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.
ftl
 
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/sidedeepcategory.
ftl

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/minicart.
ftl
URL: http://svn.apache.
org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/minicart.
ftl?rev=1127449&r1=1127448&r2=1127449&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/minicart.ftl 
(original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/minicart.ftl Wed 
May 25 09:25:16 2011
@@ -59,9 +59,9 @@ under the License.
              <td>
                <#if cartLine.getProductId()?exists>
                    <#if cartLine.getParentProductId()?exists>
-                          <a href="<@ofbizUrl>product?product_id=${cartLine.
getParentProductId()}</...@ofbizUrl>" class="linktext">${cartLine.getName()}</a>
+                          <a href="<@ofbizCatalogAltUrl productId=cartLine.
getParentProductId()/>" class="linktext">${cartLine.getName()}</a>
                    <#else>
-                          <a href="<@ofbizUrl>product?product_id=${cartLine.
getProductId()}</...@ofbizUrl>" class="linktext">${cartLine.getName()}</a>
+                          <a href="<@ofbizCatalogAltUrl productId=cartLine.
getProductId()/>" class="linktext">${cartLine.getName()}</a>
                    </#if>
                <#else>
                  <strong>${cartLine.getItemTypeDescription()?if_exists}
</strong>

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/breadcrumbs.ftl
URL: http://svn.apache.
org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/breadcrumbs.
ftl?rev=1127449&r1=1127448&r2=1127449&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/breadcrumbs.
ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/breadcrumbs.
ftl Wed May 25 09:25:16 2011
@@ -29,7 +29,7 @@ under the License.
<#if (Static["org.ofbiz.product.category.CategoryWorker"].checkTrailItem
(request, category.getString("productCategoryId"))) || (curCategoryId?exists && 
curCategoryId == category.productCategoryId)>
  <li>
  <#if catContentWrappers?exists && catContentWrappers[category.
productCategoryId]?exists>
-      <a href="<@ofbizCatalogUrl currentCategoryId=category.productCategoryId 
previousCategoryId=previousCategoryId!""/>" class="<#if curCategoryId?exists && 
curCategoryId == category.
productCategoryId>buttontextdisabled<#else>linktext</#if>">
+      <a href="<@ofbizCatalogAltUrl productCategoryId=category.
productCategoryId previousCategoryId=previousCategoryId!""/>" class="<#if 
curCategoryId?exists && curCategoryId == category.
productCategoryId>buttontextdisabled<#else>linktext</#if>">
      <#if catContentWrappers[category.productCategoryId].get("CATEGORY_NAME")?
exists>
        ${catContentWrappers[category.productCategoryId].get("CATEGORY_NAME")}
      <#elseif catContentWrappers[category.productCategoryId].get
("DESCRIPTION")?exists>

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl
URL: http://svn.apache.
org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.
ftl?rev=1127449&r1=1127448&r2=1127449&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl 
(original)
+++ 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/categorydetail.ftl 
Wed May 25 09:25:16 2011
@@ -25,18 +25,18 @@ under the License.
          <select name="pageSelect" onchange="window.location=this[this.
selectedIndex].value;">
              <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int} 
${uiLabelMap.CommonOf} ${viewIndexMax + 1}</option>
              <#list 0..viewIndexMax as curViewNum>
-                     <option value="
<@ofbizUrl>category/~category_id=${productCategoryId}/~VIEW_SIZE=${viewSize}
/~VIEW_INDEX=${curViewNum?int + 1}</...@ofbizUrl>">${uiLabelMap.CommonGotoPage} 
${curViewNum + 1}</option>
+                     <option value="<@ofbizCatalogAltUrl 
productCategoryId=productCategoryId viewSize=viewSize viewIndex=(curViewNum?int 
+ 1)/>">${uiLabelMap.CommonGotoPage} ${curViewNum + 1}</option>
              </#list>
          </select>
          <#-- End Page Select Drop-Down -->
          <#if (viewIndex?int > 1)>
-                <a href="<@ofbizUrl>category/~category_id=${productCategoryId}
/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int - 1}</...@ofbizUrl>" class="
buttontext">${uiLabelMap.CommonPrevious}</a> |
+                <a href="<@ofbizCatalogAltUrl 
productCategoryId=productCategoryId viewSize=viewSize viewIndex=(viewIndex?int 
- 1)/>" class="buttontext">${uiLabelMap.CommonPrevious}</a> |
          </#if>
          <#if ((listSize?int - viewSize?int) > 0)>
              <span>${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} 
${listSize}</span>
          </#if>
          <#if highIndex?int < listSize?int>
-             | <a href="<@ofbizUrl>category/~category_id=${productCategoryId}
/~VIEW_SIZE=${viewSize}/~VIEW_INDEX=${viewIndex?int + 1}</...@ofbizUrl>" class="
buttontext">${uiLabelMap.CommonNext}</a>
+             | <a href="<@ofbizCatalogAltUrl 
productCategoryId=productCategoryId viewSize=viewSize viewIndex=(viewIndex?int 
+ 1)/>" class="buttontext">${uiLabelMap.CommonNext}</a>
          </#if>
      </div>
  </#if>

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/compareproducts.
ftl
URL: http://svn.apache.
org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/compareproducts.
ftl?rev=1127449&r1=1127448&r2=1127449&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/compareproducts.
ftl (original)
+++ 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/compareproducts.
ftl Wed May 25 09:25:16 2011
@@ -24,7 +24,7 @@ under the License.
  <#assign productData = productDataMap[product.productId]/>
  <#assign productContentWrapper = productData.productContentWrapper/>
  <#assign price = productData.priceMap/>
-    <#assign productUrl><@ofbizCatalogUrl productId=product.productId 
currentCategoryId=categoryId/></#assign>
+    <#assign productUrl><@ofbizCatalogAltUrl productId=product.
productId/></#assign>
  <#assign smallImageUrl = productContentWrapper.get("SMALL_IMAGE_URL")/>
  <#if smallImageUrl!?length == 0>
      <#assign smallImageUrl = "/images/defaultImage.jpg"/>

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl
URL: http://svn.apache.
org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.
ftl?rev=1127449&r1=1127448&r2=1127449&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl 
(original)
+++ 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl 
Wed May 25 09:25:16 2011
@@ -53,7 +53,7 @@ ${virtualJavaScript?if_exists}
</script>
<#if product?exists>
  <#-- variable setup -->
-    <#assign productUrl><@ofbizCatalogUrl productId=product.productId 
currentCategoryId=categoryId/></#assign>
+    <#assign productUrl><@ofbizCatalogAltUrl productId=product.productId 
productCategoryId=categoryId/></#assign>

  <#if requestAttributes.productCategoryMember?exists>
      <#assign prodCatMem = requestAttributes.productCategoryMember>

Modified: 
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.
java
URL: http://svn.apache.
org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.
java?rev=1127449&r1=1127448&r2=1127449&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.
java (original)
+++ 
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.
java Wed May 25 09:25:16 2011
@@ -57,8 +57,6 @@ public class CatalogUrlFilter extends Co
  public static final String PRODUCT_REQUEST = "product";
  public static final String CATEGORY_REQUEST = "category";

-    protected static String defaultViewIndex = null;
-    protected static String defaultViewSize = null;
  protected static String defaultLocaleString = null;
  protected static String redirectUrl = null;

@@ -105,20 +103,16 @@ public class CatalogUrlFilter extends Co
      }

      // set initial parameters
-        String initDefaultViewIndex = config.getInitParameter
("defaultViewIndex");
-        String initDefaultViewSize = config.getInitParameter
("defaultViewSize");
      String initDefaultLocalesString = config.getInitParameter
("defaultLocaleString");
      String initRedirectUrl = config.getInitParameter("redirectUrl");
-        defaultViewIndex = UtilValidate.isNotEmpty(initDefaultViewIndex) ? 
initDefaultViewIndex : "";
-        defaultViewSize = UtilValidate.isNotEmpty(initDefaultViewSize) ? 
initDefaultViewSize : "";
      defaultLocaleString = UtilValidate.isNotEmpty(initDefaultLocalesString) 
? initDefaultLocalesString : "";
      redirectUrl = UtilValidate.isNotEmpty(initRedirectUrl) ? initRedirectUrl 
: "";

      String pathInfo = httpRequest.getServletPath();
-        
      if (UtilValidate.isNotEmpty(pathInfo)) {
          List<String> pathElements = StringUtil.split(pathInfo, "/");
          String alternativeUrl = pathElements.get(0);
+
          // get web site and default locale string
          String localeString = null;
          String webSiteId = WebSiteWorker.getWebSiteId(request);
@@ -138,8 +132,8 @@ public class CatalogUrlFilter extends Co
          }

          // get view index, view size and view sort from path info
-            String viewIndex = defaultViewIndex;
-            String viewSize = defaultViewSize;
+            String viewIndex = null;
+            String viewSize = null;
          String viewSort = null;
          String searchString = null;

@@ -163,38 +157,131 @@ public class CatalogUrlFilter extends Co
              }
          }

+            if (UtilValidate.isNotEmpty(httpRequest.getParameter
("viewIndex"))) {
+                viewIndex = httpRequest.getParameter("viewIndex");
+            }
+            if (UtilValidate.isNotEmpty(httpRequest.getParameter
("viewSize"))) {
+                viewSize = httpRequest.getParameter("viewSize");
+            }
+            if (UtilValidate.isNotEmpty(httpRequest.getParameter
("viewSort"))) {
+                viewSort = httpRequest.getParameter("viewSort");
+            }
+            if (UtilValidate.isNotEmpty(httpRequest.getParameter
("searchString"))) {
+                searchString = httpRequest.getParameter("searchString");
+            }
+
          String productId = null;
          String productCategoryId = null;

          try {
              // look for productId
-                List<EntityCondition> productContentConds = FastList.
newInstance();
-                productContentConds.add(EntityCondition.makeCondition(
-                      EntityCondition.makeCondition("drObjectInfo", 
alternativeUrl)
-                      , EntityOperator.OR
-                      , EntityCondition.makeCondition("drObjectInfo", "/" + 
alternativeUrl)));
-                productContentConds.add(EntityCondition.makeCondition
("localeString", localeString));
-                productContentConds.add(EntityCondition.makeCondition
("productContentTypeId", "ALTERNATIVE_URL"));
-                productContentConds.add(EntityUtil.getFilterByDateExpr());
-                List<GenericValue> productContentInfos = delegator.findList
("ProductContentAndInfo", EntityCondition.makeCondition(productContentConds), 
null, UtilMisc.toList("-fromDate"), null, true);
-                if (UtilValidate.isNotEmpty(productContentInfos)) {
-                    GenericValue productContentInfo = EntityUtil.getFirst
(productContentInfos);
-                    productId = productContentInfo.getString("productId");
+                if (alternativeUrl.endsWith("-p")) {
+                    List<EntityCondition> productContentConds = FastList.
newInstance();
+                    productContentConds.add(EntityCondition.makeCondition
("productContentTypeId", "ALTERNATIVE_URL"));
+                    productContentConds.add(EntityUtil.
getFilterByDateExpr());
+                    List<GenericValue> productContentInfos = delegator.
findList("ProductContentAndInfo", EntityCondition.makeCondition
(productContentConds), null, UtilMisc.toList("-fromDate"), null, true);
+                    if (UtilValidate.isNotEmpty(productContentInfos)) {
+                        for(GenericValue productContentInfo : 
productContentInfos){
+                            String contentId = (String) productContentInfo.get
("contentId");
+                            List<GenericValue> 
ContentAssocDataResourceViewTos = delegator.findByAndCache
("ContentAssocDataResourceViewTo", UtilMisc.toMap("contentIdStart", contentId, 
"drLocaleString", localeString, "caContentAssocTypeId", "ALTERNATE_LOCALE", 
"drDataResourceTypeId", "ELECTRONIC_TEXT"));
+                            if (UtilValidate.isNotEmpty
(ContentAssocDataResourceViewTos)){
+                                for (GenericValue 
ContentAssocDataResourceViewTo : ContentAssocDataResourceViewTos) {
+                                    GenericValue ElectronicText = 
ContentAssocDataResourceViewTo.getRelatedOneCache("ElectronicText");
+                                    if (UtilValidate.isNotEmpty
(ElectronicText)) {
+                                        String textData = (String) 
ElectronicText.get("textData");
+                                        textData = invalidCharacter
(textData);
+                                        if (alternativeUrl.matches(textData + 
".+$")) {
+                                            String productIdStr = null;
+                                            productIdStr = alternativeUrl.
replace(textData + "-", "");
+                                            productIdStr = productIdStr.
replace("-p", "");
+                                            String checkProductId = (String) 
productContentInfo.get("productId");
+                                            if (productIdStr.equalsIgnoreCase
(checkProductId)) {
+                                                productId = checkProductId;
+                                                break;
+                                            }
+                                        }
+                                    }
+                                }
+                            } else {
+                                List<GenericValue> contentDataResourceViews = 
delegator.findByAndCache("ContentDataResourceView", UtilMisc.toMap("contentId", 
contentId, "statusId", "CTNT_IN_PROGRESS", "drDataResourceTypeId", 
"ELECTRONIC_TEXT"));
+                                for (GenericValue contentDataResourceView : 
contentDataResourceViews) {
+                                    GenericValue ElectronicText = 
contentDataResourceView.getRelatedOneCache("ElectronicText");
+                                    if (UtilValidate.isNotEmpty
(ElectronicText)) {
+                                        String textData = (String) 
ElectronicText.get("textData");
+                                        if (UtilValidate.isNotEmpty
(textData)) {
+                                            textData = invalidCharacter
(textData);
+                                            if (alternativeUrl.matches
(textData + ".+$")) {
+                                                String productIdStr = null;
+                                                productIdStr = alternativeUrl.
replace(textData + "-", "");
+                                                productIdStr = productIdStr.
replace("-p", "");
+                                                String checkProductId = 
(String) productContentInfo.get("productId");
+                                                if (productIdStr.
equalsIgnoreCase(checkProductId)) {
+                                                    productId = 
checkProductId;
+                                                    break;
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
              }

              // look for productCategoryId
-                List<EntityCondition> productCategoryContentConds = FastList.
newInstance();
-                productCategoryContentConds.add(EntityCondition.makeCondition
(
-                        EntityCondition.makeCondition("drObjectInfo", 
alternativeUrl)
-                        , EntityOperator.OR
-                        , EntityCondition.makeCondition("drObjectInfo", "/" + 
alternativeUrl)));
-                productContentConds.add(EntityCondition.makeCondition
("localeString", localeString));
-                productCategoryContentConds.add(EntityCondition.makeCondition
("prodCatContentTypeId", "ALTERNATIVE_URL"));
-                productCategoryContentConds.add(EntityUtil.
getFilterByDateExpr());
-                List<GenericValue> productCategoryContentInfos = delegator.
findList("ProductCategoryContentAndInfo", EntityCondition.makeCondition
(productCategoryContentConds), null, UtilMisc.toList("-fromDate"), null, true);
-                if (UtilValidate.isNotEmpty(productCategoryContentInfos)) {
-                    GenericValue productCategoryContentInfo = EntityUtil.
getFirst(productCategoryContentInfos);
-                    productCategoryId = productCategoryContentInfo.getString
("productCategoryId");
+                if (alternativeUrl.endsWith("-c")) {
+                    List<EntityCondition> productCategoryContentConds = 
FastList.newInstance();
+                    productCategoryContentConds.add(EntityCondition.
makeCondition("prodCatContentTypeId", "ALTERNATIVE_URL"));
+                    productCategoryContentConds.add(EntityUtil.
getFilterByDateExpr());
+                    List<GenericValue> productCategoryContentInfos = 
delegator.findList("ProductCategoryContentAndInfo", EntityCondition.
makeCondition(productCategoryContentConds), null, UtilMisc.toList("-fromDate"), 
null, true);
+                    if (UtilValidate.isNotEmpty(productCategoryContentInfos)) 
{
+                        for(GenericValue productCategoryContentInfo : 
productCategoryContentInfos){
+                            String contentId = (String) 
productCategoryContentInfo.get("contentId");
+                            List<GenericValue> 
ContentAssocDataResourceViewTos = delegator.findByAndCache
("ContentAssocDataResourceViewTo", UtilMisc.toMap("contentIdStart", contentId, 
"drLocaleString", localeString, "caContentAssocTypeId", "ALTERNATE_LOCALE", 
"drDataResourceTypeId", "ELECTRONIC_TEXT"));
+                            if (UtilValidate.isNotEmpty
(ContentAssocDataResourceViewTos)){
+                                for (GenericValue 
ContentAssocDataResourceViewTo : ContentAssocDataResourceViewTos) {
+                                    GenericValue ElectronicText = 
ContentAssocDataResourceViewTo.getRelatedOneCache("ElectronicText");
+                                    if (UtilValidate.isNotEmpty
(ElectronicText)){
+                                        String textData = (String) 
ElectronicText.get("textData");
+                                        if (UtilValidate.isNotEmpty
(textData)) {
+                                            textData = invalidCharacter
(textData);
+                                            if (alternativeUrl.matches
(textData + ".+$")) {
+                                                String productCategoryStr = 
null;
+                                                productCategoryStr = 
alternativeUrl.replace(textData + "-", "");
+                                                productCategoryStr = 
productCategoryStr.replace("-c", "");
+                                                String checkProductCategoryId 
= (String) productCategoryContentInfo.get("productCategoryId");
+                                                if (productCategoryStr.
equalsIgnoreCase(checkProductCategoryId)) {
+                                                    productCategoryId = 
checkProductCategoryId;
+                                                    break;
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            } else {
+                                List<GenericValue> contentDataResourceViews = 
delegator.findByAndCache("ContentDataResourceView", UtilMisc.toMap("contentId", 
contentId, "statusId", "CTNT_IN_PROGRESS", "drDataResourceTypeId", 
"ELECTRONIC_TEXT"));
+                                for (GenericValue contentDataResourceView : 
contentDataResourceViews) {
+                                    GenericValue ElectronicText = 
contentDataResourceView.getRelatedOneCache("ElectronicText");
+                                    if (UtilValidate.isNotEmpty
(ElectronicText)) {
+                                        String textData = (String) 
ElectronicText.get("textData");
+                                        if (UtilValidate.isNotEmpty
(textData)) {
+                                            textData = invalidCharacter
(textData);
+                                            if (alternativeUrl.matches
(textData + ".+$")) {
+                                                String productCategoryStr = 
null;
+                                                productCategoryStr = 
alternativeUrl.replace(textData + "-", "");
+                                                productCategoryStr = 
productCategoryStr.replace("-c", "");
+                                                String checkProductCategoryId 
= (String) productCategoryContentInfo.get("productCategoryId");
+                                                if (productCategoryStr.
equalsIgnoreCase(checkProductCategoryId)) {
+                                                    productCategoryId = 
checkProductCategoryId;
+                                                    break;
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
              }
          } catch (GenericEntityException e) {
              Debug.logWarning("Cannot look for product and product category", 
module);
@@ -387,6 +474,7 @@ public class CatalogUrlFilter extends Co

  public static String makeCategoryUrl(HttpServletRequest request, String 
previousCategoryId, String productCategoryId, String productId, String 
viewSize, String viewIndex, String viewSort, String searchString) {
      Delegator delegator = (Delegator) request.getAttribute("delegator");
+        String url = null;
      try {
          GenericValue productCategory = delegator.findOne("ProductCategory", 
UtilMisc.toMap("productCategoryId", productCategoryId), true);
          CategoryContentWrapper wrapper = new CategoryContentWrapper
(productCategory, request);
@@ -399,7 +487,13 @@ public class CatalogUrlFilter extends Co
                  urlBuilder.append("/");
              }
              // append alternative URL
-                urlBuilder.append(alternativeUrl);
+                url = invalidCharacter(alternativeUrl.toString());
+                urlBuilder.append(url);
+                if (UtilValidate.isNotEmpty(productCategoryId)) {
+                    urlBuilder.append("-");
+                    urlBuilder.append(productCategoryId);
+                    urlBuilder.append("-c");
+                }
              // append view index
              if (UtilValidate.isNotEmpty(viewIndex)) {
                  if (!urlBuilder.toString().endsWith("?") && !urlBuilder.
toString().endsWith("&")) {
@@ -428,6 +522,10 @@ public class CatalogUrlFilter extends Co
                  }
                  urlBuilder.append("searchString=" + searchString + "&");
              }
+                if (urlBuilder.toString().endsWith("&")) {
+                    return urlBuilder.toString().substring(0, urlBuilder.
toString().length()-1);
+                }
+                
              return  urlBuilder.toString();
          } else {
              return CatalogUrlServlet.makeCatalogUrl(request, productId, 
productCategoryId, previousCategoryId);
@@ -440,6 +538,7 @@ public class CatalogUrlFilter extends Co

  public static String makeProductUrl(HttpServletRequest request, String 
previousCategoryId, String productCategoryId, String productId) {
      Delegator delegator = (Delegator) request.getAttribute("delegator");
+        String url = null;
      try {
          GenericValue product = delegator.findOne("Product", UtilMisc.toMap
("productId", productId), true);
          ProductContentWrapper wrapper = new ProductContentWrapper(product, 
request);
@@ -451,7 +550,13 @@ public class CatalogUrlFilter extends Co
                  urlBuilder.append("/");
              }
              // append alternative URL
-                urlBuilder.append(alternativeUrl);
+                url = invalidCharacter(alternativeUrl.toString());
+                urlBuilder.append(url);
+                if (UtilValidate.isNotEmpty(productId)) {
+                    urlBuilder.append("-");
+                    urlBuilder.append(productId);
+                    urlBuilder.append("-p");
+                }
              return  urlBuilder.toString();
          } else {
              return CatalogUrlServlet.makeCatalogUrl(request, productId, 
productCategoryId, previousCategoryId);
@@ -461,4 +566,82 @@ public class CatalogUrlFilter extends Co
          return redirectUrl;
      }
  }
+    
+    public static String invalidCharacter(String str) {
+        str = str.replace("&", "-");
+        str = str.replace("\"", "-");
+        str = str.replace("Ø", "-");
+        str = str.replace("÷", "-");
+        str = str.replace(" ", "-");
+        str = str.replace("!", "-");
+        str = str.replace("#", "-");
+        str = str.replace("$", "-");
+        str = str.replace("%", "-");
+        str = str.replace("'", "-");
+        str = str.replace("(", "-");
+        str = str.replace(")", "-");
+        str = str.replace("*", "-");
+        str = str.replace("+", "-");
+        str = str.replace(",", "-");
+        str = str.replace(".", "-");
+        str = str.replace("/", "-");
+        str = str.replace(":", "-");
+        str = str.replace(";", "-");
+        str = str.replace("<", "-");
+        str = str.replace("=", "-");
+        str = str.replace(">", "-");
+        str = str.replace("?", "-");
+        str = str.replace("@", "-");
+        str = str.replace("[", "-");
+        str = str.replace("\\", "-");
+        str = str.replace("]", "-");
+        str = str.replace("^", "-");
+        str = str.replace("_", "-");
+        str = str.replace("`", "-");
+        str = str.replace("{", "-");
+        str = str.replace("|", "-");
+        str = str.replace("}", "-");
+        str = str.replace("~", "-");
+        str = str.replace("ï¿ ", "-");
+        str = str.replace("ï¿¡", "-");
+        str = str.replace("¤", "-");
+        str = str.replace("§", "-");
+        str = str.replace("¨", "-");
+        str = str.replace("¬", "-");
+        str = str.replace("Ë≈", "-");
+        str = str.replace("°", "-");
+        str = str.replace("±", "-");
+        str = str.replace("Îπ", "-");
+        str = str.replace("â•¢", "-");
+        str = str.replace("ïπ™", "-");
+        str = str.replace("ï¿¥", "-");
+        str = str.replace("╜╜", "-");
+        str = str.replace("ïπ√", "-");
+        str = str.replace("ïπ≈", "-");
+        str = str.replace("╉╉", "-");
+        str = str.replace("ã•∆", "-");
+        str = str.replace("㕌", "-");
+        str = str.replace("ï∏˝", "-");
+        str = str.replace("ï∏ˇ", "-");
+        str = str.replace("ïπ˚", "-");
+        str = str.replace("ïπ˝", "-");
+        str = str.replace("╲", "-");
+        str = str.replace("ã•™", "-");
+        str = str.replace("ã•…", "-");
+        str = str.replace("ã•—", "-");
+        str = str.replace("ïπ‘", "-");
+        str = str.replace("ã•≠", "-");
+        str = str.replace("╢", "-");
+        str = str.replace("ïπƒ", "-");
+        while(str.startsWith("-")){
+            str = str.substring(1);
+        }
+        while(str.endsWith("-")){
+            str = str.substring(0,str.length() - 1);
+        }
+        while(str.indexOf("--") != -1){
+            str = str.replace("--","-");
+        }
+        return str;
+    }
}

Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoConfigurator.xml
URL: http://svn.apache.
org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoConfigurator.xml?
rev=1127449&r1=1127448&r2=1127449&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/data/DemoConfigurator.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoConfigurator.xml Wed May 25 
09:25:16 2011
@@ -224,4 +224,185 @@ under the License.
  <ProductCategoryMember productCategoryId="CATALOG1_SEARCH" productId="PIZZA" 
fromDate="2004-09-24 15:09:47.338"/>
  <ProductCategoryMember productCategoryId="PROMOTIONS" productId="PIZZA" 
fromDate="2004-09-24 15:09:47.338"/>

+    <!-- alternative URL -->
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="PC-100-
ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DRPC-
100-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="FOOD-
001-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DRFOOD-
001-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="PC001-
ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRPC001-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
RAM1GB_BRAND-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRRAM1GB_BRAND-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
HD250GB_BRAND-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRHD250GB_BRAND-ALT" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
HD500GB_BRAND-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRHD500GB_BRAND-ALT" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
ETH_BRAND-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRETH_BRAND-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
MOD_BRAND-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRMOD_BRAND-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
MOTHER_BOARD_ASS-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DMOTHER_BOARD_ASS" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
MOTHER_BOARD-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRMOTHER_BOARD-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="CPU-
586-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DRCPU-
586-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
ENCHILADAS-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRENCHILADAS-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
FAJITA_BEEF-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRFAJITA_BEEF-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
JALAPENOS-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRJALAPENOS-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="PIZZA-
ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRPIZZA-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DOUGH-
ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRDOUGH-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="SAUCE-
ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRSAUCE-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="SAUCE-
TM-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRSAUCE-TM-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="SAUCE-
CM-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRSAUCE-CM-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="SAUCE-
TP-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRSAUCE-TP-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="SAUCE-
CP-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRSAUCE-CP-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
PEPPERS-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRPEPPERS-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
PEPPERS-H-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRPEPPERS-H-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
PEPPERS-G-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRPEPPERS-G-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
PEPPERS-R-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="
DRPEPPERS-R-ALTEN" localeString="en_US"/>
+    
+    <ElectronicText dataResourceId="DRPC-100-ALTEN" textData="configurable-
pcs"/>
+    <ElectronicText dataResourceId="DRFOOD-001-ALTEN" textData="configurable-
foods"/>
+    <ElectronicText dataResourceId="DRPC001-ALTEN" textData="configurable-pc"
/>
+    <ElectronicText dataResourceId="DRRAM1GB_BRAND-ALTEN" textData="ram-1-gb-
ddr2"/>
+    <ElectronicText dataResourceId="DRHD250GB_BRAND-ALT" textData="hd-250-gb"
/>
+    <ElectronicText dataResourceId="DRHD500GB_BRAND-ALT" textData="hd-450-gb"
/>
+    <ElectronicText dataResourceId="DRETH_BRAND-ALTEN" textData="ethernet-
card-10-100"/>
+    <ElectronicText dataResourceId="DRMOD_BRAND-ALTEN" textData="modem-card-
56k"/>
+    <ElectronicText dataResourceId="DMOTHER_BOARD_ASS" textData="motherboard-
assembly"/>
+    <ElectronicText dataResourceId="DRMOTHER_BOARD-ALTEN" textData="
motherboard"/>
+    <ElectronicText dataResourceId="DRCPU-586-ALTEN" textData="cpu-intel-586"
/>
+    <ElectronicText dataResourceId="DRENCHILADAS-ALTEN" textData="enchiladas"
/>
+    <ElectronicText dataResourceId="DRFAJITA_BEEF-ALTEN" textData="fajita-
beef"/>
+    <ElectronicText dataResourceId="DRJALAPENOS-ALTEN" textData="jalapenos"/>
+    <ElectronicText dataResourceId="DRPIZZA-ALTEN" textData="pizza"/>
+    <ElectronicText dataResourceId="DRDOUGH-ALTEN" textData="dough"/>
+    <ElectronicText dataResourceId="DRSAUCE-ALTEN" textData="sauce"/>
+    <ElectronicText dataResourceId="DRSAUCE-TM-ALTEN" textData="tomato-sauce-
with-mozzarella"/>
+    <ElectronicText dataResourceId="DRSAUCE-CM-ALTEN" textData="chili-sauce-
with-mozzarella"/>
+    <ElectronicText dataResourceId="DRSAUCE-TP-ALTEN" textData="tomato-sauce-
with-parmesan"/>
+    <ElectronicText dataResourceId="DRSAUCE-CP-ALTEN" textData="chili-sauce-
with-parmesan"/>
+    <ElectronicText dataResourceId="DRPEPPERS-ALTEN" textData="pepper"/>
+    <ElectronicText dataResourceId="DRPEPPERS-G-ALTEN" textData="green-
peppers"/>
+    <ElectronicText dataResourceId="DRPEPPERS-H-ALTEN" textData="hot-peppers"
/>
+    <ElectronicText dataResourceId="DRPEPPERS-R-ALTEN" textData="roasted-
peppers"/>
+    
+    <Content contentId="PC-100-ALT" contentTypeId="DOCUMENT" dataResourceId="
PC-100-ALT" localeString="en"/>
+    <Content contentId="CPC-100-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRPC-100-ALTEN" localeString="en_US"/>
+    <Content contentId="FOOD-001-ALT" contentTypeId="DOCUMENT" 
dataResourceId="FOOD-001-ALT" localeString="en"/>
+    <Content contentId="CFOOD-001-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRFOOD-001-ALTEN" localeString="en_US"/>
+    <Content contentId="PC001-ALT" contentTypeId="DOCUMENT" dataResourceId="
PC001-ALT" localeString="en"/>
+    <Content contentId="CPC001-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRPC001-ALTEN" localeString="en_US"/>
+    <Content contentId="RAM1GB_BRAND-ALT" contentTypeId="DOCUMENT" 
dataResourceId="RAM1GB_BRAND-ALT" localeString="en"/>
+    <Content contentId="CRAM1GB_BRAND-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRRAM1GB_BRAND-ALTEN" localeString="en_US"/>
+    <Content contentId="HD250GB_BRAND-ALT" contentTypeId="DOCUMENT" 
dataResourceId="HD250GB_BRAND-ALT" localeString="en"/>
+    <Content contentId="CHD250GB_BRAND-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRHD250GB_BRAND-ALT" localeString="en_US"/>
+    <Content contentId="HD500GB_BRAND-ALT" contentTypeId="DOCUMENT" 
dataResourceId="HD500GB_BRAND-ALT" localeString="en"/>
+    <Content contentId="CHD500GB_BRAND-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRHD500GB_BRAND-ALT" localeString="en_US"/>
+    <Content contentId="ETH_BRAND-ALT" contentTypeId="DOCUMENT" 
dataResourceId="ETH_BRAND-ALT" localeString="en"/>
+    <Content contentId="CETH_BRAND-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRETH_BRAND-ALTEN" localeString="en_US"/>
+    <Content contentId="MOD_BRAND-ALT" contentTypeId="DOCUMENT" 
dataResourceId="MOD_BRAND-ALT" localeString="en"/>
+    <Content contentId="CMOD_BRAND-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRMOD_BRAND-ALTEN" localeString="en_US"/>
+    <Content contentId="MOTHER_BOARD_ASS-ALT" contentTypeId="DOCUMENT" 
dataResourceId="MOTHER_BOARD_ASS-ALT" localeString="en"/>
+    <Content contentId="CMOTHER_BOARD_ASS" contentTypeId="DOCUMENT" 
dataResourceId="DMOTHER_BOARD_ASS" localeString="en_US"/>
+    <Content contentId="MOTHER_BOARD-ALT" contentTypeId="DOCUMENT" 
dataResourceId="MOTHER_BOARD-ALT" localeString="en"/>
+    <Content contentId="CMOTHER_BOARD-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRMOTHER_BOARD-ALTEN" localeString="en_US"/>
+    <Content contentId="CPU-586-ALT" contentTypeId="DOCUMENT" dataResourceId="
CPU-586-ALT" localeString="en"/>
+    <Content contentId="CCPU-586-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRCPU-586-ALTEN" localeString="en_US"/>
+    <Content contentId="ENCHILADAS-ALT" contentTypeId="DOCUMENT" 
dataResourceId="ENCHILADAS-ALT" localeString="en"/>
+    <Content contentId="CENCHILADAS-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRENCHILADAS-ALTEN" localeString="en_US"/>
+    <Content contentId="FAJITA_BEEF-ALT" contentTypeId="DOCUMENT" 
dataResourceId="FAJITA_BEEF-ALT" localeString="en"/>
+    <Content contentId="CFAJITA_BEEF-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRFAJITA_BEEF-ALTEN" localeString="en_US"/>
+    <Content contentId="JALAPENOS-ALT" contentTypeId="DOCUMENT" 
dataResourceId="JALAPENOS-ALT" localeString="en"/>
+    <Content contentId="CJALAPENOS-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRJALAPENOS-ALTEN" localeString="en_US"/>
+    <Content contentId="PIZZA-ALT" contentTypeId="DOCUMENT" dataResourceId="
PIZZA-ALT" localeString="en"/>
+    <Content contentId="CPIZZA-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRPIZZA-ALTEN" localeString="en_US"/>
+    <Content contentId="DOUGH-ALT" contentTypeId="DOCUMENT" dataResourceId="
DOUGH-ALT" localeString="en"/>
+    <Content contentId="CDOUGH-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRDOUGH-ALTEN" localeString="en_US"/>
+    <Content contentId="SAUCE-ALT" contentTypeId="DOCUMENT" dataResourceId="
SAUCE-ALT" localeString="en"/>
+    <Content contentId="CSAUCE-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRSAUCE-ALTEN" localeString="en_US"/>
+    <Content contentId="SAUCE-TM-ALT" contentTypeId="DOCUMENT" 
dataResourceId="SAUCE-TM-ALT" localeString="en"/>
+    <Content contentId="CSAUCE-TM-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRSAUCE-TM-ALTEN" localeString="en_US"/>
+    <Content contentId="SAUCE-CM-ALT" contentTypeId="DOCUMENT" 
dataResourceId="SAUCE-CM-ALT" localeString="en"/>
+    <Content contentId="CSAUCE-CM-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRSAUCE-CM-ALTEN" localeString="en_US"/>
+    <Content contentId="SAUCE-TP-ALT" contentTypeId="DOCUMENT" 
dataResourceId="SAUCE-TP-ALT" localeString="en"/>
+    <Content contentId="CSAUCE-TP-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRSAUCE-TP-ALTEN" localeString="en_US"/>
+    <Content contentId="SAUCE-CP-ALT" contentTypeId="DOCUMENT" 
dataResourceId="SAUCE-CP-ALT" localeString="en"/>
+    <Content contentId="CSAUCE-CP-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRSAUCE-CP-ALTEN" localeString="en_US"/>
+    <Content contentId="PEPPERS-ALT" contentTypeId="DOCUMENT" dataResourceId="
PEPPERS-ALT" localeString="en"/>
+    <Content contentId="CPEPPERS-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRPEPPERS-ALTEN" localeString="en_US"/>
+    <Content contentId="PEPPERS-G-ALT" contentTypeId="DOCUMENT" 
dataResourceId="PEPPERS-G-ALT" localeString="en"/>
+    <Content contentId="CPEPPERS-G-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRPEPPERS-G-ALTEN" localeString="en_US"/>
+    <Content contentId="PEPPERS-H-ALT" contentTypeId="DOCUMENT" 
dataResourceId="PEPPERS-H-ALT" localeString="en"/>
+    <Content contentId="CPEPPERS-H-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRPEPPERS-H-ALTEN" localeString="en_US"/>
+    <Content contentId="PEPPERS-R-ALT" contentTypeId="DOCUMENT" 
dataResourceId="PEPPERS-R-ALT" localeString="en"/>
+    <Content contentId="CPEPPERS-R-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRPEPPERS-R-ALTEN" localeString="en_US"/>
+    
+    <ContentAssoc contentId="PC-100-ALT" contentIdTo="CPC-100-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="FOOD-001-ALT" contentIdTo="CFOOD-001-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="PC001-ALT" contentIdTo="CPC001-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="RAM1GB_BRAND-ALT" contentIdTo="CRAM1GB_BRAND-
ALTEN" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="HD250GB_BRAND-ALT" contentIdTo="CHD250GB_BRAND-
ALTEN" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="HD500GB_BRAND-ALT" contentIdTo="CHD500GB_BRAND-
ALTEN" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="ETH_BRAND-ALT" contentIdTo="CETH_BRAND-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="MOD_BRAND-ALT" contentIdTo="CMOD_BRAND-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="MOTHER_BOARD_ASS-ALT" contentIdTo="
CMOTHER_BOARD_ASS" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 
12:00:00.0"/>
+    <ContentAssoc contentId="MOTHER_BOARD-ALT" contentIdTo="CMOTHER_BOARD-
ALTEN" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="CPU-586-ALT" contentIdTo="CCPU-586-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="ENCHILADAS-ALT" contentIdTo="CENCHILADAS-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="FAJITA_BEEF-ALT" contentIdTo="CFAJITA_BEEF-
ALTEN" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="JALAPENOS-ALT" contentIdTo="CJALAPENOS-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="PIZZA-ALT" contentIdTo="CPIZZA-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="DOUGH-ALT" contentIdTo="CDOUGH-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="SAUCE-ALT" contentIdTo="CSAUCE-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="SAUCE-TM-ALT" contentIdTo="CSAUCE-TM-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="SAUCE-CM-ALT" contentIdTo="CSAUCE-CM-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="SAUCE-TP-ALT" contentIdTo="CSAUCE-TP-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="SAUCE-CP-ALT" contentIdTo="CSAUCE-CP-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="PEPPERS-ALT" contentIdTo="CPEPPERS-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="PEPPERS-G-ALT" contentIdTo="CPEPPERS-G-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="PEPPERS-H-ALT" contentIdTo="CPEPPERS-H-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="PEPPERS-R-ALT" contentIdTo="CPEPPERS-R-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    
+    <ProductCategoryContent prodCatContentTypeId="ALTERNATIVE_URL" 
productCategoryId="PC-100" contentId="PC-100-ALT" fromDate="2001-05-13 12:00:
00.0"/>
+    <ProductCategoryContent prodCatContentTypeId="ALTERNATIVE_URL" 
productCategoryId="FOOD-001" contentId="FOOD-001-ALT" fromDate="2001-05-13 12:
00:00.0"/>
+    
+    <ProductContent productId="PC001" contentId="PC001-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="RAM1GB_BRAND" contentId="RAM1GB_BRAND-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="HD250GB_BRAND" contentId="HD250GB_BRAND-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="HD500GB_BRAND" contentId="HD500GB_BRAND-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="ETH_BRAND" contentId="ETH_BRAND-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="MOD_BRAND" contentId="MOD_BRAND-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="MOTHER_BOARD_ASS" contentId="MOTHER_BOARD_ASS-
ALT" productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="MOTHER_BOARD" contentId="MOTHER_BOARD-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="CPU-586" contentId="CPU-586-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="ENCHILADAS" contentId="ENCHILADAS-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="FAJITA_BEEF" contentId="FAJITA_BEEF-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="JALAPENOS" contentId="JALAPENOS-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="PIZZA" contentId="PIZZA-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="DOUGH" contentId="DOUGH-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="SAUCE" contentId="SAUCE-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="SAUCE-TM" contentId="SAUCE-TM-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="SAUCE-CM" contentId="SAUCE-CM-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="SAUCE-TP" contentId="SAUCE-TP-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="SAUCE-CP" contentId="SAUCE-CP-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="PEPPERS" contentId="PEPPERS-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="PEPPERS-G" contentId="PEPPERS-G-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="PEPPERS-H" contentId="PEPPERS-H-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="PEPPERS-R" contentId="PEPPERS-R-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
</entity-engine-xml>

Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoFinAccount.xml
URL: http://svn.apache.
org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoFinAccount.xml?
rev=1127449&r1=1127448&r2=1127449&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/data/DemoFinAccount.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoFinAccount.xml Wed May 25 09:
25:16 2011
@@ -87,4 +87,41 @@

  <!-- associate the fulfillment service with the products -->
  <ProductContent productId="FA-001" contentId="FA_ACTIVATION" 
productContentTypeId="FULFILLMENT_EXTASYNC" fromDate="2000-01-01 00:00:00"/>
+    
+    <!-- alternative URL -->
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="FA-100-
ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DRFA-
100-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="FA-001-
ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DRFA-
001-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="FA-001-
30-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DRFA-
001-30-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="FA-001-
50-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DRFA-
001-50-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="FA-001-
O-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DRFA-
001-O-ALTEN" localeString="en_US"/>
+    <ElectronicText dataResourceId="DRFA-100-ALTEN" textData="account-
activation"/>
+    <ElectronicText dataResourceId="DRFA-001-ALTEN" textData="financial-
account-activation"/>
+    <ElectronicText dataResourceId="DRFA-001-30-ALTEN" textData="financial-
account-activation-30"/>
+    <ElectronicText dataResourceId="DRFA-001-50-ALTEN" textData="financial-
account-activation-50"/>
+    <ElectronicText dataResourceId="DRFA-001-O-ALTEN" textData="financial-
account-activation-o"/>
+    <Content contentId="FA-100-ALT" contentTypeId="DOCUMENT" dataResourceId="
FA-100-ALT" localeString="en"/>
+    <Content contentId="CFA-100-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRFA-100-ALTEN" localeString="en_US"/>
+    <Content contentId="FA-001-ALT" contentTypeId="DOCUMENT" dataResourceId="
FA-001-ALT" localeString="en"/>
+    <Content contentId="CFA-001-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRFA-001-ALTEN" localeString="en_US"/>
+    <Content contentId="FA-001-30-ALT" contentTypeId="DOCUMENT" 
dataResourceId="FA-001-30-ALT" localeString="en"/>
+    <Content contentId="CFA-001-30-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRFA-001-30-ALTEN" localeString="en_US"/>
+    <Content contentId="FA-001-50-ALT" contentTypeId="DOCUMENT" 
dataResourceId="FA-001-50-ALT" localeString="en"/>
+    <Content contentId="CFA-001-50-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRFA-001-50-ALTEN" localeString="en_US"/>
+    <Content contentId="FA-001-O-ALT" contentTypeId="DOCUMENT" 
dataResourceId="FA-001-O-ALT" localeString="en"/>
+    <Content contentId="CFA-001-O-ALTEN" contentTypeId="DOCUMENT" 
dataResourceId="DRFA-001-O-ALTEN" localeString="en_US"/>
+    <ContentAssoc contentId="FA-100-ALT" contentIdTo="CFA-100-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="FA-001-ALT" contentIdTo="CFA-001-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="FA-001-30-ALT" contentIdTo="CFA-001-30-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="FA-001-50-ALT" contentIdTo="CFA-001-50-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="FA-001-O-ALT" contentIdTo="CFA-001-O-ALTEN" 
contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ProductCategoryContent prodCatContentTypeId="ALTERNATIVE_URL" 
productCategoryId="FA-100" contentId="FA-100-ALT" fromDate="2001-05-13 12:00:
00.0"/>
+    <ProductContent productId="FA-001" contentId="FA-001-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="FA-001-30" contentId="FA-001-30-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="FA-001-50" contentId="FA-001-50-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
+    <ProductContent productId="FA-001-O" contentId="FA-001-O-ALT" 
productContentTypeId="ALTERNATIVE_URL" fromDate="2001-05-13 12:00:00.0"/>
</entity-engine-xml>
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoPopularCategoriesData.
xml
URL: http://svn.apache.
org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoPopularCategoriesData.
xml?rev=1127449&r1=1127448&r2=1127449&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/data/DemoPopularCategoriesData.xml 
(original)
+++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoPopularCategoriesData.xml 
Wed May 25 09:25:16 2011
@@ -39,5 +39,18 @@ under the License.
  <ProductCategoryMember productCategoryId="BEST-SELL-2" productId="WG-9944" 
quantity="5" fromDate="2010-01-01 12:00:00.0"/>
  <ProductCategoryMember productCategoryId="BEST-SELL-2" productId="WG-1111" 
quantity="7" fromDate="2010-01-01 12:00:00.0"/>
  <ProductCategoryMember productCategoryId="BEST-SELL-2" productId="WG-5569" 
quantity="1" fromDate="2010-01-01 12:00:00.0"/>
-
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="BEST-
SELL-1-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DRBEST-
SELL-1-ALTEN" localeString="en_US"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="BEST-
SELL-2-ALT" localeString="en"/>
+    <DataResource dataResourceTypeId="ELECTRONIC_TEXT" dataResourceId="DRBEST-
SELL-2-ALTEN" localeString="en_US"/>
+    <ElectronicText dataResourceId="DRBEST-SELL-1-ALTEN" textData="best-sell-
1"/>
+    <ElectronicText dataResourceId="DRBEST-SELL-2-ALTEN" textData="best-sell-
2"/>
+    <Content contentTypeId="DOCUMENT" localeString="en" contentId="BEST-SELL-
1-ALT" dataResourceId="BEST-SELL-1-ALT"/>
+    <Content contentTypeId="DOCUMENT" localeString="en_US" contentId="CBEST-
SELL-1-ALTEN" dataResourceId="DRBEST-SELL-2-ALTEN"/>
+    <Content contentTypeId="DOCUMENT" localeString="en" contentId="BEST-SELL-
2-ALT" dataResourceId="BEST-SELL-2-ALT"/>
+    <Content contentTypeId="DOCUMENT" localeString="en_US" contentId="CBEST-
SELL-2-ALTEN" dataResourceId="DRBEST-SELL-2-ALTEN"/>
+    <ContentAssoc contentId="BEST-SELL-1-ALT" contentIdTo="CBEST-SELL-1-
ALTEN" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ContentAssoc contentId="BEST-SELL-2-ALT" contentIdTo="CBEST-SELL-2-
ALTEN" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2011-04-26 12:00:00.0"/>
+    <ProductCategoryContent prodCatContentTypeId="ALTERNATIVE_URL" 
productCategoryId="BEST-SELL-1" contentId="BEST-SELL-1-ALT" fromDate="2001-05-
13 12:00:00.0"/>
+    <ProductCategoryContent prodCatContentTypeId="ALTERNATIVE_URL" 
productCategoryId="BEST-SELL-2" contentId="BEST-SELL-2-ALT" fromDate="2001-05-
13 12:00:00.0"/>
</entity-engine-xml>