svn commit: r589503 - in /ofbiz/trunk/applications/content: config/ webapp/content/WEB-INF/ webapp/content/content/ widget/content/

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

svn commit: r589503 - in /ofbiz/trunk/applications/content: config/ webapp/content/WEB-INF/ webapp/content/content/ widget/content/

hansbak-2
Author: hansbak
Date: Sun Oct 28 23:18:08 2007
New Revision: 589503

URL: http://svn.apache.org/viewvc?rev=589503&view=rev
Log:
add a navigation option to the dataResource option in the content manager using a dojo tree widget to be able to browse dataresources by datacategories. This following Al's example in the website cms function

Added:
    ofbiz/trunk/applications/content/webapp/content/content/nav.ftl   (with props)
Modified:
    ofbiz/trunk/applications/content/config/ContentUiLabels.properties
    ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
    ofbiz/trunk/applications/content/widget/content/ContentMenus.xml
    ofbiz/trunk/applications/content/widget/content/DataResourceForms.xml
    ofbiz/trunk/applications/content/widget/content/DataResourceMenus.xml
    ofbiz/trunk/applications/content/widget/content/DataResourceScreens.xml

Modified: ofbiz/trunk/applications/content/config/ContentUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/config/ContentUiLabels.properties?rev=589503&r1=589502&r2=589503&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/config/ContentUiLabels.properties (original)
+++ ofbiz/trunk/applications/content/config/ContentUiLabels.properties Sun Oct 28 23:18:08 2007
@@ -69,6 +69,7 @@
 ContentFile=File
 ContentHtml=Html
 ContentImage=Image
+ContentNavigate=Navigate
 ContentUrl=Url
 ContentPaste=Paste
 ContentSubSites=SubSites

Modified: ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml?rev=589503&r1=589502&r2=589503&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml Sun Oct 28 23:18:08 2007
@@ -500,6 +500,16 @@
         <security auth="true" https="true"/>
         <response name="success" type="view" value="FindDataResource"/>
     </request-map>
+    <request-map uri="navigateDataResource">
+        <security auth="true" https="true"/>
+        <response name="success" type="view" value="navigateDataResource"/>
+    </request-map>
+    
+    <request-map uri="listDataResources">
+        <security auth="true" https="true"/>
+        <response name="success" type="view" value="listDataResources"/>
+    </request-map>
+    
     <request-map uri="EditDataResourceType">
         <security auth="true" https="true"/>
         <response name="success" type="view" value="EditDataResourceType"/>
@@ -1635,6 +1645,7 @@
         <security auth="true" https="true"/>
         <response name="success" type="view" value="LookupSurveyResponse"/>
     </request-map>
+    
     <!-- lookup other components -->    
     <request-map uri="LookupPerson"><security auth="true" https="true"/><response name="success" type="view" value="LookupPerson"/></request-map>
     <request-map uri="LookupPartyAndUserLoginAndPerson"><security auth="true" https="true"/><response name="success" type="view" value="LookupPartyAndUserLoginAndPerson"/></request-map>
@@ -1685,6 +1696,8 @@
     <view-map name="EditContentWorkEfforts" page="component://content/widget/content/ContentScreens.xml#EditContentWorkEfforts" type="screen"/>
     
     <view-map name="FindDataResource"  page="component://content/widget/content/DataResourceScreens.xml#FindDataResource" type="screen"/>
+    <view-map name="navigateDataResource" type="screen" page="component://content/widget/content/DataResourceScreens.xml#navigateDataResource"/>
+    <view-map name="listDataResources" type="screen" page="component://content/widget/content/DataResourceScreens.xml#listDataResources"/>
     <view-map name="UploadImage"  page="component://content/widget/content/DataResourceScreens.xml#UploadImage" type="screen"/>
     <view-map name="EditDataResource"  page="component://content/widget/content/DataResourceScreens.xml#EditDataResource" type="screen"/>
     <view-map name="AddDataResource"  page="component://content/widget/content/DataResourceScreens.xml#AddDataResource" type="screen"/>

Added: ofbiz/trunk/applications/content/webapp/content/content/nav.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/webapp/content/content/nav.ftl?rev=589503&view=auto
==============================================================================
--- ofbiz/trunk/applications/content/webapp/content/content/nav.ftl (added)
+++ ofbiz/trunk/applications/content/webapp/content/content/nav.ftl Sun Oct 28 23:18:08 2007
@@ -0,0 +1,95 @@
+<#--
+  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.
+  -->
+
+<script type="text/javascript">
+    
+    dojo.require("dojo.widget.*");
+    dojo.require("dojo.event.*");
+    dojo.require("dojo.io.*");
+
+    var treeSelected = false;
+
+    dojo.addOnLoad(function() {
+            dojo.event.topic.subscribe("showDataResources",
+             function(message) {
+                treeSelected = true;
+                var ctx = new Array();
+                ctx['dataCategoryId'] = message.node.widgetId;
+                callOfbiz('<@ofbizUrl>listDataResources</@ofbizUrl>', ctx);
+             }
+        );
+        var cmsdata = dojo.byId("cmsdata");
+    });
+    
+    
+    function callOfbiz(url, ctx) {
+        var bindArgs = {
+            url: url,
+            method: 'POST',
+            mimetype: 'text/html',
+            content: ctx,
+            error: function(type, data, evt) {
+                alert("An error occured loading content! : " + data);
+            },
+            load: function(type, data, evt) {
+                var innerPage = dojo.byId('cmscontent');
+                innerPage.innerHTML = data;                
+            }
+        };
+        dojo.io.bind(bindArgs);
+    }
+</script>
+
+<style>
+.dojoContextMenu {
+ background-color: #ccc;
+ font-size: 10px;
+}
+</style>
+
+<#-- looping macro -->
+<#macro fillTree assocList>
+  <#if (assocList?has_content)>
+    <#list assocList as assoc>
+        <div dojoType="TreeNode" title="${assoc.categoryName?default(assoc.dataCategoryId)}" widgetId="${assoc.dataCategoryId}"
+                object="${assoc.dataCategoryId}">
+            <#assign assocs = assoc.getRelated("ChildDataCategory")?if_exists/>
+            <#if (assocs?has_content)>
+                <@fillTree assocList = assocs/>
+            </#if>
+        </div>
+    </#list>
+  </#if>
+</#macro>
+
+<!--dl dojoType="TreeContextMenu" id="contextMenu" style="font-size: 1em; color: #ccc;">
+    <dt dojoType="TreeMenuItem" id="newCat" caption="New Category"/>
+    <dt dojoType="TreeMenuItem" id="delCat" caption="Remove Category"/>
+    <dt dojoType="TreeMenuItem" id="editCat" caption="Edit Category"/>
+    <dt dojoType="TreeMenuItem" id="upLoad" caption="Upload file"/>
+</dl-->
+
+<dojo:TreeSelector widgetId="webCmsTreeSelector" eventNames="select:showDataResources"></dojo:TreeSelector>
+<div dojoType="Tree" widgetId="webCmsTree" selector="webCmsTreeSelector" toggler="fade" toggleDuration="500">
+    <#if (subCategories?has_content)>
+        <@fillTree assocList = subCategories/>    
+    </#if>
+</div>
+
+

Propchange: ofbiz/trunk/applications/content/webapp/content/content/nav.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

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

Propchange: ofbiz/trunk/applications/content/webapp/content/content/nav.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/content/widget/content/ContentMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/content/ContentMenus.xml?rev=589503&r1=589502&r2=589503&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/widget/content/ContentMenus.xml (original)
+++ ofbiz/trunk/applications/content/widget/content/ContentMenus.xml Sun Oct 28 23:18:08 2007
@@ -32,6 +32,7 @@
         <menu-item name="Layout" title="${uiLabelMap.ContentTemplate}"><link target="LayoutMenu"/></menu-item>
         <menu-item name="CMS" title="${uiLabelMap.ContentCMS}"><link target="CMSContentFind"/></menu-item>
         <menu-item name="CompDoc" title="${uiLabelMap.ContentCompDoc}"><link target="FindCompDoc"/></menu-item>
+        <menu-item name="dmsNav" title="${uiLabelMap.ContentDMS}"><link target="dmsNav"/></menu-item>
         
         <menu-item name="Logout" title="${uiLabelMap.CommonLogout}" align-style="col-right" widget-style="headerButtonRight" selected-style="headerButtonRightSelected">
             <condition><not><if-empty field-name="userLogin"/></not></condition>

Modified: ofbiz/trunk/applications/content/widget/content/DataResourceForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/content/DataResourceForms.xml?rev=589503&r1=589502&r2=589503&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/widget/content/DataResourceForms.xml (original)
+++ ofbiz/trunk/applications/content/widget/content/DataResourceForms.xml Sun Oct 28 23:18:08 2007
@@ -75,7 +75,7 @@
         <field name="statusId"><display-entity entity-name="StatusItem" description="${description}"></display-entity></field>
         <field name="localeString"><display-entity entity-name="CountryCode" description="${countryName}[${countryCode}]" key-field-name="countryCode"></display-entity></field>
         <field name="createdByUserLogin"><display-entity also-hidden="false" entity-name="PartyNameView" key-field-name="partyId" description="${groupName}${firstName} ${lastName}"/></field>
-        <field name="dataCategoryId"><display-entity entity-name="DataCategory" description="${categoryName}[${datacategoryId}]"></display-entity></field>
+        <field name="dataCategoryId"><display-entity entity-name="DataCategory" description="${categoryName}[${dataCategoryId}]"></display-entity></field>
     </form>
     
     <form name="LookupDataResource" target="LookupDataResource" title="" type="single">

Modified: ofbiz/trunk/applications/content/widget/content/DataResourceMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/content/DataResourceMenus.xml?rev=589503&r1=589502&r2=589503&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/widget/content/DataResourceMenus.xml (original)
+++ ofbiz/trunk/applications/content/widget/content/DataResourceMenus.xml Sun Oct 28 23:18:08 2007
@@ -75,9 +75,15 @@
         </menu-item>
     </menu>
     <menu name="dataresource">
-        <menu-item name="editDataResource" title="${uiLabelMap.ContentDataResource}" >
+        <menu-item name="findDataResource" title="${uiLabelMap.CommonFind}">
+            <link target="findDataResource"/>
+        </menu-item>
+        <menu-item name="navigateDataResource" title="${uiLabelMap.ContentNavigate}">
+            <link target="navigateDataResource"/>
+        </menu-item>
+        <menu-item name="editDataResource" title="${uiLabelMap.CommonNew}">
             <condition>
-                <not><if-empty field-name="currentValue.dataResourceId"/></not>
+                <if-empty field-name="currentValue.dataResourceId"/>
             </condition>
             <link target="editDataResource?dataResourceId=${parameters.dataResourceId}"/>
         </menu-item>

Modified: ofbiz/trunk/applications/content/widget/content/DataResourceScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/widget/content/DataResourceScreens.xml?rev=589503&r1=589502&r2=589503&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/widget/content/DataResourceScreens.xml (original)
+++ ofbiz/trunk/applications/content/widget/content/DataResourceScreens.xml Sun Oct 28 23:18:08 2007
@@ -23,20 +23,77 @@
         <section>
             <actions>
                 <set field="headerItem" value="DataResource"/>
+                <set field="tabButtonItem" value="findDataResource"/>
                 <set field="titleProperty" value="PageTitleFindDataResource"/>
                 <set field="viewIndex" from-field="requestParameters.VIEW_INDEX" type="Integer"/>
                 <set field="viewSize" from-field="requestParameters.VIEW_SIZE" type="Integer" default-value="30"/>
             </actions>
             <widgets>
-                <decorator-screen name="main-decorator"  location="${parameters.mainDecoratorLocation}">
+                <decorator-screen name="commonDataResourceDecorator"  location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
-                        <container><link target="editDataResource" text="${uiLabelMap.CommonCreateNew}" style="buttontext"/></container>
-                        <label style="head1" text="${uiLabelMap.PageTitleFindDataResource}"/>
                         <include-form name="FindDataResource" location="component://content/widget/content/DataResourceForms.xml"/>
                         <label style="head1" text="${uiLabelMap.PageTitleListDataResource}"></label>
                         <include-form name="ListDataResource" location="component://content/widget/content/DataResourceForms.xml"/>
                     </decorator-section>
                 </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="navigateDataResource">
+        <section>
+            <actions>
+                <set field="layoutSettings.javaScripts[+0]" value="/images/dojo/dojo.js" global="true"/>
+                <set field="titleProperty" value="PageTitleEditWebSiteCMS"/>
+                <set field="tabButtonItem" value="navigateDataResource"/>
+                <set field="labelTitleProperty" value="PageTitleEditWebSiteCMS"/>
+                <entity-and entity-name="DataCategory" list-name="subCategories">
+                    <field-map field-name="parentCategoryId" value="ROOT"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="commonDataResourceDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>                                                                
+                                <container id="cmsnav" style="left-border">
+                                    <include-screen name="navigateMenu"/>
+                                </container>
+                                <container id="cmsmain" style="nocolumns">
+                                    <container id="cmscontent">
+                                        <include-screen name="listDataResources"/>
+                                    </container>    
+                                </container>                                                                
+                            </widgets>
+                            <fail-widgets>
+                                <container id="norender" style="tableheadtext">
+                                    <label text="${uiLabelMap.ContentCMSNotExist}"/>
+                                </container>
+                            </fail-widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="navigateMenu">
+        <section>
+            <widgets>
+                <platform-specific>
+                    <html>
+                        <html-template location="component://content/webapp/content/content/nav.ftl"/>
+                    </html>
+                </platform-specific>
+            </widgets>
+        </section>
+    </screen>
+    
+    <screen name="listDataResources">
+        <section>
+            <actions>
+                <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
+            </actions>
+            <widgets>
+                <include-form name="ListDataResource" location="component://content/widget/content/DataResourceForms.xml"/>
             </widgets>
         </section>
     </screen>