Added the <include-portal-page> widget. OFBIZ-3625 https://issues.apache.org/jira/browse/OFBIZ-3625

Using this widget, a PortalPage can now be easily rendered in any screen.
At the bottom of the page an "Edit ON/OFF" button can be used to switch the PortalPage edit mode ON and OFF so that the Portal Page can be edited "in place".
All the portlet editing requests are handled using the "save-last-view" request attribute so that a dedicated screen can be shown to set the Portlet attributes and the column width and, when submitted, the user is taken back to the portal page he was editing.

Those new requests will be used in a later commit to eliminate all the duplicated ****Adm requests that have been introduced when the Webtools portal admin screen has been created.
A simple use of the widget has been added in the Example application.

TODO:
- At the moment the portal page editing is performed on the portal page itself and no portal derivation from the "main" one is performed. This will be done in a later commit.
- The portlet moving controls both manually and by drag and drop have not been implemented yet.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@998570 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bruno Busco
2010-09-19 00:09:39 +00:00
parent 05559fc0e5
commit 3bbd2d8598
21 changed files with 667 additions and 41 deletions
@@ -24,6 +24,7 @@ under the License.
<menu-item name="ExampleMenuItem" title="${uiLabelMap.ExampleExample}"><link target="FindExample"/></menu-item>
<menu-item name="ExampleFeature" title="${uiLabelMap.ExampleFeature}"><link target="FindExampleFeature"/></menu-item>
<menu-item name="FormWidgetExamples" title="${uiLabelMap.ExampleFormWidgetExamples}"><link target="FormWidgetExamples"/></menu-item>
<menu-item name="PortalPageWidgetExamples" title="${uiLabelMap.ExamplePortalPageWidgetExamples}"><link target="PortalPageWidgetExamples"/></menu-item>
<menu-item name="AjaxExample" title="${uiLabelMap.ExampleAjaxExamples}"><link target="authview/findExampleAjax"/></menu-item>
<menu-item name="portalPage" parent-portal-page-value="${parameters.parentPortalPageId}"/>
<menu-item name="Dashboard" title="${uiLabelMap.ExampleDashboard}" align-style="opposed">
@@ -466,4 +466,18 @@ under the License.
</widgets>
</section>
</screen>
<screen name="PortalPageWidgetExampleScreen">
<section>
<actions>
<set field="tabButtonItem" value="PortalPageWidgetExamples"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<include-portal-page id="PartyProfile" edit-mode="${parameters.editmode}"/>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
</screens>
@@ -22,7 +22,7 @@ under the License.
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
<form name="ExamplePortlet1Edit" extends="CommonPortletEdit" extends-resource="component://common/widget/PortletEditForms.xml">
<field name="ItemsToShow" entry-name="attributeMap.ItemsToShow">
<field name="ItemsToShow">
<drop-down allow-empty="false">
<option key="5"/>
<option key="15"/>
@@ -32,20 +32,17 @@ under the License.
<option key="35"/>
</drop-down>
</field>
<field name="SpecificTitle" entry-name="attributeMap.SpecificTitle">
<text/>
</field>
<field name="Nuovo" entry-name="attributeMap.Nuovo">
<field name="SpecificTitle">
<text/>
</field>
<field name="updateButton"><submit/></field>
</form>
<form name="ExamplePortlet3Edit" extends="CommonPortletEdit" extends-resource="component://common/widget/PortletEditForms.xml">
<field name="SpecificTitle" entry-name="attributeMap.SpecificTitle">
<field name="SpecificTitle">
<text/>
</field>
<field name="SpecificSubTitle" entry-name="attributeMap.SpecificSubTitle">
<field name="SpecificSubTitle">
<text/>
</field>
<field name="updateButton"><submit/></field>
@@ -25,8 +25,6 @@ under the License.
<section>
<actions>
<property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/>
<!-- TODO: figure out why this isn't getting the request object and requestAttributes is not updated either: <script location="component://common/script/org/ofbiz/common/PortalPageMethods.xml#getPortletAttributes"/>-->
<script location="component://common/webcommon/WEB-INF/actions/includes/retrievePortletAttributes.groovy"/>
</actions>
<widgets>
<label text="${uiLabelMap.ExamplePortletFirst}"/>
@@ -50,7 +48,6 @@ under the License.
<section>
<actions>
<property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/>
<script location="component://common/webcommon/WEB-INF/actions/includes/retrievePortletAttributes.groovy"/>
</actions>
<widgets>
<container style="leftclear">