svn commit: r510737 - in /ofbiz/trunk/applications/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: r510737 - in /ofbiz/trunk/applications/content: webapp/content/WEB-INF/actions/website/ webapp/content/website/ widget/

jaz-3
Author: jaz
Date: Thu Feb 22 16:54:55 2007
New Revision: 510737

URL: http://svn.apache.org/viewvc?view=rev&rev=510737
Log:
better handling of websites w/ no publish points, better handling of content w/ no data resources

Modified:
    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/WebSiteCMSEditor.ftl
    ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl
    ofbiz/trunk/applications/content/widget/WebSiteScreens.xml

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=510737&r1=510736&r2=510737
==============================================================================
--- 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 Thu Feb 22 16:54:55 2007
@@ -26,15 +26,19 @@
 List webSiteContents = delegator.findByAnd("WebSiteContent", lookupMap, UtilMisc.toList("-fromDate"));
 webSiteContents = EntityUtil.filterByDate(webSiteContents);
 webSiteContent = EntityUtil.getFirst(webSiteContents);
-content = webSiteContent.getRelatedOne("Content");
-contentRoot = content.getString("contentId");
 
-publishPoint = delegator.findByPrimaryKey("WebSitePublishPoint", UtilMisc.toMap("contentId", contentRoot));
+if (webSiteContent != null) {
+    content = webSiteContent.getRelatedOne("Content");
+    contentRoot = content.getString("contentId");
 
-context.put("contentRoot", contentRoot);
-context.put("content", content);
-context.put("publishPoint", publishPoint);
+    publishPoint = delegator.findByPrimaryKey("WebSitePublishPoint", UtilMisc.toMap("contentId", contentRoot));
 
-// get all subsite content for the publish point
-List subsites = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentRoot, "contentAssocTypeId", "SUBSITE"));
-context.put("subsites", subsites);
\ No newline at end of file
+    context.put("contentRoot", contentRoot);
+    context.put("content", content);
+    context.put("publishPoint", publishPoint);
+    Debug.log("CnRt: " + contentRoot + " -- PP: " + publishPoint);
+
+    // get all subsite content for the publish point
+    List subsites = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", contentRoot, "contentAssocTypeId", "SUBSITE"));
+    context.put("subsites", subsites);
+}
\ No newline at end of file

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=510737&r1=510736&r2=510737
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl (original)
+++ ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSContent.ftl Thu Feb 22 16:54:55 2007
@@ -27,9 +27,8 @@
 
 <!-- cms menu bar -->
 <div id="cmsmenu" style="margin-bottom: 8px;">
-    <#if (content?has_content)>
-        <a href="javascript:void(0);" onclick="javascript:callEditor();" class="tabButton">New Content</a>
-        <a href="javascript:void(0);" onclick="javascript:callEditor(true, '${content.contentId}');" class="tabButton">New SubContent</a>
+    <#if (content?has_content)>        
+        <a href="javascript:void(0);" onclick="javascript:callEditor(true, '${content.contentId}');" class="tabButton">New Content</a>
         <a href="javascript:void(0);" onclick="javascript:callPathAlias('${content.contentId}');" class="tabButton">New PathAlias</a>
     </#if>
 </div>
@@ -42,7 +41,7 @@
 
 <form name="cmsform" method="post" action="<@ofbizUrl>${formAction}</@ofbizUrl>" style="margin: 0;">
     <#if (content?has_content)>
-        <input type="hidden" name="dataResourceId" value="${dataText.dataResourceId}"/>        
+        <input type="hidden" name="dataResourceId" value="${(dataText.dataResourceId)?if_exists}"/>        
         <input type="hidden" name="mimeTypeId" value="${content.mimeTypeId?default(mimeTypeId)}"/>
         <input type="hidden" name="contentId" value="${content.contentId}"/>
 

Modified: ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSEditor.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSEditor.ftl?view=diff&rev=510737&r1=510736&r2=510737
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSEditor.ftl (original)
+++ ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSEditor.ftl Thu Feb 22 16:54:55 2007
@@ -64,11 +64,6 @@
       <tr>
         <td align="right" colspan="2">
             <div id="cmseditor" style="margin: 0; border: 1px solid black;">
-                <#--
-                <div id="cmseditor" dojoType="Editor2" minHeight="300px" style="border: 1px solid black;">
-                    ${(dataText.textData)?if_exists}
-                </div>
-                -->
             </div>
         </td>
       </tr>
@@ -80,5 +75,3 @@
       </tr>
     </table>
 </div>
-
-<#--<textarea id="raw" cols="80" rows="40">${(dataText.textData)?if_exists}</textarea>-->
\ No newline at end of file

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=510737&r1=510736&r2=510737
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl (original)
+++ ofbiz/trunk/applications/content/webapp/content/website/WebSiteCMSNav.ftl Thu Feb 22 16:54:55 2007
@@ -27,8 +27,8 @@
     dojo.require("dojo.io.*");
 
     var treeSelected = false;
-    var contentRoot = '${contentRoot}';
- var webSiteId = '${webSiteId}';        
+    var contentRoot = '${contentRoot?if_exists}';
+ var webSiteId = '${webSiteId?if_exists}';        
     var editorUrl = '<@ofbizUrl>/views/WebSiteCMSContent</@ofbizUrl>';
     var aliasUrl = '<@ofbizUrl>/views/WebSiteCMSPathAlias</@ofbizUrl>';
         
@@ -146,11 +146,6 @@
                 var editPage = dojo.byId('cmscontent');
                 editPage.innerHTML = data;
 
-                //dojo.byId("raw").value = data;
-
-                // make sure the editor is displayed
-                //dojo.html.show("editorcontainer");
-
                 // load the data
                 var cmsdata = dojo.byId("cmsdata");
 
@@ -224,25 +219,11 @@
 </#macro>
 
 <div class="tableheadtext">
-    Website Content
-    <#-- &nbsp;<a href="javascript:void(0);" onclick="javascript:callEditor();" class="buttontext">New Content</a>  -->
+    Website Content    
 </div>
 <dojo:TreeSelector widgetId="webCmsTreeSelector" eventNames="select:webCmsNodeSelected"></dojo:TreeSelector>
 <div dojoType="Tree" widgetId="webCmsTree" selector="webCmsTreeSelector" toggler="fade" toggleDuration="500">
     <#if (subsites?has_content)>
         <@fillTree assocList = subsites/>
     </#if>
-    
-    <#--
-    <#list subsites as subsite>
-        <#assign thisContent = subsite.getRelatedOne("ToContent")/>
-        <div dojoType="TreeNode" title="${thisContent.contentName?default(subsite.contentIdTo)}" widgetId="${subsite.contentIdTo}"
-                object="${subsite.contentId}|${subsite.contentAssocTypeId}|${subsite.fromDate}">
-            <#assign assocs = thisContent.getRelated("ContentAssoc")?if_exists/>
-            <#if (assocs?has_content)>
-
-            </#if>
-        </div>
-    </#list>
-    -->
 </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=510737&r1=510736&r2=510737
==============================================================================
--- ofbiz/trunk/applications/content/widget/WebSiteScreens.xml (original)
+++ ofbiz/trunk/applications/content/widget/WebSiteScreens.xml Thu Feb 22 16:54:55 2007
@@ -175,13 +175,18 @@
                 <set field="labelTitleProperty" value="PageTitleEditWebSiteCMS"/>
                 <set field="webSiteId" from-field="parameters.webSiteId"/>
                 <entity-one entity-name="WebSite" value-name="webSite"/>
-
+                
                 <script location="component://content/webapp/content/WEB-INF/actions/website/WebSitePublishPoint.bsh"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonWebSiteDecorator">
                     <decorator-section name="body">
                         <section>
+                            <condition>
+                                <not>
+                                    <if-empty field-name="contentRoot"/>
+                                </not>                                
+                            </condition>
                             <widgets>                                                                
                                 <container id="cmsnav" style="left-border">
                                     <include-screen name="WebSiteCMSNav"/>
@@ -193,6 +198,11 @@
                                     <include-screen name="WebSiteCMSEditor"/>                                    
                                 </container>                                                                
                             </widgets>
+                            <fail-widgets>
+                                <container id="norender" style="tableheadtext">
+                                    <label text="There is no Content PUBLISH_POINT for this WebSite!"/>
+                                </container>
+                            </fail-widgets>
                         </section>
                     </decorator-section>
                 </decorator-screen>