svn commit: r516548 - in /ofbiz/trunk/applications/content: data/ src/org/ofbiz/content/content/ webapp/content/WEB-INF/actions/website/ webapp/content/website/ widget/

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

svn commit: r516548 - in /ofbiz/trunk/applications/content: data/ src/org/ofbiz/content/content/ webapp/content/WEB-INF/actions/website/ webapp/content/website/ widget/

jaz-3
Author: jaz
Date: Fri Mar  9 12:52:51 2007
New Revision: 516548

URL: http://svn.apache.org/viewvc?view=rev&rev=516548
Log:
updated a CMS content to include decorator content;

Modified:
    ofbiz/trunk/applications/content/data/ContentTypeData.xml
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
    ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/website/WebSitePublishPoint.bsh
    ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl
    ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl
    ofbiz/trunk/applications/content/widget/WebSiteScreens.xml

Modified: ofbiz/trunk/applications/content/data/ContentTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/data/ContentTypeData.xml?view=diff&rev=516548&r1=516547&r2=516548
==============================================================================
--- ofbiz/trunk/applications/content/data/ContentTypeData.xml (original)
+++ ofbiz/trunk/applications/content/data/ContentTypeData.xml Fri Mar  9 12:52:51 2007
@@ -115,6 +115,7 @@
     <ContentPurposeType contentPurposeTypeId="SOURCE" description="General Source"/>
 
     <!-- These ContentTypes are primarily for structuring knowledge -->
+    <ContentType contentTypeId="DECORATOR" description="Decorator" hasTable="N" parentTypeId=""/>
     <ContentType contentTypeId="DOCUMENT" description="Document" hasTable="N" parentTypeId=""/>
     <ContentType contentTypeId="TEMPLATE" description="Template or Form" hasTable="N" parentTypeId=""/>
     <ContentType contentTypeId="ANNOTATION" description="Annotation" hasTable="N" parentTypeId=""/>

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java?view=diff&rev=516548&r1=516547&r2=516548
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java Fri Mar  9 12:52:51 2007
@@ -285,12 +285,13 @@
         GenericValue subContent = EntityUtil.getFirst(assocs);
 
         if (subContent == null) {
-            throw new GeneralException("No sub-content found with map-key [" + mapKey + "] for content [" + contentId + "]");
+            //throw new GeneralException("No sub-content found with map-key [" + mapKey + "] for content [" + contentId + "]");
+            out.write("<!-- no sub-content found with map-key [" + mapKey + "] for content [" + contentId + "] -->");
+        } else {
+            String subContentId = subContent.getString("contentIdTo");
+            templateContext.put("mapKey", mapKey);
+            renderContentAsText(dispatcher, delegator, subContentId, out, templateContext, locale, mimeTypeId, cache);
         }
-
-        String subContentId = subContent.getString("contentIdTo");
-        templateContext.put("mapKey", mapKey);
-        renderContentAsText(dispatcher, delegator, subContentId, out, templateContext, locale, mimeTypeId, cache);
     }
 
     public static GenericValue findAlternateLocaleContent(GenericDelegator delegator, GenericValue view, Locale locale) {

Modified: ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/website/WebSitePublishPoint.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/website/WebSitePublishPoint.bsh?view=diff&rev=516548&r1=516547&r2=516548
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/website/WebSitePublishPoint.bsh (original)
+++ ofbiz/trunk/applications/content/webapp/content/WEB-INF/actions/website/WebSitePublishPoint.bsh Fri Mar  9 12:52:51 2007
@@ -21,24 +21,31 @@
 import org.ofbiz.entity.*;
 import org.ofbiz.entity.util.*;
 
-Map lookupMap = UtilMisc.toMap("webSiteId", webSiteId, "webSiteContentTypeId", "PUBLISH_POINT");
-
-List webSiteContents = delegator.findByAnd("WebSiteContent", lookupMap, UtilMisc.toList("-fromDate"));
+Map pplookupMap = UtilMisc.toMap("webSiteId", webSiteId, "webSiteContentTypeId", "PUBLISH_POINT");
+List webSiteContents = delegator.findByAnd("WebSiteContent", pplookupMap, UtilMisc.toList("-fromDate"));
 webSiteContents = EntityUtil.filterByDate(webSiteContents);
 webSiteContent = EntityUtil.getFirst(webSiteContents);
-
 if (webSiteContent != null) {
     content = webSiteContent.getRelatedOne("Content");
     contentRoot = content.getString("contentId");
-
-    publishPoint = delegator.findByPrimaryKey("WebSitePublishPoint", UtilMisc.toMap("contentId", contentRoot));
-
-    context.put("contentRoot", contentRoot);
     context.put("content", content);
-    context.put("publishPoint", publishPoint);
-    Debug.log("CnRt: " + contentRoot + " -- PP: " + publishPoint);
+    context.put("contentRoot", contentRoot);
 
     // get all sub content for the publish point
     List subsites = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentRoot));
     context.put("subsites", subsites);
-}
\ No newline at end of file
+}
+
+Map mnlookupMap = UtilMisc.toMap("webSiteId", webSiteId, "webSiteContentTypeId", "MENU_ROOT");
+List webSiteMenus = delegator.findByAnd("WebSiteContent", mnlookupMap, UtilMisc.toList("-fromDate"));
+webSiteMenu = EntityUtil.getFirst(webSiteMenus);
+if (webSiteMenu != null) {
+    menu = webSiteMenu.getRelatedOne("Content");
+    menuRoot = menu.getString("contentId");
+    context.put("menu", menu);
+    context.put("menuRoot", menuRoot);
+
+    // get all sub content for the publish point
+    List menus = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", menuRoot));
+    context.put("menus", menus);
+}

Modified: ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl?view=diff&rev=516548&r1=516547&r2=516548
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl (original)
+++ ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl Fri Mar  9 12:52:51 2007
@@ -204,6 +204,24 @@
             </td>
           </tr>
           <tr>
+            <td><div class="tableheadtext">Decorator</div></td>
+            <td>
+                <select name="decoratorContentId" class="selectBox">
+                    <#if (content?has_content)>
+                        <#if (content.decoratorContentId?has_content)>
+                            <#assign thisDec = content.getRelatedOne("DecoratorContent")/>
+                            <option value="${thisDec.contentId}">${thisDec.contentName}</option>
+                            <option value="${thisDec.contentId}">----</option>
+                        </#if>
+                    </#if>
+                    <option value="">None</option>
+                    <#list decorators as decorator>
+                        <option value="${decorator.contentId}">${decorator.contentName}</option>
+                    </#list>
+                </select>
+            </td>
+          </tr>
+          <tr>
             <td><div class="tableheadtext">Template</div></td>
             <td>
                 <select name="templateDataResourceId" class="selectBox">

Modified: ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl?view=diff&rev=516548&r1=516547&r2=516548
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl (original)
+++ ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl Fri Mar  9 12:52:51 2007
@@ -374,3 +374,27 @@
         <@fillTree assocList = subsites/>
     </#if>
 </div>
+
+<div>&nbsp;</div>
+<div>&nbsp;</div>
+
+<dl dojoType="TreeContextMenu" id="webMenuContextMenu" style="font-size: 1em; color: #ccc;">
+    <dt dojoType="TreeMenuItem" id="newItem" caption="New Menu Item"/>
+    <dt dojoType="TreeMenuItem" id="newMenu" caption="New Menu"/>    
+</dl>
+
+<div class="tableheadtext">
+    Website Menus
+</div>
+<div class="tabletext">
+  *Right click to add new menus
+</div>
+<div>&nbsp;</div>
+
+<dojo:TreeSelector widgetId="webMenuTreeSelector" eventNames="select:webMenuNodeSelected"></dojo:TreeSelector>
+<div dojoType="Tree" menu="webMenuContextMenu" widgetId="webMenuTree" selector="webMenuTreeSelector" toggler="fade" toggleDuration="500">
+    <#if (menus?has_content)>
+        <@fillTree assocList = subsites/>
+    </#if>
+</div>
+

Modified: ofbiz/trunk/applications/content/widget/WebSiteScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/WebSiteScreens.xml?view=diff&rev=516548&r1=516547&r2=516548
==============================================================================
--- ofbiz/trunk/applications/content/widget/WebSiteScreens.xml (original)
+++ ofbiz/trunk/applications/content/widget/WebSiteScreens.xml Fri Mar  9 12:52:51 2007
@@ -265,6 +265,9 @@
                     <order-by field-name="sequenceId"/>
                 </entity-and>
                 <entity-condition entity-name="DataTemplateType" list-name="templateTypes"/>
+                <entity-and entity-name="Content" list-name="decorators">
+                    <field-map field-name="contentTypeId" value="DECORATOR"/>
+                </entity-and>
             </actions>
             <widgets>
                 <platform-specific>