You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2006/11/25 17:17:55 UTC

svn commit: r479140 - in /incubator/ofbiz/trunk/applications/content: src/org/ofbiz/content/webapp/ftl/ webapp/content/WEB-INF/ webapp/content/WEB-INF/pagedefs/layout/ webapp/content/layout/ webapp/content/templates/ widget/layout/

Author: jacopoc
Date: Sat Nov 25 08:17:54 2006
New Revision: 479140

URL: http://svn.apache.org/viewvc?view=rev&rev=479140
Log:
A bunch of cleanups for the Content component and one more JPublish page converted to screen widget.

Added:
    incubator/ofbiz/trunk/applications/content/webapp/content/layout/renderSubContent.ftl   (with props)
Removed:
    incubator/ofbiz/trunk/applications/content/webapp/content/WEB-INF/pagedefs/layout/EditLayout.xml
    incubator/ofbiz/trunk/applications/content/webapp/content/layout/EditLayout.ftl
    incubator/ofbiz/trunk/applications/content/webapp/content/layout/LookupListLayout.ftl
    incubator/ofbiz/trunk/applications/content/webapp/content/layout/LookupSubContent.ftl
    incubator/ofbiz/trunk/applications/content/webapp/content/templates/basic.ftl
    incubator/ofbiz/trunk/applications/content/webapp/content/templates/lookup.ftl
    incubator/ofbiz/trunk/applications/content/webapp/content/templates/lookup.xml
    incubator/ofbiz/trunk/applications/content/webapp/content/templates/plain.ftl
    incubator/ofbiz/trunk/applications/content/webapp/content/templates/wrap.ftl
    incubator/ofbiz/trunk/applications/content/webapp/content/templates/wrap.xml
Modified:
    incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java
    incubator/ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
    incubator/ofbiz/trunk/applications/content/webapp/content/layout/LayoutMenus.xml
    incubator/ofbiz/trunk/applications/content/widget/layout/LayoutScreens.xml

Modified: incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java?view=diff&rev=479140&r1=479139&r2=479140
==============================================================================
--- incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java (original)
+++ incubator/ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java Sat Nov 25 08:17:54 2006
@@ -73,6 +73,7 @@
         final String subDataResourceTypeId = getArg(args, "subDataResourceTypeId", ctx);
         final String contentId = getArg(args, "contentId", ctx);
         final String mimeTypeId = getArg(args, "mimeTypeId", ctx);
+        final String throwExceptionOnError = getArg(args, "throwExceptionOnError", ctx);
         final Locale locale = (Locale) FreeMarkerWorker.getWrappedObject("locale", env);
         final HttpServletRequest request = (HttpServletRequest) FreeMarkerWorker.getWrappedObject("request", env);
         final GenericDelegator delegator = (GenericDelegator) FreeMarkerWorker.getWrappedObject("delegator", env);
@@ -106,7 +107,9 @@
                 try {
                     renderSubContent();
                 } catch (IOException e) {
-                    throw new IOException(e.getMessage());
+                    if (!"false".equals(throwExceptionOnError)) {
+                        throw new IOException(e.getMessage());
+                    }
                 }
             }
 

Modified: incubator/ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml?view=diff&rev=479140&r1=479139&r2=479140
==============================================================================
--- incubator/ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml (original)
+++ incubator/ofbiz/trunk/applications/content/webapp/content/WEB-INF/controller.xml Sat Nov 25 08:17:54 2006
@@ -1594,7 +1594,7 @@
 
     <view-map name="ListLayout" page="component://content/widget/layout/LayoutScreens.xml#ListLayout" type="screen"/>
     <view-map name="FindLayout" page="component://content/widget/layout/LayoutScreens.xml#FindLayout" type="screen"/>
-    <view-map name="EditLayout" page="/layout/EditLayout.ftl" type="jpublish"/>
+    <view-map name="EditLayout" page="component://content/widget/layout/LayoutScreens.xml#EditLayout" type="screen"/>
     <view-map name="AddLayout" page="/layout/AddLayout.ftl" type="jpublish"/>
     <view-map name="EditLayoutSubContent" page="/layout/EditLayoutSubContent.ftl" type="jpublish"/>
     <view-map name="EditLayoutText" page="/layout/EditLayoutText.ftl" type="jpublish"/>

Modified: incubator/ofbiz/trunk/applications/content/webapp/content/layout/LayoutMenus.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/content/webapp/content/layout/LayoutMenus.xml?view=diff&rev=479140&r1=479139&r2=479140
==============================================================================
--- incubator/ofbiz/trunk/applications/content/webapp/content/layout/LayoutMenus.xml (original)
+++ incubator/ofbiz/trunk/applications/content/webapp/content/layout/LayoutMenus.xml Sat Nov 25 08:17:54 2006
@@ -33,28 +33,47 @@
         <menu-item name="FindLayout" title="${uiLabelMap.CommonFind}" >
             <link target="FindLayout" target-window="_top" style="tabButton" />
         </menu-item>
-        <menu-item name="EditLayout" title="${uiLabelMap.CommonEdit}" >
-            <link target="EditLayout" target-window="_top" style="tabButton" />
+        <menu-item name="EditLayout" title="${uiLabelMap.CommonEdit}">
+            <condition>
+                <not><if-empty field-name="parameters.contentId"/></not>
+            </condition>
+            <link target="EditLayout?contentId=${parameters.contentId}" target-window="_top" style="tabButton" />
         </menu-item>
-        <!--
         <menu-item name="EditLayoutContent" title="${uiLabelMap.ContentSubContent}" >
-            <link target="EditLayoutContent" target-window="_top" style="tabButton" />
+            <condition>
+                <not><if-empty field-name="parameters.contentId"/></not>
+            </condition>
+            <link target="EditLayoutContent?contentId=${parameters.contentId}" target-window="_top" style="tabButton" />
         </menu-item>
         <menu-item name="EditLayoutText" title="${uiLabelMap.ContentText}" >
-            <link target="EditLayoutText" target-window="_top" style="tabButton" />
+            <condition>
+                <not><if-empty field-name="parameters.contentId"/></not>
+            </condition>
+            <link target="EditLayoutText?contentId=${parameters.contentId}" target-window="_top" style="tabButton" />
         </menu-item>
         <menu-item name="EditLayoutHtml" title="${uiLabelMap.ContentHtml}" >
-            <link target="EditLayoutHtml" target-window="_top" style="tabButton" />
+            <condition>
+                <not><if-empty field-name="parameters.contentId"/></not>
+            </condition>
+            <link target="EditLayoutHtml?contentId=${parameters.contentId}" target-window="_top" style="tabButton" />
         </menu-item>
         <menu-item name="EditLayoutImage" title="${uiLabelMap.ContentImage}" >
-            <link target="EditLayoutImage" target-window="_top" style="tabButton" />
+            <condition>
+                <not><if-empty field-name="parameters.contentId"/></not>
+            </condition>
+            <link target="EditLayoutImage?contentId=${parameters.contentId}" target-window="_top" style="tabButton" />
         </menu-item>
         <menu-item name="EditLayoutUrl" title="${uiLabelMap.ContentUrl}" >
-            <link target="EditLayoutUrl" target-window="_top" style="tabButton" />
+            <condition>
+                <not><if-empty field-name="parameters.contentId"/></not>
+            </condition>
+            <link target="EditLayoutUrl?contentId=${parameters.contentId}" target-window="_top" style="tabButton" />
         </menu-item>
         <menu-item name="EditLayoutFile" title="${uiLabelMap.ContentFile}" >
-            <link target="EditLayoutFile" target-window="_top" style="tabButton" />
+            <condition>
+                <not><if-empty field-name="parameters.contentId"/></not>
+            </condition>
+            <link target="EditLayoutFile?contentId=${parameters.contentId}" target-window="_top" style="tabButton" />
         </menu-item>
-        -->
     </menu>
 </menus>

Added: incubator/ofbiz/trunk/applications/content/webapp/content/layout/renderSubContent.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/content/webapp/content/layout/renderSubContent.ftl?view=auto&rev=479140
==============================================================================
--- incubator/ofbiz/trunk/applications/content/webapp/content/layout/renderSubContent.ftl (added)
+++ incubator/ofbiz/trunk/applications/content/webapp/content/layout/renderSubContent.ftl Sat Nov 25 08:17:54 2006
@@ -0,0 +1,23 @@
+<#--
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+
+<hr/>
+<#if parameters.contentId?exists>
+    <#assign id=parameters.contentId/>
+    <@editRenderSubContent contentId="TEMPLATE_MASTER" mapKey="" editTemplate="true" subContentId=id?if_exists>
+        <@renderSubContent throwExceptionOnError="false"/>
+    </...@editRenderSubContent>
+</#if>

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

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

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

Modified: incubator/ofbiz/trunk/applications/content/widget/layout/LayoutScreens.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/content/widget/layout/LayoutScreens.xml?view=diff&rev=479140&r1=479139&r2=479140
==============================================================================
--- incubator/ofbiz/trunk/applications/content/widget/layout/LayoutScreens.xml (original)
+++ incubator/ofbiz/trunk/applications/content/widget/layout/LayoutScreens.xml Sat Nov 25 08:17:54 2006
@@ -72,25 +72,25 @@
     <screen name="EditLayout">
         <section>
             <condition>
-                <if-has-permission permission="CONTENTMGR" action="VIEW"/>
+                <if-has-permission permission="CONTENTMGR" action="_UPDATE"/>
             </condition>
             <actions>
                 <set field="titleProperty" value="PageTitleEditLayout"/>
                 <set field="headerItem" value="Layout"/>
                 <set field="tabButtonItem" to-scope="user" value="EditLayout"/>
-                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
-                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="50"/>
-                <entity-and entity-name="ContentDataResourceView" list-name="layoutList">
-                    <field-map field-name="caContentIdTo" value="TEMPLATE_MASTER"/>
-                </entity-and>
+                
+                <set field="wrapTemplateId" value="STDWRAP001"/>
+                <entity-one entity-name="ContentDataResourceView" value-name="currentValue"/>
             </actions>
             <widgets>
                 <decorator-screen name="commonLayoutDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
-                        <container>
-                            <link target="EditLayoutSubContent?mode=add&amp;contentIdTo=TEMPLATE_MASTER" text="${uiLabelMap.CommonCreateNew}" style="buttontext"/>
-                        </container>
-                        <include-form name="listListLayout" location="component://content/webapp/content/layout/LayoutForms.xml"/>
+                        <include-form name="EditLayout" location="component://content/webapp/content/layout/LayoutForms.xml"/>
+                        <platform-specific>
+                            <html>
+                                <html-template location="component://content/webapp/content/layout/renderSubContent.ftl"/>
+                            </html>
+                        </platform-specific>
                     </decorator-section>
                 </decorator-screen>
             </widgets>