You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2008/10/31 15:09:44 UTC

svn commit: r709427 - in /ofbiz/trunk/applications/order: entitydef/ script/org/ofbiz/order/request/ servicedef/ webapp/ordermgr/WEB-INF/ webapp/ordermgr/request/ widget/ordermgr/

Author: hansbak
Date: Fri Oct 31 07:09:43 2008
New Revision: 709427

URL: http://svn.apache.org/viewvc?rev=709427&view=rev
Log:
implementation of OFBIZ-2024: add content attachments to a customer request

Modified:
    ofbiz/trunk/applications/order/entitydef/entitymodel.xml
    ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
    ofbiz/trunk/applications/order/servicedef/services_request.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/request/RequestForms.xml
    ofbiz/trunk/applications/order/widget/ordermgr/CommonScreens.xml
    ofbiz/trunk/applications/order/widget/ordermgr/RequestMenus.xml
    ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml

Modified: ofbiz/trunk/applications/order/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/entitymodel.xml?rev=709427&r1=709426&r2=709427&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/order/entitydef/entitymodel.xml Fri Oct 31 07:09:43 2008
@@ -1741,6 +1741,21 @@
             <key-map field-name="communicationEventId"/>
         </relation>
     </entity>
+    <entity entity-name="CustRequestContent" package-name="org.ofbiz.order.request" title="Customer Request Content Entity">
+      <field name="custRequestId" 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="custRequestId"/>
+      <prim-key field="contentId"/>
+      <prim-key field="fromDate"/>
+      <relation type="one" fk-name="CUSTREQ_CNT_CUSTRQ" rel-entity-name="CustRequest">
+        <key-map field-name="custRequestId"/>
+      </relation>
+      <relation type="one" fk-name="CUSTREQ_CNT_CNT" rel-entity-name="Content">
+        <key-map field-name="contentId"/>
+      </relation>
+    </entity>
     <entity entity-name="CustRequestItem"
             package-name="org.ofbiz.order.request"
             title="Customer Request Item Entity">

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml?rev=709427&r1=709426&r2=709427&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml Fri Oct 31 07:09:43 2008
@@ -459,5 +459,24 @@
                 
         <field-to-result field-name="parameters.custRequestId" result-name="custRequestId"/>
     </simple-method>
+    
+    <!-- Create/Delete   CustRequest Content-->    
+    <simple-method method-name="createCustRequestContent" short-description="Create Customer Request Content">
+        <make-value entity-name="CustRequestContent" value-name="newEntity"/>
+        <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
+        <set-pk-fields map-name="parameters" value-name="newEntity"/>
+        <if-empty field="newEntity.fromDate">
+            <now-timestamp-to-env env-name="newEntity.fromDate"/>
+        </if-empty>
+        <create-value value-name="newEntity"/>
+    </simple-method>
+    <simple-method method-name="deleteCustRequestContent" short-description="Remove a Customer Request Content">
+        <entity-one entity-name="CustRequestContent" value-name="lookedUpValue"/>
+        <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
+        <if-empty field="lookedUpValue.thruDate">
+            <now-timestamp-to-env env-name="lookedUpValue.thruDate"/>
+        </if-empty>
+        <store-value value-name="lookedUpValue"/>
+    </simple-method>
 
 </simple-methods>

Modified: ofbiz/trunk/applications/order/servicedef/services_request.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_request.xml?rev=709427&r1=709426&r2=709427&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_request.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services_request.xml Fri Oct 31 07:09:43 2008
@@ -175,5 +175,24 @@
         <attribute name="custRequestName" mode="IN" type="String" optional="true"/>
         <attribute name="custRequestId" mode="OUT" type="String" optional="false"/>
     </service>
+    
+    <!-- custRequest content services -->
+    <service name="createCustRequestContent" engine="simple"
+        location="org/ofbiz/order/request/CustRequestServices.xml"
+        invoke="createCustRequestContent"
+        default-entity-name="CustRequestContent" auth="true">
+        <description>Create a Customer Request 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="deleteCustRequestContent" engine="simple"
+        location="org/ofbiz/order/request/CustRequestServices.xml"
+        invoke="deleteCustRequestContent"
+        default-entity-name="CustRequestContent" auth="true">
+        <description>Update a Customer Request Content</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
 </services>
 

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=709427&r1=709426&r2=709427&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Fri Oct 31 07:09:43 2008
@@ -1097,6 +1097,27 @@
     <request-map uri="FindRequest"><security https="true" auth="true"/><response name="success" type="view" value="FindRequest"/></request-map>
     <request-map uri="ViewRequest"><security https="true" auth="true"/><response name="success" type="view" value="ViewRequest"/></request-map>
     <request-map uri="EditRequest"><security https="true" auth="true"/><response name="success" type="view" value="EditRequest"/></request-map>
+    
+    <!-- CustRequest Content -->
+    <request-map uri="EditCustRequestContent">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditCustRequestContent"/>
+    </request-map>
+    
+    <request-map uri="createCustRequestContent">
+        <security auth="true" https="true"/>
+        <event invoke="createCustRequestContent" path="" type="service"/>
+        <response name="success" type="request-redirect" value="EditCustRequestContent"/>
+        <response name="error" type="view" value="EditCustRequestContent"/>
+    </request-map>
+    
+    <request-map uri="deleteCustRequestContent">
+        <security auth="true" https="true"/>
+        <event invoke="deleteCustRequestContent" path="" type="service"/>
+        <response name="success" type="request-redirect" value="EditCustRequestContent"/>
+        <response name="error" type="view" value="EditCustRequestContent"/>
+    </request-map>
+    
     <!-- deprecated: use EditRequest instead -->
     <request-map uri="request"><security https="true" auth="true"/><response name="success" type="view" value="EditRequest"/></request-map>
     <request-map uri="createrequest">
@@ -1465,6 +1486,8 @@
         <response name="success" type="view" value="LookupProductCategory"/>
     </request-map>
     
+    <request-map uri="LookupContent"><security auth="true" https="true"/><response name="success" type="view" value="LookupContent"/></request-map>
+   
     <!--
         These are just examples of reports developed using JasperReport and not really
         useful reports. In order to run them you'll have to follow the notes in the 
@@ -1601,7 +1624,8 @@
     <view-map name="EditRequestItemWorkEfforts" type="screen" page="component://order/widget/ordermgr/RequestScreens.xml#EditRequestItemWorkEfforts"/>
     <view-map name="CreateQuoteAndQuoteItemForRequest" type="screen" page="component://order/widget/ordermgr/RequestScreens.xml#CreateQuoteAndQuoteItemForRequest"/>
     <view-map name="EditQuoteItemForRequest" type="screen" page="component://order/widget/ordermgr/RequestScreens.xml#EditQuoteItemForRequest"/>
-
+    <view-map name="EditCustRequestContent" type="screen" page="component://order/widget/ordermgr/RequestScreens.xml#EditCustRequestContent"/>      
+    
     <view-map name="AddQuoteWorkEffort" type="screen" page="component://order/widget/ordermgr/QuoteWorkEffortScreens.xml#AddQuoteWorkEffort"/>
     <view-map name="EditQuoteWorkEffort" type="screen" page="component://order/widget/ordermgr/QuoteWorkEffortScreens.xml#EditQuoteWorkEffort"/>
     <view-map name="ListQuoteWorkEfforts" type="screen" page="component://order/widget/ordermgr/QuoteWorkEffortScreens.xml#ListQuoteWorkEfforts"/>
@@ -1633,6 +1657,7 @@
     <view-map name="LookupWorkEffort" type="screen" page="component://workeffort/widget/LookupScreens.xml#LookupWorkEffort"/>
     <view-map name="LookupBulkAddProducts" type="screen" page="component://order/widget/ordermgr/OrderEntryCartScreens.xml#LookupBulkAddProducts"/>
     <view-map name="LookupBulkAddSupplierProducts" type="screen" page="component://order/widget/ordermgr/OrderEntryCartScreens.xml#LookupBulkAddSupplierProducts"/>
+    <view-map name="LookupContent" page="component://content/widget/content/ContentScreens.xml#LookupContent" type="screen"/>
     <!-- PDFs  -->
     <view-map name="OrderPDF" type="screenfop" page="component://order/widget/ordermgr/OrderPrintScreens.xml#OrderPDF" content-type="application/pdf" encoding="none"/>
     <view-map name="ReturnPDF" type="screenfop" page="component://order/widget/ordermgr/OrderPrintScreens.xml#ReturnPDF" content-type="application/pdf" encoding="none"/>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/request/RequestForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/request/RequestForms.xml?rev=709427&r1=709426&r2=709427&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/request/RequestForms.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/request/RequestForms.xml Fri Oct 31 07:09:43 2008
@@ -480,5 +480,28 @@
         <field name="lastModifiedDate" title="${uiLabelMap.OrderRequestLastModifiedDate}"><display/></field>       
     </form>
     
-    
-</forms>
\ No newline at end of file
+    <!--Customer Request Content-->
+    <form name="AddCustRequestContent" target="createCustRequestContent" title="" type="single" default-map-name="dummy"
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createCustRequestContent"/>
+        <field name="custRequestId"><hidden value="${parameters.custRequestId}"/></field>
+        <field name="contentId">
+            <lookup target-form-name="LookupContent"/>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+    <form name="ListCustRequestContent" type="list" target="updateCustRequestContent" list-name="custRequestContents" paginate-target="EditCustRequestContent"
+        odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <field name="thruDate"><hidden/></field>
+        <field name="custRequestId"><hidden/></field>        
+        <field name="contentId">
+            <display-entity entity-name="Content" key-field-name="contentId" description="${contentName}" also-hidden="true">
+                <sub-hyperlink target="/content/control/editContent?contentId=${contentId}" description="[${contentId}]" link-style="buttontext" target-type="inter-app"/>
+            </display-entity>
+        </field>
+        <field name="fromDate"><display/></field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="deleteCustRequestContent?custRequestId=${custRequestId}&amp;contentId=${contentId}&amp;fromDate=${fromDate}"/>
+        </field>
+    </form>
+</forms>

Modified: ofbiz/trunk/applications/order/widget/ordermgr/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/CommonScreens.xml?rev=709427&r1=709426&r2=709427&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/CommonScreens.xml Fri Oct 31 07:09:43 2008
@@ -57,6 +57,8 @@
     <screen name="CommonRequestDecorator">
         <section>
             <actions>
+                <set field="custRequestId" from-field="parameters.custRequestId"/>
+                <entity-one entity-name="CustRequest" value-name="custRequest"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">

Modified: ofbiz/trunk/applications/order/widget/ordermgr/RequestMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/RequestMenus.xml?rev=709427&r1=709426&r2=709427&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/RequestMenus.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/RequestMenus.xml Fri Oct 31 07:09:43 2008
@@ -35,6 +35,9 @@
         <menu-item name="requestitems" title="Request Items" >
             <link target="/requestitems?custRequestId=${custRequest.custRequestId}"/>
         </menu-item>
+        <menu-item name="custRequestContent" title="Content">
+            <link target="EditCustRequestContent?custRequestId=${custRequest.custRequestId}"/>
+        </menu-item>
     </menu>
     <menu name="RequestSubTabBar" type="simple" menu-container-style="button-bar button-style-2">
         <menu-item name="newRequest" title="${uiLabelMap.OrderNewRequest}">

Modified: ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml?rev=709427&r1=709426&r2=709427&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml Fri Oct 31 07:09:43 2008
@@ -464,4 +464,27 @@
             </widgets>
         </section>
     </screen>
+    <screen name="EditCustRequestContent">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleEditRequestContent"/>
+                <set field="tabButtonItem" value="custRequestContent"/>
+                <set field="headerItem" value="request"/>
+                <set field="custRequestId" from-field="parameters.custRequestId"/>
+                <entity-and entity-name="CustRequestContent" list-name="custRequestContents" filter-by-date="true">
+                    <field-map field-name="custRequestId" env-name="custRequestId"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonRequestDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                            <screenlet id="AddCustRequestContentsPanel" title="${uiLabelMap.PageTitleAddContent}" collapsible="true">
+                                <include-form name="AddCustRequestContent" location="component://order/webapp/ordermgr/request/RequestForms.xml"/>
+                            </screenlet>
+                                <include-form name="ListCustRequestContent" location="component://order/webapp/ordermgr/request/RequestForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>
\ No newline at end of file