svn commit: r544733 - in /ofbiz/trunk/applications/ecommerce: config/ webapp/ecommerce/WEB-INF/ webapp/ecommerce/forum/ webapp/ecommerce/images/ widget/

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

svn commit: r544733 - in /ofbiz/trunk/applications/ecommerce: config/ webapp/ecommerce/WEB-INF/ webapp/ecommerce/forum/ webapp/ecommerce/images/ widget/

byersa-3
Author: byersa
Date: Tue Jun  5 22:35:41 2007
New Revision: 544733

URL: http://svn.apache.org/viewvc?view=rev&rev=544733
Log:
Changes related to getting forum to work.
I tried to apply more current CMS techniques.
One assumption that I changed is that a person must be logged in to view entries.
I changed it so that a person only needs to be logged in (and have permssions) to add an article or response.

This is all still rough. I will be trying to refine it in the near future.

Added:
    ofbiz/trunk/applications/ecommerce/config/forum.properties
    ofbiz/trunk/applications/ecommerce/widget/ForumForms.xml
    ofbiz/trunk/applications/ecommerce/widget/ForumTrees.xml
Modified:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/forumPaging.ftl
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/messageDisplay.ftl
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/showforumarticle.ftl
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/blog.css
    ofbiz/trunk/applications/ecommerce/widget/ForumScreens.xml

Added: ofbiz/trunk/applications/ecommerce/config/forum.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/config/forum.properties?view=auto&rev=544733
==============================================================================
--- ofbiz/trunk/applications/ecommerce/config/forum.properties (added)
+++ ofbiz/trunk/applications/ecommerce/config/forum.properties Tue Jun  5 22:35:41 2007
@@ -0,0 +1 @@
+descriptLen=80
\ No newline at end of file

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?view=diff&rev=544733&r1=544732&r2=544733
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml Tue Jun  5 22:35:41 2007
@@ -1231,18 +1231,29 @@
     
     <!-- used in new forum -->
     <request-map uri="showforum">
-        <security https="true" auth="false"/>
+        <security https="false" auth="false"/>
         <response name="success" type="view" value="Showforum"/>
     </request-map>
-    <request-map uri="addForumMessage">
+    <request-map uri="ViewForumMessage">
+        <security https="false" auth="false"/>
+        <response name="success" type="view" value="ViewForumMessage"/>
+    </request-map>
+    <request-map uri="AddForumThread">
         <security https="true" auth="true"/>
-        <response name="success" type="view" value="AddForumMessage"/>
+        <response name="success" type="view" value="AddForumThread"/>
     </request-map>
+    <request-map uri="createForumMessage">
+        <security https="true" auth="true"/>
+        <event invoke="createArticleContent" type="service"/>
+        <response name="success" type="view" value="Showforum"/>
+        <response name="error" type="view" value="AddForumThread"/>
+    </request-map>
+    
     <request-map uri="updateForumMessage">
         <security https="true" auth="true"/>
         <event invoke="persistContentAndAssoc" type="service"/>
         <response name="success" type="view" value="Showforum"/>
-        <response name="error" type="view" value="AddForumMessage"/>
+        <response name="error" type="view" value="AddForumThread"/>
     </request-map>
     
 
@@ -1629,11 +1640,12 @@
     <!-- Forum Views -->
     <!-- new -->
     <view-map name="Showforum" type="screen" page="component://ecommerce/widget/ForumScreens.xml#Showforum"/>
-    <view-map name="AddForumMessage" page="component://content/widget/forum/ForumScreens.xml#AddForumMessage" type="screen"/>
+    <view-map name="AddForumThread" page="component://ecommerce/widget/ForumScreens.xml#AddForumThread" type="screen"/>
     <!-- old -->    
     <view-map name="showforumarticle" type="screen" page="component://ecommerce/widget/ForumScreens.xml#showforumarticle"/>
     <view-map name="createforumarticle" type="screen" page="component://ecommerce/widget/ForumScreens.xml#createforumarticle"/>
     <view-map name="editforumarticle" type="screen" page="component://ecommerce/widget/ForumScreens.xml#editforumarticle"/>
+    <view-map name="ViewForumMessage" type="screen" page="component://ecommerce/widget/ForumScreens.xml#ViewForumMessage"/>
 
     <view-map name="showforumresponse" type="screen" page="component://ecommerce/widget/ForumScreens.xml#showforumresponse"/>
     <view-map name="createforumresponse" type="screen" page="component://ecommerce/widget/ForumScreens.xml#createforumresponse"/>

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/forumPaging.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/forumPaging.ftl?view=diff&rev=544733&r1=544732&r2=544733
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/forumPaging.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/forumPaging.ftl Tue Jun  5 22:35:41 2007
@@ -20,11 +20,13 @@
 <#assign viewIndex = viewIndex?default(0)>
 <#assign lowIndex = viewIndex?int * viewSize?int + 1>
 <#assign highIndex = viewIndex?int * viewSize?int + viewSize>
-<#if highIndex gt listSize><#assign highIndex = listSize></#if>
 <#--<br/>== viewIndex: ${viewIndex} ==viewSize: ${viewSize} ==lowIndex: ${lowIndex}== highIndex: ${highIndex} == ListSize: ${listSize}-->
 <#if forumMessages?has_content && forumMessages?size gt 0>
+    <#assign listSize = forumMessages?size/>
+    <#if highIndex gt listSize><#assign highIndex = listSize></#if>
     <div class="product-prevnext">
-      <#assign viewIndexMax = Static["java.lang.Math"].ceil(listSize?double / viewSize?double)>
+      <#assign r = listSize?double / viewSize?double />
+      <#assign viewIndexMax = Static["java.lang.Math"].ceil(r?double)>
       <select name="pageSelect" class="selectBox" onchange="window.location=this[this.selectedIndex].value;">
         <option value="#">${uiLabelMap.CommonPage} ${viewIndex?int+1} ${uiLabelMap.CommonOf} ${viewIndexMax}</option>
         <#list 1..viewIndexMax as curViewNum>

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/messageDisplay.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/messageDisplay.ftl?view=diff&rev=544733&r1=544732&r2=544733
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/messageDisplay.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/messageDisplay.ftl Tue Jun  5 22:35:41 2007
@@ -16,12 +16,26 @@
 specific language governing permissions and limitations
 under the License.
 -->
- <#if rsp?exists><#-- message in a thread? -->
+        <#-- Thread content id equals contentId if contentAssocTypeId equals PUBLISH_LINK, else threadContentId = ownerContentId -->
+        <#assign threadContentId = forumMessage.contentId/>
+        <#if forumMessage.caContentAssocTypeId == "RESPONSE">
+            <#assign threadContentId = forumMessage.ownerContentId?if_exists/>
+        </#if>
+ <#if rsp?exists>
  <#assign contentId = rsp.contentId>
  <#else>
  <#assign contentId = forumMessage.contentId>
  </#if>
-   <#assign result = dispatcher.runSync("getPublicForumMessage", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", contentId))/>
+ <div class="tableheadtext">
+ ${uiLabelMap.CommonTitle}: ${forumMessage.contentName?if_exists} ${uiLabelMap.CommonBy}:${forumMessage.createdByUserLogin?if_exists} ${uiLabelMap.CommonAt}: ${forumMessage.createdDate?if_exists.toString().substring(0,16)}
+ <a href="ViewForumMessage?forumId=${parameters.forumId}&responseContentId=${forumMessage.contentId}&threadContentId=${threadContentId?if_exists}" class="buttontext">${uiLabelMap.CommonView}</a>
+ </div>
+ <div class="tableheadtext">
+ ${forumMessage.description?if_exists}
+ </div>
+         <hr class="sepbar"/>
+ <#--
+   <#assign result = dispatcher.runSync("getPublicForumMessage", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", contentId, "userLogin", userLogin))/>
    <#if (result.resultData)?exists>
  <div class="tableheadtext">
  ${uiLabelMap.CommonTitle}: ${result.resultData.content.description?if_exists} ${uiLabelMap.CommonBy}:${result.resultData.content.createdByUserLogin} ${uiLabelMap.CommonAt}: ${result.resultData.content.createdDate.toString().substring(0,16)}
@@ -36,3 +50,4 @@
    <#else>
    <div class="tabletext"> ${result.errorMessage?if_exists}</div>
  </#if>
+ -->

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/showforumarticle.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/showforumarticle.ftl?view=diff&rev=544733&r1=544732&r2=544733
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/showforumarticle.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/forum/showforumarticle.ftl Tue Jun  5 22:35:41 2007
@@ -16,77 +16,6 @@
 specific language governing permissions and limitations
 under the License.
 -->
-
-<#import "bloglib.ftl" as blog/>
-<div class="screenlet" >
-<div style="margin:10px;" >
-<@blog.renderAncestryPath trail=ancestorList?default([]) endIndexOffset=1 />
-
-<#-- Do this so that we don't have to find the content twice (again in renderSubContent) -->
-<#assign lastNode = globalNodeTrail?if_exists?last/>
-<#if lastNode?has_content>
-  <#assign subContent=lastNode.value/>
-<#else>
-<#assign subContent = delegator.findByPrimaryKeyCache("Content", Static["org.ofbiz.base.util.UtilMisc"].toMap("contentId", subContentId))/>
-<#assign dummy = globalNodeTrail.add(lastNode)/>
-</#if>
-<br/>
-<div class="head1">${uiLabelMap.EcommerceContentFor} [${subContentId}] ${subContent.contentName?if_exists} - ${subContent.description?if_exists}:</div><br/>
-<table border="0" width="100%" class="blogtext">
-    <tr>
-    <td width="40">&nbsp;</td>
-    <td>
-    <@renderSubContentCache subContentId=requestParameters.contentId />
-    </td>
-    <td width="40" valign="bottom">
-<#--
-<@wrapSubContentCache subContentId=subContentId wrapTemplateId="WRAP_VIEW" >
-</@wrapSubContentCache >
--->
-<@checkPermission mode="equals" entityOperation="_CREATE" targetOperation="HAS_USER_ROLE" >
-    <a class="tabButton" href="<@ofbizUrl>createforumresponse?contentIdTo=${requestParameters.contentId}&amp;nodeTrailCsv=${nodeTrailCsv?if_exists}</@ofbizUrl>" >${uiLabelMap.EcommerceRespond}</a>
-</@checkPermission>
-<br/>
-
-    </td>
-    </tr>
-</table>
-<hr/>
-<#--
-<@checkPermission mode="not-equals" subContentId=subContentId targetOperation="CONTENT_CREATE|CONTENT_RESPOND" contentPurposeList="RESPONSE" >
-            ${permissionErrorMsg?if_exists}
-</@checkPermission>
--->
-
-        <div class="head1">${uiLabelMap.EcommerceResponses}</div><br/>
-<table border="0" width="100%" class="tableheadtext">
-<@loopSubContentCache  contentAssocTypeId="RESPONSE" subContentId=subContentId mapKey=""
-                pickWhen="contentAssocTypeId != null && \"RESPONSE\".equals(contentAssocTypeId) && mapKey == null"
-                followWhen="contentAssocTypeId != null && \"_never_\".equals(contentAssocTypeId)"
->
-  <tr>
-    <#assign indentStr=indent?default("0")/>
-    <#assign indent=indentStr?number/>
-    <#if 1 < indent >
-  <td class="tabletext">
-        <#assign thisContentId = ""/>
-        <#if nodeTrailCsv?exists>
-            <#assign idList = nodeTrailCsv?split(",")/>
-            <#if 0 < idList?size >
-                <#assign thisContentId = idList?last>
-            </#if>
-        </#if>
-        <#if content?exists>
-        <a class="tabButton" href="<@ofbizUrl>showforumresponse?contentId=${thisContentId}&amp;nodeTrailCsv=${nodeTrailCsv?if_exists}</@ofbizUrl>" >${uiLabelMap.CommonView}</a>
-[${thisContentId}] ${content.contentName?if_exists}-${content.description?if_exists}
-        </#if>
-
-    </#if>
-</@loopSubContentCache >
-<#--
-<@wrapSubContentCache subContentId=subContentId wrapTemplateId="WRAP_NEXT_PREV" >
-</@wrapSubContentCache >
--->
-</table>
-</div>
-</div>
+<div style="">
+${contentText}
+</div>
\ No newline at end of file

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/blog.css
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/blog.css?view=diff&rev=544733&r1=544732&r2=544733
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/blog.css (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/blog.css Tue Jun  5 22:35:41 2007
@@ -105,6 +105,7 @@
 color: black;
 font-weight: bold;
 text-align: left;
+margin-top: 10px;
 margin-left: 10px;
 }
 
@@ -151,7 +152,6 @@
 }
 
 .blogwrapper {
-position: relative;
 background: #eeeeee;
 padding: 4px;
 margin-top: 6px;
@@ -169,6 +169,7 @@
 border: 1px solid #000000;
 padding: 15px 5px 15px 5px;
 margin-top: 6px;
+margin-bottom: 16px;
 color: black;
 font-weight: normal;
 text-align: left;
@@ -180,6 +181,7 @@
 
 .responseheader, A.responseheader {
 color: #000099;
+font-size: 0.9em;
 font-weight: bold;
 text-align: left;
 text-decoration: none;
@@ -193,6 +195,7 @@
 
 .responsetext {
 color: #222222;
+font-size: 0.75em;
 font-weight: normal;
 text-align: left;
 margin-left: 20px;

Added: ofbiz/trunk/applications/ecommerce/widget/ForumForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/ForumForms.xml?view=auto&rev=544733
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/ForumForms.xml (added)
+++ ofbiz/trunk/applications/ecommerce/widget/ForumForms.xml Tue Jun  5 22:35:41 2007
@@ -0,0 +1,40 @@
+<?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.
+-->
+<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
+    
+    
+    <form name="AddForumMessage" type="single" target="createForumMessage">
+        <field name="VIEW_INDEX"><hidden value="${parameters.VIEW_INDEX}"/></field>
+        <field name="threadView"><hidden value="${parameters.threadView}"/></field>
+        <field name="forumId"><hidden value="${parameters.forumId}"/></field>
+        <field name="threadContentId"><hidden value="${parameters.threadContentId}"/></field>
+        <field name="dataResourceTypeId"><hidden value="ELECTRONIC_TEXT"/></field>
+        <field name="contentName" title="Short Name" ><text/></field>
+        <field name="contentTypeId"><hidden value="DOCUMENT"/></field>
+        <field name="contentIdFrom"><hidden value="${contentAssoc.contentId}"/></field>
+        <field name="pubPtContentId"><hidden value="${parameters.forumId}"/></field>
+        <field name="contentAssocTypeId"><hidden value="${contentAssoc.contentAssocTypeId}"/></field>
+        <field name="textData" map-name="dummy">
+        <textarea  rows="10" visual-editor-enable="true" visual-editor-buttons="undo redo bold italic underline bullet indent outdent link" />
+        </field>
+        <field name="addButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+</forms>

Modified: ofbiz/trunk/applications/ecommerce/widget/ForumScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/ForumScreens.xml?view=diff&rev=544733&r1=544732&r2=544733
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/ForumScreens.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/ForumScreens.xml Tue Jun  5 22:35:41 2007
@@ -61,61 +61,89 @@
                     <field-map field-name="contentId" env-name="parameters.forumId"/>
                 </entity-one>
                 <!-- parameters for the performFind service -->
-                <set field="inpField.ownerContentId" from-field="parameters.forumId"/>
+                <set field="parameters.forumId" from-field="parameters.forumId" default-value="${parameters.contentId}"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="10"/>
-                <service service-name="performFindList" result-map-name="result">
-                    <field-map field-name="viewIndex" env-name="viewIndex"/>
-                    <field-map field-name="viewSize" env-name="viewSize"/>
-                    <field-map field-name="inputFields" env-name="inpField"/>
-                    <field-map field-name="entityName" value="ContentAssocViewFrom"/>
-                    <field-map field-name="orderBy" value="createdDate"/>
-                </service>
-                <set field="forumMessages" from-field="result.list"/>
-                <set field="listSize" from-field="result.listSize"/>
+                <entity-condition list-name="forumMessages" entity-name="ContentAssocViewTo" >
+                    <condition-list combine="and">
+                        <condition-expr field-name="contentIdStart" env-name="parameters.forumId" />
+                        <condition-list combine="or">
+                            <condition-expr field-name="caContentAssocTypeId" value="PUBLISH_LINK"/>
+                            <condition-expr field-name="caContentAssocTypeId" value="RESPONSE"/>
+                        </condition-list>
+                    </condition-list>
+                    <order-by field-name="createdDate"/>
+                    
+                </entity-condition>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <section>
-                            <condition>
-                                <if-empty field-name="parameters.threadView"/>
-                            </condition>
                             <widgets>
                                 <label style="head1" text="${uiLabelMap.EcommerceMessageListForForum} ${forum.description}"/>
-                                <link style="buttontext" target="addForumMessage?forumId=${parameters.forumId}&amp;forumMessageIdTo=${parameters.forumId}&amp;threadView=${parameters.threadView?if_exists}&amp;VIEW_INDEX=${parameters.VIEW_INDEX}" text="${uiLabelMap.PageTitleNewMessage}"/>
-                                <link style="buttontext" target="showforum?threadView=yes&amp;forumId=${parameters.forumId}" text="${uiLabelMap.EcommerceThreadView}"/>
+                        <section>
+                            <condition>
+                                <if-has-permission permission="CONTENTMGR" action="CREATE"/>
+                            </condition>
+                            <widgets>
+                                <link style="buttontext" target="AddForumThread?forumId=${parameters.forumId}&amp;forumMessageIdTo=&amp;threadView=${parameters.threadView?if_exists}&amp;VIEW_INDEX=${parameters.VIEW_INDEX}" text="${uiLabelMap.PageTitleNewMessage}"/>
+                            </widgets>
+                        </section>
                                 <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/forum/forumPaging.ftl"/></html></platform-specific>
                                 <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/forum/showforum.ftl"/></html></platform-specific>
                                 <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/forum/forumPaging.ftl"/></html></platform-specific>
                             </widgets>
-                            <fail-widgets>
-                                <label style="head1" text="${uiLabelMap.EcommerceMessageListForForum} ${forum.description}"/>
-                                <link style="buttontext" target="addForumMessage?forumId=${parameters.forumId}&amp;forumMessageIdTo=${parameters.forumId}&amp;threadView=${parameters.threadView?if_exists}&amp;VIEW_INDEX=${parameters.VIEW_INDEX}" text="${uiLabelMap.PageTitleNewMessage}"/>
-                                <link style="buttontext" target="showforum?forumId=${parameters.forumId}" text="${uiLabelMap.EcommerceListView}"/>
-                                <include-tree name="MessageTree" location="component://content/widget/forum/ForumTrees.xml" />
-                            </fail-widgets>
                         </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
         </section>
     </screen>
-    <screen name="showforumarticle">
+    <screen name="ViewForumMessage">
         <section>
             <actions>
                 <set field="leftbarScreenName" value="leftbar"/>
                 <set field="rightbarScreenName" value="rightbar"/>
                 <set field="MainColumnStyle" value="center"/>
                 <set field="titleProperty" value="PageTitleForumArticle"/>
-                <entity-and entity-name="" list-name="">
-                    <field-map field-name=""/>
-                </entity-and>
+                <set field="contentAssoc.contentId" from-field="parameters.responseContentId"/>
+                <set field="contentAssoc.contentAssocTypeId" value="RESPONSE"/>
+                
+                <entity-one entity-name="Content" value-name="content">
+                    <field-map field-name="contentId" env-name="parameters.responseContentId"/>
+                </entity-one>
+                <entity-one entity-name="ElectronicText" value-name="electronicText">
+                    <field-map field-name="dataResourceId" env-name="content.dataResourceId"/>
+                </entity-one>
+                <!-- service service-name="getContentAndDataResource" result-map-name="contentData">
+                    <field-map field-name="contentId" env-name="parameters.responseContentId"/>
+                </service -->
+                <set field="contentText" from-field="electronicText.textData"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
-                        <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/forum/showforumarticle.ftl"/></html></platform-specific>
+                        <label style="blogheader">Full message:</label>
+                        <container style="blogcontentwrapper">
+                        <label>${contentText}</label>
+                        </container>
+                        <section>
+                            <condition>
+                                <if-has-permission permission="CONTENTMGR" action="CREATE"/>
+                            </condition>
+                            <widgets>
+                        <label style="blogheader">Add response:</label>
+                        <include-form name="AddForumMessage" location="component://ecommerce/widget/ForumForms.xml"/>
+                            </widgets>
+                            <fail-widgets>
+                        <label style="blogheader">You must be logged in to add a response.</label>
+                            </fail-widgets>
+                        </section>
+                        <container>
+                        <label style="blogheader">Message tree:</label>
+                        </container>
+                        <include-tree name="ResponseTree" location="component://ecommerce/widget/ForumTrees.xml" />
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -449,6 +477,82 @@
                         <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/forum/editaddimage.ftl"/></html></platform-specific>
                     </decorator-section>
                 </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="AddForumThread">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleEditForumMessage"/>
+                <set field="tabButtonItem" value="EditForumMessage"/>
+                <set field="labelTitleProperty" value="PageTitleEditForumMessage"/>
+                <set field="tabBar" value="ForumMessagesTabBar"/>
+                <set field="tabButtonItem" value=""/>
+                <set field="labelTitleProperty" value="PageTitleFindForumMessages"/>
+                <set field="contentAssoc.contentId" from-field="parameters.forumId"/>
+                <set field="contentAssoc.contentAssocTypeId" value="PUBLISH_LINK"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="commonForumDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <label text="Add a thread:"></label>
+                        <include-form name="AddForumMessage" location="component://ecommerce/widget/ForumForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="AddForumResponse">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleEditForumMessage"/>
+                <set field="tabButtonItem" value="EditForumMessage"/>
+                <set field="labelTitleProperty" value="PageTitleEditForumMessage"/>
+                <set field="tabBar" value="ForumMessagesTabBar"/>
+                <set field="tabButtonItem" value=""/>
+                <set field="labelTitleProperty" value="PageTitleFindForumMessages"/>
+                <set field="contentAssoc.contentId" from-field="parameters.responseContentId"/>
+                <set field="contentAssoc.contentAssocTypeId" value="RESPONSE"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="commonForumDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <label text="Add a response:"></label>
+                        <include-form name="AddForumMessage" location="component://ecommerce/widget/ForumForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="responseTreeLine">
+        <section>
+            <condition>
+                <not>
+                    <if-empty field-name="rsp.contentName"/>
+                </not>
+            </condition>
+            <actions>
+            </actions>
+            <widgets>
+                <section>
+                    <condition>
+                        <if-compare-field field-name="responseContentId" operator="equals" to-field-name="rsp.contentId" />
+                    </condition>
+                    <widgets>
+                        <container style="responseSelected">
+                            <label text="${rsp.contentName}" style="responseheader" />
+                            <label text=" - ${rsp.description} [${rsp.contentId}]" style="responsetext" />
+                            <link  text="View" target="ViewForumMessage?forumId=${parameters.forumId}&amp;threadContentId=${parameters.threadContentId}&amp;responseContentId=${rsp.contentId}&amp;contentAssocTypeId=RESPONSE" style="buttontext"/>
+                        </container>    
+                    </widgets>
+                    <fail-widgets>
+                        <container>
+                            <label text="${rsp.contentName}" style="responseheader" />
+                            <label text=" - ${rsp.description} [${rsp.contentId}]" style="responsetext" />
+                            <link  text="View" target="ViewForumMessage?forumId=${parameters.forumId}&amp;threadContentId=${parameters.threadContentId}&amp;responseContentId=${rsp.contentId}&amp;contentAssocTypeId=RESPONSE" style="buttontext"/>
+                        </container>    
+                    </fail-widgets>
+                </section>
             </widgets>
         </section>
     </screen>

Added: ofbiz/trunk/applications/ecommerce/widget/ForumTrees.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/ForumTrees.xml?view=auto&rev=544733
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/ForumTrees.xml (added)
+++ ofbiz/trunk/applications/ecommerce/widget/ForumTrees.xml Tue Jun  5 22:35:41 2007
@@ -0,0 +1,65 @@
+<?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.
+-->
+
+<trees xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-tree.xsd">
+
+    <tree name="ResponseTree" root-node-name="node-root"
+        default-render-style="simple" default-wrap-style="responseTreeWrapper">
+        <node name="node-root" >
+            <entity-one entity-name="Content"  use-cache="false" value-name="rsp">
+                <field-map field-name="contentId" env-name="parameters.threadContentId"/>
+            </entity-one>
+            <include-screen name="responseTreeLine" location="component://ecommerce/widget/ForumScreens.xml" />
+            <sub-node node-name="node-body">
+                <entity-condition entity-name="ContentAssocViewTo" use-cache="false" >
+                    <condition-list combine="and">
+                        <condition-expr field-name="contentIdStart" operator="equals" env-name="rsp.contentId" />
+                        <condition-expr field-name="caContentAssocTypeId" operator="equals" value="RESPONSE" />
+                        <condition-expr field-name="caFromDate" operator="less-equals" env-name="nowTimestamp" />
+                    <condition-list combine="or">
+                        <condition-expr field-name="caThruDate" operator="equals" />
+                        <condition-expr field-name="caThruDate" operator="greater" env-name="nowTimestamp" />
+                    </condition-list>
+                    </condition-list>
+                    <order-by field-name="caFromDate DESC"/>
+                </entity-condition>
+            </sub-node>
+        </node>
+        <node name="node-body" entry-name="rsp">
+            <include-screen name="responseTreeLine" location="component://ecommerce/widget/ForumScreens.xml" />
+            <sub-node node-name="node-body">
+                <entity-condition entity-name="ContentAssocViewTo" use-cache="true" >
+                    <condition-list combine="and">
+                        <condition-expr field-name="contentIdStart" operator="equals" env-name="rsp.contentId" />
+                        <condition-expr field-name="caContentAssocTypeId" operator="equals" value="RESPONSE" />
+                        <condition-expr field-name="caFromDate" operator="less-equals" env-name="nowTimestamp" />
+                    <condition-list combine="or">
+                        <condition-expr field-name="caThruDate" operator="equals" />
+                        <condition-expr field-name="caThruDate" operator="greater" env-name="nowTimestamp" />
+                    </condition-list>
+                    </condition-list>
+                    <order-by field-name="caFromDate DESC"/>
+                </entity-condition>
+            </sub-node>
+        </node>
+    </tree>
+    
+</trees>