svn commit: r1141878 - in /ofbiz/trunk: applications/content/ applications/content/config/ applications/content/data/ applications/content/script/org/ofbiz/content/content/ applications/content/servicedef/ applications/content/src/org/ofbiz/content/con...

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

svn commit: r1141878 - in /ofbiz/trunk: applications/content/ applications/content/config/ applications/content/data/ applications/content/script/org/ofbiz/content/content/ applications/content/servicedef/ applications/content/src/org/ofbiz/content/con...

hansbak-2
Author: hansbak
Date: Fri Jul  1 09:03:32 2011
New Revision: 1141878

URL: http://svn.apache.org/viewvc?rev=1141878&view=rev
Log:
Add seo friendly url's for showing content. reorganize the same program snippets with seo friendly url for products. These content url's are demonstrated at the ecommerce frontend in the left bottom corner: Content Information

Added:
    ofbiz/trunk/applications/content/data/ContentScheduleServiceData.xml   (with props)
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java   (with props)
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java   (with props)
    ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java   (with props)
    ofbiz/trunk/specialpurpose/ecommerce/data/DemoContentAltUrl.xml   (with props)
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/content/content_topic.ftl   (with props)
Modified:
    ofbiz/trunk/applications/content/config/freemarkerTransforms.properties
    ofbiz/trunk/applications/content/data/ContentTypeData.xml
    ofbiz/trunk/applications/content/ofbiz-component.xml
    ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
    ofbiz/trunk/applications/content/servicedef/services.xml
    ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CatalogUrlFilter.java
    ofbiz/trunk/specialpurpose/ecommerce/config/EcommerceUiLabels.xml
    ofbiz/trunk/specialpurpose/ecommerce/ofbiz-component.xml
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/web.xml
    ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml
    ofbiz/trunk/specialpurpose/ecommerce/widget/ContentForms.xml
    ofbiz/trunk/specialpurpose/ecommerce/widget/ContentScreens.xml

Modified: ofbiz/trunk/applications/content/config/freemarkerTransforms.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/config/freemarkerTransforms.properties?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/config/freemarkerTransforms.properties (original)
+++ ofbiz/trunk/applications/content/config/freemarkerTransforms.properties Fri Jul  1 09:03:32 2011
@@ -36,3 +36,4 @@ renderSubContentAsText=org.ofbiz.content
 renderContentAsText=org.ofbiz.content.webapp.ftl.RenderContentAsText
 renderContent=org.ofbiz.content.webapp.ftl.RenderContentTransform
 renderContentAndSubContent=org.ofbiz.content.webapp.ftl.RenderContentAndSubContent
+OfbizContentAltUrl=org.ofbiz.content.webapp.ftl.OfbizContentAltUrlTransforms

Added: ofbiz/trunk/applications/content/data/ContentScheduleServiceData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/data/ContentScheduleServiceData.xml?rev=1141878&view=auto
==============================================================================
--- ofbiz/trunk/applications/content/data/ContentScheduleServiceData.xml (added)
+++ ofbiz/trunk/applications/content/data/ContentScheduleServiceData.xml Fri Jul  1 09:03:32 2011
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<entity-engine-xml>
+
+     <!-- Auto Create Content Alternative Urls Job -->
+    <RecurrenceRule recurrenceRuleId="CNT_ALT_URL" untilDateTime="" frequency="DAILY" intervalNumber="1" countNumber="-1"/>
+    <RecurrenceInfo recurrenceInfoId="CNT_ALT_URL" startDateTime="2011-06-23 01:01:01" recurrenceRuleId="CNT_ALT_URL" recurrenceCount="0"/>
+    
+    <!-- Set allowConvert in the map value is Y if want to create the content alternative Urls -->
+    <RuntimeData runtimeDataId="CNT_ALT_URL">
+        <runtimeInfo><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+            <ofbiz-ser>
+                <map-HashMap>
+                    <map-Entry>
+                        <map-Key>
+                            <std-String value="allowConvert"/>
+                        </map-Key>
+                        <map-Value>
+                            <std-String value="N"/>
+                        </map-Value>
+                    </map-Entry>
+                </map-HashMap>
+            </ofbiz-ser>
+        ]]></runtimeInfo>
+    </RuntimeData>
+    <JobSandbox jobId="CNT_URL_JOB" jobName="Auto Create Content Alternative Url" runTime="2011-06-23 01:01:01" serviceName="convertContentAltUrls" poolId="pool" runAsUser="system" recurrenceInfoId="CNT_ALT_URL" runtimeDataId="CNT_ALT_URL"/>
+
+</entity-engine-xml>

Propchange: ofbiz/trunk/applications/content/data/ContentScheduleServiceData.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/content/data/ContentScheduleServiceData.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/content/data/ContentScheduleServiceData.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/content/data/ContentTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/data/ContentTypeData.xml?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/data/ContentTypeData.xml (original)
+++ ofbiz/trunk/applications/content/data/ContentTypeData.xml Fri Jul  1 09:03:32 2011
@@ -50,6 +50,7 @@ under the License.
 
     <ContentAssocType contentAssocTypeId="COMPDOC_PART" description="Composite Document Part"/>
     <ContentAssocType contentAssocTypeId="INSTANCE" description="Instance Of"/>
+    <ContentAssocType contentAssocTypeId="ALTERNATIVE_URL" description="Alternative URL"/>
 
     <ContentAssocPredicate contentAssocPredicateId="member-of" description="The object is a member of the subject."/>
     <ContentAssocPredicate contentAssocPredicateId="defines" description="The object defines the subject."/>

Modified: ofbiz/trunk/applications/content/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/ofbiz-component.xml?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/ofbiz-component.xml (original)
+++ ofbiz/trunk/applications/content/ofbiz-component.xml Fri Jul  1 09:03:32 2011
@@ -46,6 +46,7 @@ under the License.
     <entity-resource type="data" reader-name="seed" loader="main" location="data/WebtoolsHelpData.xml"/>
     <entity-resource type="data" reader-name="seed" loader="main" location="data/ExampleHelpData.xml"/>
     <entity-resource type="data" reader-name="seed" loader="main" location="data/BirtHelpData.xml"/>
+    <entity-resource type="data" reader-name="seed" loader="main" location="data/ContentScheduleServiceData.xml"/>
 
     <entity-resource type="data" reader-name="demo" loader="main" location="data/UsersDemoData.xml"/>
     <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoBlogPubPtData.xml"/>

Modified: ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml (original)
+++ ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml Fri Jul  1 09:03:32 2011
@@ -1277,4 +1277,76 @@
         </call-class-method>
     </simple-method>
 
+    <simple-method method-name="convertContentAltUrls" short-description="Convert Content Alternative URLs.">
+        <if-compare operator="equals" value="Y" field="parameters.allowConvert">
+            <entity-condition list="contents" entity-name="Content">
+                <condition-expr field-name="contentName" operator="not-equals" from-field="nullField"/>
+                <select-field field-name="contentId"/>
+                <select-field field-name="contentName"/>
+            </entity-condition>
+            <iterate entry="content" list="contents">
+                <set field="updateObjectInfo"/>
+                <entity-condition list="contentAssocDataResources" entity-name="ContentAssocDataResourceViewTo">
+                    <condition-list combine="and">
+                        <condition-expr field-name="caContentAssocTypeId" operator="equals" value="ALTERNATIVE_URL"/>
+                        <condition-expr field-name="contentIdStart" operator="equals" from-field="content.contentId"/>
+                    </condition-list>
+                    <select-field field-name="contentIdStart"/>
+                    <select-field field-name="dataResourceId"/>
+                    <select-field field-name="caFromDate"/>
+                    <select-field field-name="caThruDate"/>
+                </entity-condition>
+                <filter-list-by-date list="contentAssocDataResources" from-field-name="caFromDate" thru-field-name="caThruDate"/>
+                <if-not-empty field="contentAssocDataResources">
+                    <first-from-list entry="contentAssocDataResource" list="contentAssocDataResources"/>
+                    <entity-one value-field="electronicText" entity-name="ElectronicText">
+                        <field-map field-name="dataResourceId" from-field="contentAssocDataResource.dataResourceId"/>
+                    </entity-one>
+                    <if-compare-field operator="not-equals" field="electronicText.textData" to-field="content.contentName" type="String">
+                        <call-class-method method-name="invalidCharacter" class-name="org.ofbiz.common.UrlServletHelper" ret-field="altUrl">
+                            <field field="content.contentName"/>
+                        </call-class-method>
+                        <set field="altUrl" value="/${altUrl}-${contentAssocDataResources.contentIdStart}-content"/>
+                        <set field="updateDataResourceCtx.dataResourceId" from-field="contentAssocDataResource.dataResourceId"/>
+                        <set field="updateDataResourceCtx.objectInfo" from-field="altUrl"/>
+                        <call-service service-name="updateDataResource" in-map-name="updateDataResourceCtx" include-user-login="true"/>
+                        
+                        <set field="electronicTextCtx.dataResourceId" from-field="contentAssocDataResource.dataResourceId"/>
+                        <set field="electronicTextCtx.textData" from-field="content.contentName"/>
+                        <call-service service-name="updateElectronicText" in-map-name="electronicTextCtx"></call-service>
+                        
+                    </if-compare-field>
+                    <else>
+                        <call-class-method method-name="invalidCharacter" class-name="org.ofbiz.common.UrlServletHelper" ret-field="altUrl">
+                            <field field="content.contentName"/>
+                        </call-class-method>
+                        <set field="altUrl" value="/${altUrl}-${content.contentId}-content"/>
+                        <sequenced-id sequence-name="DataResource" field="createDataResourceCtx.dataResourceId"/>
+                        <set field="createDataResourceCtx.dataResourceTypeId" value="ELECTRONIC_TEXT"/>
+                        <set field="createDataResourceCtx.dataTemplateTypeId" value="FTL"/>
+                        <set field="createDataResourceCtx.objectInfo" from-field="altUrl"/>
+                        <set field="createDataResourceCtx.statusId" value="CTNT_IN_PROGRESS"/>
+                        <call-service service-name="createDataResource" in-map-name="createDataResourceCtx" include-user-login="true">
+                            <result-to-field result-name="dataResourceId" field="dataResourceId"/>
+                        </call-service>
+                        <set field="electronicTextCtx.dataResourceId" from-field="dataResourceId"/>
+                        <set field="electronicTextCtx.textData" from-field="content.contentName"/>
+                        <call-service service-name="createElectronicText" in-map-name="electronicTextCtx"></call-service>
+                        
+                        <sequenced-id sequence-name="Content" field="contentCtx.contentId"/>
+                        <set field="contentCtx.contentTypeId" value="DOCUMENT"/>
+                        <set field="contentCtx.dataResourceId" from-field="dataResourceId"/>
+                        <call-service service-name="createContent" in-map-name="contentCtx" include-user-login="true">
+                            <result-to-field result-name="contentId" field="contentIdTo"/>
+                        </call-service>
+                        
+                        <set field="createContentAssocCtx.contentId" from-field="content.contentId"/>
+                        <set field="createContentAssocCtx.contentIdTo" from-field="contentIdTo"/>
+                        <set field="createContentAssocCtx.contentAssocTypeId" value="ALTERNATIVE_URL"/>
+                        <call-service service-name="createContentAssoc" in-map-name="createContentAssocCtx"/>
+                    </else>
+                </if-not-empty>
+            </iterate>
+        </if-compare>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/content/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services.xml?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services.xml Fri Jul  1 09:03:32 2011
@@ -1197,4 +1197,11 @@
         <permission-service service-name="genericContentPermission" main-action="CREATE"/>
         <attribute name="contentId" type="String" mode="IN" optional="false"/>
     </service>
+    
+    <!-- Convert Content Alternative Urls -->
+    <service name="convertContentAltUrls" engine="simple"
+            location="component://content/script/org/ofbiz/content/content/ContentServices.xml" invoke="convertContentAltUrls" auth="true">
+        <description>Convert Content Alternative URL</description>
+        <attribute name="allowConvert" mode="IN" type="String" optional="false"></attribute>
+    </service>
 </services>

Added: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java?rev=1141878&view=auto
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java (added)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java Fri Jul  1 09:03:32 2011
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+
+package org.ofbiz.content.content;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Set;
+
+import javax.servlet.FilterChain;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import javolution.util.FastList;
+
+import org.ofbiz.base.util.StringUtil;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityCondition;
+import org.ofbiz.entity.condition.EntityOperator;
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.webapp.control.ContextFilter;
+import org.ofbiz.common.UrlServletHelper;
+
+public class ContentUrlFilter extends ContextFilter {
+    public final static String module = ContentUrlFilter.class.getName();
+    
+    public static final String CONTROL_MOUNT_POINT = "control";
+    protected static String defaultLocaleString = null;
+    protected static String redirectUrl = null;
+    public static String defaultViewRequest = "contentViewInfo";
+    
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)  throws IOException, ServletException {
+        HttpServletRequest httpRequest = (HttpServletRequest) request;
+        HttpServletResponse httpResponse = (HttpServletResponse) response;
+        Delegator delegator = (Delegator) httpRequest.getSession().getServletContext().getAttribute("delegator");
+        
+        //Get ServletContext
+        ServletContext servletContext = config.getServletContext();
+        
+        //Set request attribute and session
+        UrlServletHelper.setRequestAttributes(request, delegator, servletContext);
+        String urlContentId = null;
+        String pathInfo = httpRequest.getServletPath();
+        if (UtilValidate.isNotEmpty(pathInfo)) {
+            List<String> paths = StringUtil.split(pathInfo, "/");
+            String alternativeUrl = paths.get(0);
+            
+            if (alternativeUrl.endsWith("-content")) {
+                try {
+                    List<EntityCondition> expr = FastList.newInstance();
+                    expr.add(EntityCondition.makeCondition("caContentAssocTypeId", EntityOperator.EQUALS, "ALTERNATIVE_URL"));
+                    expr.add(EntityCondition.makeCondition("caThruDate", EntityOperator.EQUALS, null));
+                    Set<String> fieldsToSelect = UtilMisc.toSet("contentIdStart", "dataResourceId", "caFromDate", "caThruDate", "caCreatedDate");
+                    List<GenericValue> contentAssocDataResources = delegator.findList("ContentAssocDataResourceViewTo", EntityCondition.makeCondition(expr), fieldsToSelect, UtilMisc.toList("-caCreatedDate"), null, true);
+                    for (GenericValue contentAssocDateResource : contentAssocDataResources) {
+                        GenericValue electronicText = delegator.findByPrimaryKey("ElectronicText", UtilMisc.toMap("dataResourceId", contentAssocDateResource.getString("dataResourceId")));
+                        if (UtilValidate.isEmpty(electronicText) || UtilValidate.isEmpty(electronicText.get("textData"))) {
+                            continue;
+                        }
+                        if (alternativeUrl.equalsIgnoreCase(UrlServletHelper.invalidCharacter(electronicText.getString("textData")) + "-" + contentAssocDateResource.getString("contentIdStart") + "-content")) {
+                            urlContentId = contentAssocDateResource.getString("contentIdStart");
+                            break;
+                        }
+                    }
+                } catch (Exception e) {
+                    
+                }
+            }
+            if (UtilValidate.isNotEmpty(urlContentId)) {
+                StringBuilder urlBuilder = new StringBuilder();
+                urlBuilder.append("/" + CONTROL_MOUNT_POINT);
+                urlBuilder.append("/" + config.getInitParameter("viewRequest") + "?contentId=" + urlContentId);
+                
+                //Set view query parameters
+                UrlServletHelper.setViewQueryParameters(request, urlBuilder);
+                Debug.logInfo("[Filtered request]: " + pathInfo + " (" + urlBuilder + ")", module);
+                RequestDispatcher dispatch = request.getRequestDispatcher(urlBuilder.toString());
+                dispatch.forward(request, response);
+                return;
+            }
+            
+            //Check path alias
+            UrlServletHelper.checkPathAlias(request, httpResponse, delegator, pathInfo);
+        }
+        // we're done checking; continue on
+        chain.doFilter(request, response);
+    }
+    
+    public static String makeContentAltUrl(HttpServletRequest request, HttpServletResponse response, String contentId, String viewContent) {
+        if (UtilValidate.isEmpty(contentId)) {
+            return null;
+        }
+        Delegator delegator = (Delegator) request.getAttribute("delegator");
+        
+        String url = null;
+        try {
+            List<EntityCondition> expr = FastList.newInstance();
+            expr.add(EntityCondition.makeCondition("caContentAssocTypeId", EntityOperator.EQUALS, "ALTERNATIVE_URL"));
+            expr.add(EntityCondition.makeCondition("caThruDate", EntityOperator.EQUALS, null));
+            expr.add(EntityCondition.makeCondition("contentIdStart", EntityOperator.EQUALS, contentId));
+            Set<String> fieldsToSelect = UtilMisc.toSet("contentIdStart", "dataResourceId", "caFromDate", "caThruDate", "caCreatedDate");
+            List<GenericValue> contentAssocDataResources = delegator.findList("ContentAssocDataResourceViewTo", EntityCondition.makeCondition(expr), fieldsToSelect, UtilMisc.toList("-caCreatedDate"), null, true);
+            if (contentAssocDataResources.size() > 0) {
+                GenericValue contentAssocDataResource = EntityUtil.getFirst(contentAssocDataResources);
+                GenericValue electronicText = delegator.findByPrimaryKey("ElectronicText", UtilMisc.toMap("dataResourceId", contentAssocDataResource.get("dataResourceId")));
+                if (UtilValidate.isNotEmpty(electronicText) || UtilValidate.isNotEmpty(electronicText.get("textData"))) {
+                    String textData = UrlServletHelper.invalidCharacter(electronicText.getString("textData")) + "-" + contentId + "-content";
+                    StringBuilder urlBuilder = new StringBuilder();
+                    urlBuilder.append(request.getSession().getServletContext().getContextPath());
+                    if (urlBuilder.charAt(urlBuilder.length() - 1) != '/') {
+                        urlBuilder.append("/");
+                    }
+                    url = urlBuilder.append(textData).toString();
+                }
+            }
+        } catch (Exception e) {
+            Debug.logWarning("[Exception] : " + e.getMessage(), module);
+        }
+        
+        if (UtilValidate.isEmpty(url)) {
+            if (UtilValidate.isEmpty(viewContent)) {
+                viewContent = defaultViewRequest;
+            }
+            url = makeContentUrl(request, response, contentId, viewContent);
+        }
+        return url;
+    }
+    
+    public static String makeContentUrl(HttpServletRequest request, HttpServletResponse response, String contentId, String viewContent) {
+        if (UtilValidate.isEmpty(contentId)) {
+            return null;
+        }
+        StringBuilder urlBuilder = new StringBuilder();
+        urlBuilder.append(request.getSession().getServletContext().getContextPath());
+        if (urlBuilder.charAt(urlBuilder.length() - 1) != '/') {
+            urlBuilder.append("/");
+        }
+        urlBuilder.append(CONTROL_MOUNT_POINT);
+        
+        if (UtilValidate.isNotEmpty(viewContent)) {
+            urlBuilder.append("/" + viewContent);
+        } else {
+            urlBuilder.append("/" + defaultViewRequest);
+        }
+        urlBuilder.append("?contentId=" + contentId);
+        return urlBuilder.toString();
+    }
+}

Propchange: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentUrlFilter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java?rev=1141878&view=auto
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java (added)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java Fri Jul  1 09:03:32 2011
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+
+package org.ofbiz.content.webapp.ftl;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.content.content.ContentUrlFilter;
+
+import freemarker.core.Environment;
+import freemarker.ext.beans.BeanModel;
+import freemarker.ext.beans.NumberModel;
+import freemarker.ext.beans.StringModel;
+import freemarker.template.SimpleNumber;
+import freemarker.template.SimpleScalar;
+import freemarker.template.TemplateModelException;
+import freemarker.template.TemplateTransformModel;
+
+public class OfbizContentAltUrlTransforms implements TemplateTransformModel {
+    public final static String module = OfbizContentAltUrlTransforms.class.getName();
+    @SuppressWarnings("unchecked")
+    public String getStringArg(Map args, String key) {
+        Object o = args.get(key);
+        if (o instanceof SimpleScalar) {
+            return ((SimpleScalar) o).getAsString();
+        } else if (o instanceof StringModel) {
+            return ((StringModel) o).getAsString();
+        } else if (o instanceof SimpleNumber) {
+            return ((SimpleNumber) o).getAsNumber().toString();
+        } else if (o instanceof NumberModel) {
+            return ((NumberModel) o).getAsNumber().toString();
+        }
+        return null;
+    }
+    
+    @Override
+    @SuppressWarnings("unchecked")
+    public Writer getWriter(final Writer out, final Map args)
+            throws TemplateModelException, IOException {
+        final StringBuilder buf = new StringBuilder();
+        return new Writer(out) {
+            
+            public void write(char[] cbuf, int off, int len) throws IOException {
+                buf.append(cbuf, off, len);
+            }
+            
+            public void flush() throws IOException {
+                out.flush();
+            }
+            
+            public void close() throws IOException {
+                try {
+                    Environment env = Environment.getCurrentEnvironment();
+                    BeanModel req = (BeanModel) env.getVariable("request");
+                    BeanModel res = (BeanModel) env.getVariable("response");
+                    if (req != null) {
+                        String contentId = getStringArg(args, "contentId");
+                        String viewContent = getStringArg(args, "viewContent");
+                        HttpServletRequest request = (HttpServletRequest) req.getWrappedObject();
+                        HttpServletResponse response = null;
+                        if (res != null) {
+                            response = (HttpServletResponse) res.getWrappedObject();
+                        }
+                        String url = "";
+                        if (UtilValidate.isNotEmpty(contentId)) {
+                            url = ContentUrlFilter.makeContentAltUrl(request, response, contentId, viewContent);
+                        }
+                        out.write(url);
+                    }
+                } catch (TemplateModelException e) {
+                    throw new IOException(e.getMessage());
+                }
+            }
+        };
+    }
+}

Propchange: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=1141878&r1=1141877&r2=1141878&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 Fri Jul  1 09:03:32 2011
@@ -24,6 +24,7 @@ import java.util.List;
 
 import javax.servlet.FilterChain;
 import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
@@ -34,19 +35,17 @@ import javolution.util.FastList;
 
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.StringUtil;
-import org.ofbiz.base.util.StringUtil.StringWrapper;
 import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.base.util.StringUtil.StringWrapper;
+import org.ofbiz.common.UrlServletHelper;
 import org.ofbiz.entity.Delegator;
-import org.ofbiz.entity.DelegatorFactory;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.product.product.ProductContentWrapper;
 import org.ofbiz.webapp.control.ContextFilter;
-import org.ofbiz.webapp.website.WebSiteWorker;
 
 public class CatalogUrlFilter extends ContextFilter {
 
@@ -64,42 +63,12 @@ public class CatalogUrlFilter extends Co
         HttpServletRequest httpRequest = (HttpServletRequest) request;
         HttpServletResponse httpResponse = (HttpServletResponse) response;
         Delegator delegator = (Delegator) httpRequest.getSession().getServletContext().getAttribute("delegator");
-
-        // check if multi tenant is enabled
-        String useMultitenant = UtilProperties.getPropertyValue("general.properties", "multitenant");
-        if ("Y".equals(useMultitenant)) {
-            // get tenant delegator by domain name
-            String serverName = request.getServerName();
-            try {
-                // if tenant was specified, replace delegator with the new per-tenant delegator and set tenantId to session attribute
-                delegator = getDelegator(config.getServletContext());
-                List<GenericValue> tenants = delegator.findList("Tenant", EntityCondition.makeCondition("domainName", serverName), null, UtilMisc.toList("-createdStamp"), null, false);
-                if (UtilValidate.isNotEmpty(tenants)) {
-                    GenericValue tenant = EntityUtil.getFirst(tenants);
-                    String tenantId = tenant.getString("tenantId");
-                    
-                    // make that tenant active, setup a new delegator and a new dispatcher
-                    String tenantDelegatorName = delegator.getDelegatorBaseName() + "#" + tenantId;
-                    httpRequest.getSession().setAttribute("delegatorName", tenantDelegatorName);
-                
-                    // after this line the delegator is replaced with the new per-tenant delegator
-                    delegator = DelegatorFactory.getDelegator(tenantDelegatorName);
-                    config.getServletContext().setAttribute("delegator", delegator);
-                }
-                
-            } catch (GenericEntityException e) {
-                Debug.logWarning(e, "Unable to get Tenant", module);
-            }
-        }
-
-        // set the web context in the request for future use
-        request.setAttribute("servletContext", httpRequest.getSession().getServletContext());
-        request.setAttribute("delegator", delegator);
-
-        // set the webSiteId in the session
-        if (UtilValidate.isEmpty(httpRequest.getSession().getAttribute("webSiteId"))){
-            httpRequest.getSession().setAttribute("webSiteId", httpRequest.getSession().getServletContext().getAttribute("webSiteId"));
-        }
+        
+        //Get ServletContext
+        ServletContext servletContext = config.getServletContext();
+        
+        //Set request attribute and session
+        UrlServletHelper.setRequestAttributes(request, delegator, servletContext);
         
         // set initial parameters
         String initDefaultLocalesString = config.getInitParameter("defaultLocaleString");
@@ -111,67 +80,10 @@ public class CatalogUrlFilter extends Co
         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);
-            GenericValue webSite;
-            try {
-                webSite = delegator.findOne("WebSite", UtilMisc.toMap("webSiteId", webSiteId), true);
-                if (UtilValidate.isNotEmpty(webSite)) {
-                    GenericValue productStore = webSite.getRelatedOne("ProductStore");
-                    if (UtilValidate.isNotEmpty(productStore)) {
-                        localeString = productStore.getString("defaultLocaleString");
-                    }
-                } else {
-                    localeString = defaultLocaleString;
-                }
-            } catch (GenericEntityException ex) {
-                Debug.logWarning(ex, module);
-            }
-            
-            // get view index, view size and view sort from path info
-            String viewIndex = null;
-            String viewSize = null;
-            String viewSort = null;
-            String searchString = null;
             
-            int queryStringIndex = pathInfo.indexOf("?");
-            if (queryStringIndex >= 0) {
-                List<String> queryStringTokens = StringUtil.split(pathInfo.substring(queryStringIndex + 1), "&");
-                for (String queryStringToken : queryStringTokens) {
-                    int equalIndex = queryStringToken.indexOf("=");
-                    String name = queryStringToken.substring(0, equalIndex - 1);
-                    String value = queryStringToken.substring(equalIndex + 1, queryStringToken.length() - 1);
-                    
-                    if ("viewIndex".equals(name)) {
-                        viewIndex = value;
-                    } else if ("viewSize".equals(name)) {
-                        viewSize = value;
-                    } else if ("viewSort".equals(name)) {
-                        viewSort = value;
-                    } else if ("searchString".equals(name)) {
-                        searchString = value;
-                    }
-                }
-            }
-            
-            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;
-            
+            String urlContentId = null;
             try {
                 // look for productId
                 if (alternativeUrl.endsWith("-p")) {
@@ -188,7 +100,7 @@ public class CatalogUrlFilter extends Co
                                     GenericValue ElectronicText = ContentAssocDataResourceViewTo.getRelatedOneCache("ElectronicText");
                                     if (UtilValidate.isNotEmpty(ElectronicText)) {
                                         String textData = (String) ElectronicText.get("textData");
-                                        textData = invalidCharacter(textData);
+                                        textData = UrlServletHelper.invalidCharacter(textData);
                                         if (alternativeUrl.matches(textData + ".+$")) {
                                             String productIdStr = null;
                                             productIdStr = alternativeUrl.replace(textData + "-", "");
@@ -209,7 +121,7 @@ public class CatalogUrlFilter extends Co
                                     if (UtilValidate.isNotEmpty(ElectronicText)) {
                                         String textData = (String) ElectronicText.get("textData");
                                         if (UtilValidate.isNotEmpty(textData)) {
-                                            textData = invalidCharacter(textData);
+                                            textData = UrlServletHelper.invalidCharacter(textData);
                                             if (alternativeUrl.matches(textData + ".+$")) {
                                                 String productIdStr = null;
                                                 productIdStr = alternativeUrl.replace(textData + "-", "");
@@ -244,7 +156,7 @@ public class CatalogUrlFilter extends Co
                                     if (UtilValidate.isNotEmpty(ElectronicText)){
                                         String textData = (String) ElectronicText.get("textData");
                                         if (UtilValidate.isNotEmpty(textData)) {
-                                            textData = invalidCharacter(textData);
+                                            textData = UrlServletHelper.invalidCharacter(textData);
                                             if (alternativeUrl.matches(textData + ".+$")) {
                                                 String productCategoryStr = null;
                                                 productCategoryStr = alternativeUrl.replace(textData + "-", "");
@@ -266,7 +178,7 @@ public class CatalogUrlFilter extends Co
                                     if (UtilValidate.isNotEmpty(ElectronicText)) {
                                         String textData = (String) ElectronicText.get("textData");
                                         if (UtilValidate.isNotEmpty(textData)) {
-                                            textData = invalidCharacter(textData);
+                                            textData = UrlServletHelper.invalidCharacter(textData);
                                             if (alternativeUrl.matches(textData + ".+$")) {
                                                 String productCategoryStr = null;
                                                 productCategoryStr = alternativeUrl.replace(textData + "-", "");
@@ -284,6 +196,7 @@ public class CatalogUrlFilter extends Co
                         }
                     }
                 }
+
             } catch (GenericEntityException e) {
                 Debug.logWarning("Cannot look for product and product category", module);
             }
@@ -398,23 +311,6 @@ public class CatalogUrlFilter extends Co
                     CategoryWorker.setTrail(request, trail);
                 }
 
-                if(UtilValidate.isNotEmpty(viewIndex)){
-                    urlBuilder.append("/~VIEW_INDEX=" + viewIndex);
-                    request.setAttribute("VIEW_INDEX", viewIndex);
-                }
-                if(UtilValidate.isNotEmpty(viewSize)){
-                    urlBuilder.append("/~VIEW_SIZE=" + viewSize);
-                    request.setAttribute("VIEW_SIZE", viewSize);
-                }
-                if(UtilValidate.isNotEmpty(viewSort)){
-                    urlBuilder.append("/~VIEW_SORT=" + viewSort);
-                    request.setAttribute("VIEW_SORT", viewSort);
-                }
-                if(UtilValidate.isNotEmpty(searchString)){
-                    urlBuilder.append("/~SEARCH_STRING=" + searchString);
-                    request.setAttribute("SEARCH_STRING", searchString);
-                }
-
                 request.setAttribute("productCategoryId", productCategoryId);
                 
                 if (productId != null) {
@@ -423,50 +319,17 @@ public class CatalogUrlFilter extends Co
                 }
             }
             
-            if (UtilValidate.isNotEmpty(productId) || UtilValidate.isNotEmpty(productCategoryId)) {
+            //Set view query parameters
+            UrlServletHelper.setViewQueryParameters(request, urlBuilder);
+            if (UtilValidate.isNotEmpty(productId) || UtilValidate.isNotEmpty(productCategoryId) || UtilValidate.isNotEmpty(urlContentId)) {
                 Debug.logInfo("[Filtered request]: " + pathInfo + " (" + urlBuilder + ")", module);
                 RequestDispatcher dispatch = request.getRequestDispatcher(urlBuilder.toString());
                 dispatch.forward(request, response);
                 return;
             }
-
-            // check path alias
-            GenericValue pathAlias = null;
-            try {
-                pathAlias = delegator.findByPrimaryKeyCache("WebSitePathAlias", UtilMisc.toMap("webSiteId", webSiteId, "pathAlias", pathInfo));
-            } catch (GenericEntityException e) {
-                Debug.logError(e, module);
-            }
-            if (pathAlias != null) {
-                String alias = pathAlias.getString("aliasTo");
-                String contentId = pathAlias.getString("contentId");
-                if (contentId == null && UtilValidate.isNotEmpty(alias)) {
-                    if (!alias.startsWith("/")) {
-                       alias = "/" + alias;
-                    }
-
-                    RequestDispatcher rd = request.getRequestDispatcher(alias);
-                    try {
-                        rd.forward(request, response);
-                        return;
-                    } catch (ServletException e) {
-                        Debug.logWarning(e, module);
-                    } catch (IOException e) {
-                        Debug.logWarning(e, module);
-                    }
-                }
-            } else {
-                // send 404 error if a URI is alias TO
-                try {
-                    List<GenericValue> aliasTos = delegator.findByAndCache("WebSitePathAlias", UtilMisc.toMap("webSiteId", webSiteId, "aliasTo", httpRequest.getRequestURI()));
-                    if (UtilValidate.isNotEmpty(aliasTos)) {
-                        httpResponse.sendError(HttpServletResponse.SC_NOT_FOUND, "Not Found");
-                        return;
-                    }
-                } catch (GenericEntityException e) {
-                    Debug.logError(e, module);
-                }
-            }
+            
+            //Check path alias
+            UrlServletHelper.checkPathAlias(request, httpResponse, delegator, pathInfo);
         }
         
         // we're done checking; continue on
@@ -488,7 +351,7 @@ public class CatalogUrlFilter extends Co
                     urlBuilder.append("/");
                 }
                 // append alternative URL
-                url = invalidCharacter(alternativeUrl.toString());
+                url = UrlServletHelper.invalidCharacter(alternativeUrl.toString());
                 urlBuilder.append(url);
                 if (UtilValidate.isNotEmpty(productCategoryId)) {
                     urlBuilder.append("-");
@@ -551,7 +414,7 @@ public class CatalogUrlFilter extends Co
                     urlBuilder.append("/");
                 }
                 // append alternative URL
-                url = invalidCharacter(alternativeUrl.toString());
+                url = UrlServletHelper.invalidCharacter(alternativeUrl.toString());
                 urlBuilder.append(url);
                 if (UtilValidate.isNotEmpty(productId)) {
                     urlBuilder.append("-");
@@ -568,81 +431,4 @@ public class CatalogUrlFilter extends Co
         }
     }
     
-    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;
-    }
 }

Added: ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java?rev=1141878&view=auto
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java (added)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java Fri Jul  1 09:03:32 2011
@@ -0,0 +1,275 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.common;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.StringUtil;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.DelegatorFactory;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityCondition;
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.webapp.control.ContextFilter;
+import org.ofbiz.webapp.website.WebSiteWorker;
+
+public class UrlServletHelper extends ContextFilter {
+    
+    public final static String module = UrlServletHelper.class.getName();
+    
+    public static void setRequestAttributes(ServletRequest request, Delegator delegator, ServletContext servletContext) {
+        HttpServletRequest httpRequest = (HttpServletRequest) request;
+        // check if multi tenant is enabled
+        String useMultitenant = UtilProperties.getPropertyValue("general.properties", "multitenant");
+        if ("Y".equals(useMultitenant)) {
+            // get tenant delegator by domain name
+            String serverName = request.getServerName();
+            try {
+            
+                // if tenant was specified, replace delegator with the new per-tenant delegator and set tenantId to session attribute
+                delegator = getDelegator(servletContext);
+                List<GenericValue> tenants = delegator.findList("Tenant", EntityCondition.makeCondition("domainName", serverName), null, UtilMisc.toList("-createdStamp"), null, false);
+                if (UtilValidate.isNotEmpty(tenants)) {
+                    GenericValue tenant = EntityUtil.getFirst(tenants);
+                    String tenantId = tenant.getString("tenantId");
+                    
+                    // make that tenant active, setup a new delegator and a new dispatcher
+                    String tenantDelegatorName = delegator.getDelegatorBaseName() + "#" + tenantId;
+                    httpRequest.getSession().setAttribute("delegatorName", tenantDelegatorName);
+                
+                    // after this line the delegator is replaced with the new per-tenant delegator
+                    delegator = DelegatorFactory.getDelegator(tenantDelegatorName);
+                    servletContext.setAttribute("delegator", delegator);
+                }
+                
+            } catch (GenericEntityException e) {
+                Debug.logWarning(e, "Unable to get Tenant", module);
+            }
+        }
+
+        // set the web context in the request for future use
+        request.setAttribute("servletContext", httpRequest.getSession().getServletContext());
+        request.setAttribute("delegator", delegator);
+
+        // set the webSiteId in the session
+        if (UtilValidate.isEmpty(httpRequest.getSession().getAttribute("webSiteId"))){
+            httpRequest.getSession().setAttribute("webSiteId", httpRequest.getSession().getServletContext().getAttribute("webSiteId"));
+        }
+    }
+    
+    public static void setViewQueryParameters(ServletRequest request, StringBuilder urlBuilder) {
+        HttpServletRequest httpRequest = (HttpServletRequest) request;
+        if (UtilValidate.isEmpty(httpRequest.getServletPath())) {
+            return;
+        }
+        String pathInfo = httpRequest.getServletPath();
+        String viewIndex = null;
+        String viewSize = null;
+        String viewSort = null;
+        String searchString = null;
+        
+        int queryStringIndex = pathInfo.indexOf("?");
+        if (queryStringIndex >= 0) {
+            List<String> queryStringTokens = StringUtil.split(pathInfo.substring(queryStringIndex + 1), "&");
+            for (String queryStringToken : queryStringTokens) {
+                int equalIndex = queryStringToken.indexOf("=");
+                String name = queryStringToken.substring(0, equalIndex - 1);
+                String value = queryStringToken.substring(equalIndex + 1, queryStringToken.length() - 1);
+                
+                if ("viewIndex".equals(name)) {
+                    viewIndex = value;
+                } else if ("viewSize".equals(name)) {
+                    viewSize = value;
+                } else if ("viewSort".equals(name)) {
+                    viewSort = value;
+                } else if ("searchString".equals(name)) {
+                    searchString = value;
+                }
+            }
+        }
+        
+        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");
+        }
+        
+        //Set query string parameters to url
+        if(UtilValidate.isNotEmpty(viewIndex)){
+            urlBuilder.append("/~VIEW_INDEX=" + viewIndex);
+            request.setAttribute("VIEW_INDEX", viewIndex);
+        }
+        if(UtilValidate.isNotEmpty(viewSize)){
+            urlBuilder.append("/~VIEW_SIZE=" + viewSize);
+            request.setAttribute("VIEW_SIZE", viewSize);
+        }
+        if(UtilValidate.isNotEmpty(viewSort)){
+            urlBuilder.append("/~VIEW_SORT=" + viewSort);
+            request.setAttribute("VIEW_SORT", viewSort);
+        }
+        if(UtilValidate.isNotEmpty(searchString)){
+            urlBuilder.append("/~SEARCH_STRING=" + searchString);
+            request.setAttribute("SEARCH_STRING", searchString);
+        }
+    }
+    public static void checkPathAlias(ServletRequest request, ServletResponse response, Delegator delegator, String pathInfo) {
+        HttpServletRequest httpRequest = (HttpServletRequest) request;
+        HttpServletResponse httpResponse = (HttpServletResponse) response;
+        String webSiteId = WebSiteWorker.getWebSiteId(request);
+        // check path alias
+        GenericValue pathAlias = null;
+        try {
+            pathAlias = delegator.findByPrimaryKeyCache("WebSitePathAlias", UtilMisc.toMap("webSiteId", webSiteId, "pathAlias", pathInfo));
+        } catch (GenericEntityException e) {
+            Debug.logError(e, module);
+        }
+        if (pathAlias != null) {
+            String alias = pathAlias.getString("aliasTo");
+            String contentId = pathAlias.getString("contentId");
+            if (contentId == null && UtilValidate.isNotEmpty(alias)) {
+                if (!alias.startsWith("/")) {
+                   alias = "/" + alias;
+                }
+
+                RequestDispatcher rd = request.getRequestDispatcher(alias);
+                try {
+                    rd.forward(request, response);
+                    return;
+                } catch (ServletException e) {
+                    Debug.logWarning(e, module);
+                } catch (IOException e) {
+                    Debug.logWarning(e, module);
+                }
+            }
+        } else {
+            // send 404 error if a URI is alias TO
+            try {
+                List<GenericValue> aliasTos = delegator.findByAndCache("WebSitePathAlias", UtilMisc.toMap("webSiteId", webSiteId, "aliasTo", httpRequest.getRequestURI()));
+                if (UtilValidate.isNotEmpty(aliasTos)) {
+                    httpResponse.sendError(HttpServletResponse.SC_NOT_FOUND, "Not Found");
+                    return;
+                }
+            } catch (GenericEntityException e) {
+                Debug.logError(e, module);
+            } catch (IOException e) {
+                Debug.logError(e, module);
+            }
+        }
+    }
+    
+    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;
+    }
+}
+

Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/specialpurpose/ecommerce/config/EcommerceUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/config/EcommerceUiLabels.xml?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/config/EcommerceUiLabels.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/config/EcommerceUiLabels.xml Fri Jul  1 09:03:32 2011
@@ -1557,6 +1557,9 @@
         <value xml:lang="zh">明细来自购物清单;从列表页更新数量</value>
         <value xml:lang="zh_TW">明細來自購物清單; 從列表頁更新數量</value>
     </property>
+    <property key="EcommerceLanguage">
+        <value xml:lang="en">Language</value>
+    </property>
     <property key="EcommerceLastCategories">
         <value xml:lang="cs">Poslední kategorie</value>
         <value xml:lang="da">Seneste kategorier</value>
@@ -1947,6 +1950,9 @@
         <value xml:lang="zh">请选择送货方法</value>
         <value xml:lang="zh_TW">請選擇送貨方法</value>
     </property>
+    <property key="EcommerceModifyDate">
+        <value xml:lang="en">Modified Date</value>
+    </property>
     <property key="EcommerceMonths">
         <value xml:lang="da">MÃ¥neder</value>
         <value xml:lang="de">Monate</value>
@@ -2400,6 +2406,9 @@
         <value xml:lang="zh">订单没有激活</value>
         <value xml:lang="zh_TW">訂單沒有啟動</value>
     </property>
+    <property key="EcommerceOwner">
+        <value xml:lang="en">Owner</value>
+    </property>
     <property key="EcommerceOwningDepartment">
         <value xml:lang="da">Ejende afdeling</value>
         <value xml:lang="de">Besitzende Abteilung</value>

Added: ofbiz/trunk/specialpurpose/ecommerce/data/DemoContentAltUrl.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoContentAltUrl.xml?rev=1141878&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/data/DemoContentAltUrl.xml (added)
+++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoContentAltUrl.xml Fri Jul  1 09:03:32 2011
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<entity-engine-xml>
+    
+    <!-- Demo Content Alternative Url -->
+    <!-- The content alternative url come from the contentName in the Content entity.-->
+    <!-- Can use convertContentAltUrls service job to create all content alternative url if the contentName is exist. -->
+    <DataResource dataResourceId="DRS_ALT_URL" dataResourceTypeId="ELECTRONIC_TEXT" statusId="CTNT_IN_PROGRESS" objectInfo="/Store-Policies-2-STORE_POLICIES2-content"/>
+    <ElectronicText dataResourceId="DRS_ALT_URL" textData="Store Policies 2"/>
+    <Content contentId="CNT_ALTURL_ASSOC" contentTypeId="DOCUMENT" dataResourceId="DRS_ALT_URL" statusId="CTNT_IN_PROGRESS"/>
+    <ContentAssoc contentId="STORE_POLICIES2" contentIdTo="CNT_ALTURL_ASSOC" contentAssocTypeId="ALTERNATIVE_URL" fromDate="2011-06-23 01:01:01"></ContentAssoc>
+    
+    <DataResource dataResourceId="DRS_CNT_URL001" dataResourceTypeId="ELECTRONIC_TEXT" statusId="CTNT_IN_PROGRESS" objectInfo="/Store-Policies-STORE_POLICIES-content"/>
+    <ElectronicText dataResourceId="DRS_CNT_URL001" textData="Store Policies"/>
+    <Content contentId="CNT_ALTURL_001" contentTypeId="DOCUMENT" dataResourceId="DRS_CNT_URL001" statusId="CTNT_IN_PROGRESS"/>
+    <ContentAssoc contentId="STORE_POLICIES" contentIdTo="CNT_ALTURL_001" contentAssocTypeId="ALTERNATIVE_URL" fromDate="2011-06-23 01:01:01"></ContentAssoc>
+    
+    <DataResource dataResourceId="DRS_CNT_URL002" dataResourceTypeId="ELECTRONIC_TEXT" statusId="CTNT_IN_PROGRESS" objectInfo="/Policies-POLICY-content"/>
+    <ElectronicText dataResourceId="DRS_CNT_URL002" textData="Policies"/>
+    <Content contentId="CNT_ALTURL_002" contentTypeId="DOCUMENT" dataResourceId="DRS_CNT_URL002" statusId="CTNT_IN_PROGRESS"/>
+    <ContentAssoc contentId="POLICY" contentIdTo="CNT_ALTURL_002" contentAssocTypeId="ALTERNATIVE_URL" fromDate="2011-06-23 01:01:01"></ContentAssoc>
+
+    <DataResource dataResourceId="DRS_CNT_URL003" dataResourceTypeId="ELECTRONIC_TEXT" statusId="CTNT_IN_PROGRESS" objectInfo="/Widgets-CNTWIDGETS-content"/>
+    <ElectronicText dataResourceId="DRS_CNT_URL003" textData="Widgets"/>
+    <Content contentId="CNT_ALTURL_003" contentTypeId="DOCUMENT" dataResourceId="DRS_CNT_URL003" statusId="CTNT_IN_PROGRESS"/>
+    <ContentAssoc contentId="CNTWIDGETS" contentIdTo="CNT_ALTURL_003" contentAssocTypeId="ALTERNATIVE_URL" fromDate="2011-06-23 01:01:01"></ContentAssoc>
+    
+    <DataResource dataResourceId="DRS_CNT_URL004" dataResourceTypeId="ELECTRONIC_TEXT" statusId="CTNT_IN_PROGRESS" objectInfo="/Gizmos-CNTGIZMOS-content"/>
+    <ElectronicText dataResourceId="DRS_CNT_URL004" textData="Gizmos"/>
+    <Content contentId="CNT_ALTURL_004" contentTypeId="DOCUMENT" dataResourceId="DRS_CNT_URL004" statusId="CTNT_IN_PROGRESS"/>
+    <ContentAssoc contentId="CNTGIZMOS" contentIdTo="CNT_ALTURL_004" contentAssocTypeId="ALTERNATIVE_URL" fromDate="2011-06-23 01:01:01"></ContentAssoc>
+</entity-engine-xml>

Propchange: ofbiz/trunk/specialpurpose/ecommerce/data/DemoContentAltUrl.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/ecommerce/data/DemoContentAltUrl.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/ecommerce/data/DemoContentAltUrl.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/specialpurpose/ecommerce/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/ofbiz-component.xml?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/ofbiz-component.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/ofbiz-component.xml Fri Jul  1 09:03:32 2011
@@ -53,6 +53,7 @@ under the License.
     <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoTestSurveyData.xml"/>
     <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoProductAdditionalViewData.xml"/>
     <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoPopularCategoriesData.xml"/>
+    <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoContentAltUrl.xml"/>
     
     <webapp name="ecommerce"
         title="eCommerce"

Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/controller.xml Fri Jul  1 09:03:32 2011
@@ -1975,8 +1975,16 @@ under the License.
         <response name="success" type="none"/>
         <response name="error" type="view" value="error"/>
     </request-map>
-    
-    
+
+    <!-- Content Information -->
+    <request-map uri="contentInfoCategory">
+        <security https="false" auth="false"/>
+        <response name="success" type="view" value="contentInfoCategory"/>
+    </request-map>
+    <request-map uri="contentViewInfo">
+        <security https="false" auth="false"/>
+        <response name="success" type="view" value="contentViewInfo"/>
+    </request-map>
     <!-- End of Request Mappings -->
 
     <!-- View Mappings -->
@@ -2133,5 +2141,7 @@ under the License.
     <!-- Product Category 's Ajax -->
     <view-map name="productCategoryList" type="screen" page="component://ecommerce/widget/CatalogScreens.xml#productCategoryList"/>
     
+    <!-- Content Information -->
+    <view-map name="contentViewInfo" type="screen" page="component://ecommerce/widget/ContentScreens.xml#contentViewInfo"/>
     <!-- End of View Mappings -->
 </site-conf>

Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/web.xml?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/web.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/web.xml Fri Jul  1 09:03:32 2011
@@ -65,6 +65,17 @@ under the License.
         <init-param><param-name>defaultLocaleString</param-name><param-value>en_US</param-value></init-param>
         <init-param><param-name>redirectUrl</param-name><param-value>/control/main</param-value></init-param>
     </filter>
+ <filter>
+        <filter-name>ContentUrlFilter</filter-name>
+        <display-name>ContentUrlFilter</display-name>
+        <filter-class>org.ofbiz.content.content.ContentUrlFilter</filter-class>
+        <init-param>
+         <param-name>defaultLocaleString</param-name>
+         <param-value>en_US</param-value>
+        </init-param>
+        <init-param><param-name>redirectUrl</param-name><param-value>/control/main</param-value></init-param>
+        <init-param><param-name>viewRequest</param-name><param-value>contentViewInfo</param-value></init-param>
+    </filter>
     <filter>
         <filter-name>ContextFilter</filter-name>
         <display-name>ContextFilter</display-name>
@@ -91,6 +102,10 @@ under the License.
         <url-pattern>/*</url-pattern>
     </filter-mapping>
     <filter-mapping>
+        <filter-name>ContentUrlFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    <filter-mapping>
         <filter-name>ContextFilter</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>

Added: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/content/content_topic.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/content/content_topic.ftl?rev=1141878&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/content/content_topic.ftl (added)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/content/content_topic.ftl Fri Jul  1 09:03:32 2011
@@ -0,0 +1,51 @@
+<#--
+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.
+-->
+<#assign contentRootId = "WebStoreCONTENT"/>
+
+<#-- variable setup and worker calls -->
+<#assign curCategoryId = requestAttributes.curCategoryId?if_exists>
+<#assign forumTrailCsv=requestParameters.forumTrailCsv?if_exists/>
+<#assign forumTrail=[]/>
+<#assign firstContentId=""/>
+<#if forumTrailCsv?has_content>
+  <#assign forumTrail=Static["org.ofbiz.base.util.StringUtil"].split(forumTrailCsv, ",") />
+  <#if 0 < forumTrail?size>
+    <#assign firstContentId=forumTrail[0]?string/>
+  </#if>
+</#if>
+
+<div id="content_catagories" class="screenlet">
+  <div class="screenlet-title-bar">
+    <ul>
+      <li class="h3">Content Information</li>
+    </ul>
+    <br class="clear"/>
+  </div>
+  <div class="screenlet-body">
+    <ul class="browsecategorylist">
+      <#assign count_1=0/>
+      <@loopSubContent contentId=contentRootId viewIndex=0 viewSize=9999 orderBy="contentName">
+        <li class="browsecategorytext">
+          <a href="<@OfbizContentAltUrl contentId=subContentId viewContent='contentViewInfo'/>" class="browsecategorybutton">${content.contentName}</a>
+        </li>
+        <#assign count_1=(count_1 + 1)/>
+      </@loopSubContent>
+    </ul>
+  </div>
+</div>

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/content/content_topic.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/content/content_topic.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/content/content_topic.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml Fri Jul  1 09:03:32 2011
@@ -112,6 +112,7 @@ under the License.
                     <include-screen name="forums" location="component://ecommerce/widget/ForumScreens.xml"/>
                     <include-screen name="content_categories" location="component://ecommerce/widget/ContentScreens.xml"/>
                     <include-screen name="blogs" location="component://ecommerce/widget/blog/BlogScreens.xml"/>
+                    <include-screen name="contentInfoCategory" location="component://ecommerce/widget/ContentScreens.xml"/>
             </widgets>
         </section>
     </screen>

Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/ContentForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/ContentForms.xml?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/widget/ContentForms.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/widget/ContentForms.xml Fri Jul  1 09:03:32 2011
@@ -40,4 +40,13 @@ under the License.
         <field name="dataResourceId"><display/></field>
         <field name="contentName"><display/></field>
     </form>
+    <form name="contentInfomation" target="" title="" type="single"
+        header-row-style="header-row" default-table-style="basic-table">
+        <field name="contentName"><display description="${content.contentName}"/></field>
+        <field name="description"><display description="${content.description}"/></field>
+        <field name="createdByUserLogin" title="${uiLabelMap.EcommerceOwner}"><display description="${content.createdByUserLogin}"/></field>
+        <field name="localeString" title="${uiLabelMap.CommonLanguageTitle}"><display description="${content.localeString}"/></field>
+        <field name="createdDate" title="${uiLabelMap.EcommerceModifyDate}"><display description="${content.createdDate}"/></field>
+    </form>
 </forms>
+

Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/ContentScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/ContentScreens.xml?rev=1141878&r1=1141877&r2=1141878&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/widget/ContentScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/widget/ContentScreens.xml Fri Jul  1 09:03:32 2011
@@ -158,4 +158,35 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="contentInfoCategory">
+        <section>
+            <widgets>
+                <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/content/content_topic.ftl"/></html></platform-specific>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="contentViewInfo">
+        <section>
+            <actions>
+                <set field="leftbarScreenName" value="leftbar"/>
+                <set field="rightbarScreenName" value="rightbar"/>
+                <set field="MainColumnStyle" value="center"/>
+                <set field="titleProperty" value="PageTitleViewContent"/>
+                <set field="headerItem" value="Content Info"/>
+                <entity-one entity-name="Content" value-field="content">
+                    <field-map field-name="contentId" from-field="parameters.contentId"/>
+                </entity-one>
+                <set field="contentDataResource" from-field="contentDataResources[0]"></set>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.EcommerceContentInformation}: ${content.contentId}">
+                            <include-form name="contentInfomation" location="component://ecommerce/widget/ContentForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>