svn commit: r908602 - in /ofbiz/trunk/applications: content/script/org/ofbiz/content/layout/ product/config/ product/entitydef/ product/script/org/ofbiz/product/storage/ product/servicedef/ product/webapp/facility/WEB-INF/ product/widget/facility/

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

svn commit: r908602 - in /ofbiz/trunk/applications: content/script/org/ofbiz/content/layout/ product/config/ product/entitydef/ product/script/org/ofbiz/product/storage/ product/servicedef/ product/webapp/facility/WEB-INF/ product/widget/facility/

bibryam
Author: bibryam
Date: Wed Feb 10 17:52:50 2010
New Revision: 908602

URL: http://svn.apache.org/viewvc?rev=908602&view=rev
Log:
Added possibility to upload files and assign contents to facilities.
Created FacilityContent entity and FacilityContentDetail view entity. Added screen and forms in facility application for content upload and deletion.

Added a generic event in content application for file upload and content association which is used in facility application. The same event can be used in content creation processes in order manager and project manager applications in order to remove duplicating code.

Added:
    ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/FacilityEvents.xml
Modified:
    ofbiz/trunk/applications/content/script/org/ofbiz/content/layout/LayoutEvents.xml
    ofbiz/trunk/applications/product/config/ProductUiLabels.xml
    ofbiz/trunk/applications/product/entitydef/entitymodel.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/StorageServices.xml
    ofbiz/trunk/applications/product/servicedef/services_facility.xml
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml

Modified: ofbiz/trunk/applications/content/script/org/ofbiz/content/layout/LayoutEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/script/org/ofbiz/content/layout/LayoutEvents.xml?rev=908602&r1=908601&r2=908602&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/script/org/ofbiz/content/layout/LayoutEvents.xml (original)
+++ ofbiz/trunk/applications/content/script/org/ofbiz/content/layout/LayoutEvents.xml Wed Feb 10 17:52:50 2010
@@ -324,4 +324,79 @@
         </call-service>
         <check-errors/>
     </simple-method>
+
+   <simple-method method-name="createGenericContent" short-description="Create Generic Content">
+        <call-class-method class-name="org.ofbiz.content.layout.LayoutWorker"
+            method-name="uploadImageAndParameters" ret-field="formInput">
+            <field field="request" type="javax.servlet.http.HttpServletRequest"/>
+            <string value="dataResourceName"/>
+        </call-class-method>
+
+        <!-- Check input parameters -->
+        <if>
+            <condition>
+                <and>
+                    <if-empty field="formInput.formInput.contentId"/>
+                    <if-empty field="formInput.imageFileName"/>
+                </and>
+            </condition>
+            <then>
+                <add-error>
+                    <fail-message message="Content Id or Upload file is missing."/>
+                </add-error>
+            </then>
+        </if>
+        <check-errors/>
+        <!-- Create new content form upload file / set content from Existing content -->
+        <if-empty field="formInput.formInput.contentId">
+                <if>
+                    <condition>
+                        <or>
+                            <!-- Compare MimeType between upload file and selected MimeType -->
+                            <if-compare-field field="formInput.uploadMimeType" operator="equals" to-field="formInput.formInput.mimeTypeId"/>
+                            <if-compare field="formInput.formInput.mimeTypeId" operator="equals" value="application/octet-stream"/>
+                            <if-compare field="formInput.formInput.mimeTypeId" operator="equals" value=""/>
+                        </or>
+                    </condition>
+                    <then>
+                        <!-- Create new content from upload file -->
+                        <set-service-fields service-name="createContentFromUploadedFile"
+                            map="formInput.formInput" to-map="inMap"/>
+                        <set field="inMap._uploadedFile_fileName" from-field="formInput.imageFileName"/>
+                        <set field="inMap.uploadedFile" from-field="formInput.imageData"/>
+                        <set field="inMap._uploadedFile_contentType" from-field="formInput.uploadMimeType"/>
+                        <call-service service-name="createContentFromUploadedFile" in-map-name="inMap">
+                            <result-to-field result-name="contentId" field="context.contentId"/>
+                        </call-service>
+                    </then>
+                    <else>
+                        <add-error>
+                            <fail-message message="Upload file type not match your selected."/>
+                        </add-error>
+                    </else>
+                </if>
+                <check-errors/>
+            <else>
+                <!--set content from Existing content-->
+                <set field="context.contentId" from-field="formInput.formInput.contentId"/>
+            </else>
+        </if-empty>
+        
+        <!-- create ContentAssoc-->
+        <set-service-fields service-name="createContentAssoc" map="formInput.formInput" to-map="contentMap"/>
+        <if-not-empty field="formInput.formInput.contentIdFrom">
+            <set field="contentMap.contentAssocTypeId" value="SUB_CONTENT"/>
+            <set field="contentMap.contentIdFrom" from-field="formInput.formInput.contentIdFrom"/>
+            <set field="contentMap.contentId" from-field="formInput.formInput.contentIdFrom"/>
+            <set field="contentMap.contentIdTo" from-field="context.contentId"/>
+            <now-timestamp field="contentMap.fromDate"/>
+            <entity-and entity-name="ContentAssoc" list="contentAssoList">
+                <field-map field-name="contentId" from-field="contentMap.contentId"/>
+                <field-map field-name="contentIdTo" from-field="contentMap.contentIdTo"/>
+            </entity-and>
+            <if-empty field="contentAssonList">
+                <call-service service-name="createContentAssoc" in-map-name="contentMap"/>          
+            </if-empty>
+        </if-not-empty>  
+    </simple-method>        
 </simple-methods>

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=908602&r1=908601&r2=908602&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Wed Feb 10 17:52:50 2010
@@ -4933,6 +4933,9 @@
         <value xml:lang="th">แก้ไขวิธีการติดต่อคลังสินค้า</value>
         <value xml:lang="zh">编辑场所联系方式</value>
     </property>
+    <property key="PageTitleEditFacilityContent">
+        <value xml:lang="en">Edit Facility Content for ${facility.facilityName} [${facility.facilityId}]</value>
+    </property>    
     <property key="PageTitleEditFacilityGroup">
         <value xml:lang="de">Einrichtungsgruppe bearbeiten</value>
         <value xml:lang="en">Edit Facility Group</value>
@@ -6876,6 +6879,9 @@
         <value xml:lang="th">เพิ่มสถานะกลุ่มผู้ใช้คลังสินค้า</value>
         <value xml:lang="zh">添加场所会员角色</value>
     </property>
+    <property key="ProductAddFacilityContent">
+        <value xml:lang="en">Add Facility Content</value>
+    </property>
     <property key="ProductAddFeature">
         <value xml:lang="de">Merkmal hinzufügen</value>
         <value xml:lang="en">Add Feature</value>

Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?rev=908602&r1=908601&r2=908602&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Wed Feb 10 17:52:50 2010
@@ -1299,6 +1299,36 @@
             <key-map field-name="roleTypeId"/>
         </relation>
     </entity>
+    <entity entity-name="FacilityContent" package-name="org.ofbiz.product.facility" title="Facility Content Entity">
+        <field name="facilityId" type="id-ne"></field>
+        <field name="contentId" type="id-ne"></field>
+        <field name="fromDate" type="date-time"></field>
+        <field name="thruDate" type="date-time"></field>
+        <prim-key field="facilityId"/>
+        <prim-key field="contentId"/>
+        <prim-key field="fromDate"/>
+        <relation type="one" fk-name="FAC_CNT_FAC" rel-entity-name="Facility">
+            <key-map field-name="facilityId"/>
+        </relation>
+        <relation type="one" fk-name="FAC_CNT_CNT" rel-entity-name="Content">
+            <key-map field-name="contentId"/>
+        </relation>
+    </entity>      
+    <view-entity entity-name="FacilityContentDetail" package-name="org.ofbiz.product.facility" title="Facility Content Detail View Entity">
+        <member-entity entity-alias="FCT" entity-name="FacilityContent"/>
+        <member-entity entity-alias="CNT" entity-name="Content"/>
+        <alias-all entity-alias="FCT"/>
+        <alias-all entity-alias="CNT"/>
+        <view-link entity-alias="FCT" rel-entity-alias="CNT">
+            <key-map field-name="contentId"/>
+        </view-link>
+        <relation type="one-nofk" rel-entity-name="DataResource">
+            <key-map field-name="dataResourceId"/>
+        </relation>
+        <relation type="one-nofk" rel-entity-name="ContentType">
+            <key-map field-name="contentTypeId"/>
+        </relation>
+    </view-entity>
     <entity entity-name="FacilityType" package-name="org.ofbiz.product.facility" default-resource-name="ProductEntityLabels"
         title="Facility Type Entity">
         <field name="facilityTypeId" type="id-ne"></field>

Added: ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/FacilityEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/FacilityEvents.xml?rev=908602&view=auto
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/FacilityEvents.xml (added)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/FacilityEvents.xml Wed Feb 10 17:52:50 2010
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+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.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+    
+    <simple-method method-name="createFacilityContent" short-description="Create Facility Content">
+        <call-simple-method method-name="createGenericContent" xml-resource="component://content/script/org/ofbiz/content/layout/LayoutEvents.xml"/>
+        <set field="facilityContext.facilityId" from-field="formInput.formInput.facilityId"/>
+        <set field="facilityContext.contentId" from-field="context.contentId"/>
+
+        <!-- Create FacilityContent -->
+        <call-service service-name="createFacilityContent" in-map-name="facilityContext">
+            <result-to-field result-name="contentId" field="contentId"/>
+        </call-service>
+    </simple-method>
+</simple-methods>

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/StorageServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/StorageServices.xml?rev=908602&r1=908601&r2=908602&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/StorageServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/StorageServices.xml Wed Feb 10 17:52:50 2010
@@ -221,4 +221,21 @@
         <remove-value value-field="lookedUpValue"/>
     </simple-method>
 
+    <simple-method method-name="createFacilityContent" short-description="Create Facility Content">
+        <make-value entity-name="FacilityContent" value-field="newEntity"/>
+        <set-nonpk-fields map="parameters" value-field="newEntity"/>
+        <set-pk-fields map="parameters" value-field="newEntity"/>
+        <if-empty field="newEntity.fromDate">
+            <now-timestamp field="newEntity.fromDate"/>
+        </if-empty>
+        <create-value value-field="newEntity"/>
+    </simple-method>
+
+    <simple-method method-name="deleteFacilityContent" short-description="Delete Content From Facility">
+        <make-value value-field="lookupPKMap" entity-name="FacilityContent"/>
+        <set-pk-fields map="parameters" value-field="lookupPKMap"/>
+        <find-by-primary-key entity-name="FacilityContent" map="lookupPKMap" value-field="lookedUpValue"/>
+        <now-timestamp field="lookedUpValue.thruDate"/>
+        <store-value value-field="lookedUpValue"/>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/product/servicedef/services_facility.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_facility.xml?rev=908602&r1=908601&r2=908602&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_facility.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_facility.xml Wed Feb 10 17:52:50 2010
@@ -788,6 +788,21 @@
         <attribute name="partyId" type="String" mode="IN" optional="false"/>
         <attribute name="roleTypeId" type="String" mode="IN" optional="false"/>
     </service>
+    
+    <service name="createFacilityContent" engine="simple" default-entity-name="FacilityContent"
+        location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="createFacilityContent" auth="true">
+        <description>Create a Facility Content</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <override name="fromDate" optional="true"/>
+    </service>
+    
+    <service name="deleteFacilityContent" engine="simple" default-entity-name="FacilityContent"
+                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="deleteFacilityContent" auth="true">
+        <description>Delete Content From Facility</description>
+        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
 
     <!-- Stock Move Services -->
     <service name="findStockMovesNeeded" engine="simple"

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml?rev=908602&r1=908601&r2=908602&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Wed Feb 10 17:52:50 2010
@@ -835,6 +835,28 @@
         <response name="success" type="view" value="ShipmentManifest.pdf"/>
     </request-map>
 
+    <!-- Facility Content -->
+    <request-map uri="EditFacilityContent">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditFacilityContent"/>
+    </request-map>
+    <request-map uri="createFacilityContent">
+        <security auth="true" https="true"/>
+        <event path="component://product/script/org/ofbiz/product/storage/FacilityEvents.xml" type="simple" invoke="createFacilityContent"/>
+        <response name="success" type="request-redirect" value="EditFacilityContent">
+            <redirect-parameter name="facilityId"/>
+        </response>
+        <response name="error" type="view" value="EditFacilityContent"/>
+    </request-map>
+    <request-map uri="deleteFacilityContent">
+        <security auth="true" https="true"/>
+        <event invoke="deleteFacilityContent" type="service"/>
+        <response name="success" type="request-redirect" value="EditFacilityContent">
+            <redirect-parameter name="facilityId"/>
+        </response>
+        <response name="error" type="view" value="EditFacilityContent"/>
+    </request-map>
+
     <!-- ================ Shipment Scheduling Requests ================= -->
     <request-map uri="Scheduling">
         <security https="true" auth="true"/>
@@ -1328,6 +1350,7 @@
     <request-map uri="LookupProductInventoryLocation"><security auth="true" https="true"/><response name="success" type="view" value="LookupProductInventoryLocation"/></request-map>
     <request-map uri="LookupPartyName"><security https="true" auth="true"/><response name="success" type="view" value="LookupPartyName"/></request-map>
     <request-map uri="LookupInventoryItem"><security https="true" auth="true"/><response name="success" type="view" value="LookupInventoryItem"/></request-map>
+    <request-map uri="LookupContent"><security auth="true" https="true"/><response name="success" type="view" value="LookupContent"/></request-map>
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
@@ -1393,6 +1416,8 @@
     <view-map name="Labels" type="screen" page="component://product/widget/facility/FacilityScreens.xml#Labels"/>
     <view-map name="BatchPrintShippingLabels" type="screenfop" page="component://product/widget/facility/FacilityScreens.xml#BatchPrintShippingLabels" content-type="application/pdf" encoding="none"/>
 
+    <view-map name="EditFacilityContent" type="screen" page="component://product/widget/facility/FacilityScreens.xml#EditFacilityContent"/>
+
     <view-map name="FindShipment" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#FindShipment"/>
     <view-map name="ViewShipment" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#ViewShipment"/>
     <view-map name="EditShipment" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#EditShipment"/>
@@ -1426,7 +1451,8 @@
     <view-map name="LookupProductInventoryLocation" page="component://product/widget/facility/LookupScreens.xml#LookupProductInventoryLocation" type="screen"/>
     <view-map name="LookupPartyName" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupPartyName"/>
     <view-map name="LookupInventoryItem" type="screen" page="component://product/widget/facility/LookupScreens.xml#LookupInventoryItem"/>
-    
+    <view-map name="LookupContent" type="screen" page="component://content/widget/content/ContentScreens.xml#LookupContent"/>
+
     <!-- Shipment Gateway Config -->
     <view-map name="FindShipmentGatewayConfig" page="component://product//widget/facility/ShipmentGatewayConfigScreens.xml#FindShipmentGatewayConfig" type="screen"/>
     <view-map name="EditShipmentGatewayConfig" page="component://product//widget/facility/ShipmentGatewayConfigScreens.xml#EditShipmentGatewayConfig" type="screen"/>

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml?rev=908602&r1=908601&r2=908602&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml Wed Feb 10 17:52:50 2010
@@ -884,4 +884,49 @@
         <field name="report" title="Export Report" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
 
+    <!--Facility Content-->
+    <form name="AddFacilityContent" type="upload" focus-field-name="contentId"
+        header-row-style="header-row" default-table-style="basic-table" target="createFacilityContent?facilityId=${facilityId}">
+        <field name="facilityId"><hidden/></field>
+        <field name="contentId" title="${uiLabelMap.FormFieldTitle_existContentId}">
+            <lookup target-form-name="LookupContent"/>
+        </field>
+        <field name="contentTypeId" title="${uiLabelMap.FormFieldTitle_contentTypeId}">
+            <drop-down allow-empty="false" no-current-selected-key="DOCUMENT">
+                <entity-options description="${description}" entity-name="ContentType"/>
+            </drop-down>
+        </field>
+        <field name="statusId" title="${uiLabelMap.CommonStatus}">
+            <drop-down allow-empty="false" no-current-selected-key="CTNT_AVAILABLE">
+                <entity-options description="${description}" entity-name="StatusItem" key-field-name="statusId">
+                    <entity-constraint name="statusTypeId" value="CONTENT_STATUS"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="dataResourceName" title="${uiLabelMap.CommonUpload}"><file/></field>
+        <field name="contentIdFrom" title="${uiLabelMap.ContentCompDocParentContentId}"><lookup target-form-name="LookupContent"/></field>
+        <field name="createButton"><submit button-type="button"/></field>
+    </form>
+    
+    <form name="ListFacilityContent" type="list" list-name="facilityContentDetails"
+        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <field name="facilityId"><hidden/></field>
+        <field name="contentId" title="${uiLabelMap.CommonView}">
+            <hyperlink target="/content/control/ViewSimpleContent" description="[${contentId}]" target-type="inter-app">
+                <parameter param-name="contentId"/>
+            </hyperlink>
+        </field>
+        <field name="contentName"><display/></field>
+        <field name="mimeTypeId"><display/></field>
+        <field name="contentTypeId" title="${uiLabelMap.FormFieldTitle_contentTypeId}"><display-entity entity-name="ContentType" also-hidden="false"/></field>
+        <field name="fromDate"><display/></field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+           <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="deleteFacilityContent">
+                <parameter param-name="facilityId"/>
+                <parameter param-name="contentId"/>
+                <parameter param-name="fromDate"/>
+           </hyperlink>
+        </field>  
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml?rev=908602&r1=908601&r2=908602&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml Wed Feb 10 17:52:50 2010
@@ -151,6 +151,11 @@
                 <parameter param-name="lookupFlag" value="Y"/>
             </link>
         </menu-item>
+        <menu-item name="EditFacilityContent" title="${uiLabelMap.ProductContent}">
+            <link target="EditFacilityContent">
+                <parameter param-name="facilityId"/>
+            </link>
+        </menu-item>
     </menu>
     <menu name="InventoryItemLabelsTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
           default-menu-item-name="FindInventoryItemLabels">

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?rev=908602&r1=908601&r2=908602&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Wed Feb 10 17:52:50 2010
@@ -1468,4 +1468,33 @@
         </section>
     </screen>
 
+    <screen name="EditFacilityContent">
+        <section>
+            <actions>
+                <set field="tabButtonItem" value="EditFacilityContent"/>
+                <set field="facilityId" from-field="parameters.facilityId"/>
+                <entity-one entity-name="Facility" value-field="facility"/>
+                <entity-and entity-name="FacilityContentDetail" list="facilityContentDetails" filter-by-date="true">
+                    <field-map field-name="facilityId"/>
+                    <order-by field-name="fromDate"/>
+                </entity-and>
+                <property-map resource="ProductUiLabels" map-name="uiLabelMap"/>
+                <property-map resource="ContentUiLabels" map-name="uiLabelMap"/>
+                <set field="title" value="${uiLabelMap.PageTitleEditFacilityContent}"/>  
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonFacilityDecorator" location="${parameters.commonFacilityDecoratorLocation}">
+                    <decorator-section name="body">
+                        <container>
+                            <label style="h1">${title}</label>
+                        </container>
+                        <screenlet id="add-facility-content" title="${uiLabelMap.ProductAddFacilityContent}" collapsible="true">
+                            <include-form name="AddFacilityContent" location="component://product/widget/facility/FacilityForms.xml"/>
+                        </screenlet>
+                        <include-form name="ListFacilityContent" location="component://product/widget/facility/FacilityForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+         </section>
+    </screen>
 </screens>