svn commit: r684391 - in /ofbiz/trunk/applications/workeffort: entitydef/entitymodel_view.xml script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml servicedef/services.xml

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

svn commit: r684391 - in /ofbiz/trunk/applications/workeffort: entitydef/entitymodel_view.xml script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml servicedef/services.xml

hansbak-2
Author: hansbak
Date: Sat Aug  9 18:13:14 2008
New Revision: 684391

URL: http://svn.apache.org/viewvc?rev=684391&view=rev
Log:
add the WorkEffortAndContentDataResource view to be able to list all content for a workeffort, updated the createWorkeffort service to automatically make a link to the customerrequest(if provided) and copy the content links from attached requestcommunicationevents to the workeffortcontent list

Modified:
    ofbiz/trunk/applications/workeffort/entitydef/entitymodel_view.xml
    ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml
    ofbiz/trunk/applications/workeffort/servicedef/services.xml

Modified: ofbiz/trunk/applications/workeffort/entitydef/entitymodel_view.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/entitydef/entitymodel_view.xml?rev=684391&r1=684390&r2=684391&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/entitydef/entitymodel_view.xml (original)
+++ ofbiz/trunk/applications/workeffort/entitydef/entitymodel_view.xml Sat Aug  9 18:13:14 2008
@@ -339,7 +339,6 @@
         <key-map field-name="roleTypeId"/>
       </relation>
     </view-entity>
-
   
   <view-entity entity-name="WorkEffortAndGoods" package-name="org.ofbiz.workeffort.workeffort"
         title="WorkEffort and related WorkEffortGoodStandard">
@@ -355,6 +354,52 @@
         <key-map field-name="workEffortId"></key-map>
       </view-link>
     </view-entity>
+    
+    <view-entity entity-name="WorkEffortAndContentDataResource" package-name="org.ofbiz.workeffort.workeffort"
+         title="WorkEffort and Content and DataResource View Entity">
+        <member-entity entity-alias="WECO" entity-name="WorkEffortContent"/>
+        <member-entity entity-alias="CO" entity-name="Content"/>
+        <member-entity entity-alias="DR" entity-name="DataResource"/>
+        <alias-all entity-alias="WECO" />
+        <alias-all entity-alias="CO" />
+        <alias-all entity-alias="DR" prefix="dr"/>
+        <view-link entity-alias="WECO" rel-entity-alias="CO" rel-optional="false">
+            <key-map field-name="contentId"/>
+        </view-link>
+        <view-link entity-alias="CO" rel-entity-alias="DR" rel-optional="true">
+            <key-map field-name="dataResourceId"/>
+        </view-link>
+        <relation type="one-nofk" rel-entity-name="ElectronicText">
+            <key-map field-name="dataResourceId" />
+        </relation>
+        <relation type="one-nofk" rel-entity-name="WorkEffort">
+            <key-map field-name="workEffortId" />
+        </relation>
+        <relation type="one-nofk" rel-entity-name="ImageDataResource">
+            <key-map field-name="dataResourceId" />
+        </relation>
+        <relation type="one-nofk" rel-entity-name="OtherDataResource">
+            <key-map field-name="dataResourceId" />
+        </relation>
+        <relation type="many" rel-entity-name="ContentAssocDataResourceViewFrom">
+            <key-map field-name="contentId" rel-field-name="contentIdStart" />
+        </relation>
+        <relation type="many" rel-entity-name="ContentAssocDataResourceViewTo">
+            <key-map field-name="contentId" rel-field-name="contentIdStart" />
+        </relation>
+        <relation type="many" title="From" rel-entity-name="ContentAssoc">
+            <key-map field-name="contentId"/>
+        </relation>
+        <relation type="many" title="To" rel-entity-name="ContentAssoc">
+            <key-map field-name="contentId" rel-field-name="contentIdTo"/>
+        </relation>
+        <relation type="many" rel-entity-name="ContentPurpose">
+            <key-map field-name="contentId"/>
+        </relation>
+        <relation type="many" rel-entity-name="ContentRole">
+            <key-map field-name="contentId"/>
+        </relation>
+    </view-entity>
 
   <view-entity entity-name="WorkEffortAndInventoryAssign" package-name="org.ofbiz.workeffort.workeffort"
         title="Inventory Item and Product assigned for WorkEffort">

Modified: ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml?rev=684391&r1=684390&r2=684391&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml (original)
+++ ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml Sat Aug  9 18:13:14 2008
@@ -67,6 +67,27 @@
             <set from-field="parameters.requirementId" field="workFullfillment.requirementId"/>
             <create-value value-name="workFullfillment"/>
         </if-not-empty>
+
+        <!-- attach to a customer request if passed and copy attached docs if customer request has communication events with attachments -->
+        <if-not-empty field="parameters.custRequestId">
+            <make-value value-name="custRequestWorkEffort" entity-name="CustRequestWorkEffort"/>
+            <set field="custRequestWorkEffort.workEffortId" from-field="newEntity.workEffortId" />
+            <set field="custRequestWorkEffort.custRequestId" from-field="parameters.custRequestId"/>
+            <create-value value-name="custRequestWorkEffort"/>
+            <entity-and list-name="CustRequestCommEvents" entity-name="CustRequestCommEvent">
+                <field-map field-name="custRequestId" env-name="parameters.custRequestId"/>
+            </entity-and>
+            <iterate entry-name="custRequestCommEvent" list-name="custRequestCommEvents">
+                <get-related relation-name="Content" value-name="custRequestCommEvent" list-name="allCommEventContents"/>
+                <filter-list-by-date list-name="allCommEventContents" to-list-name="commEventContents"/>            
+                <iterate entry-name="commEventContent" list-name="commEventContents">
+                    <set field="newWorkEffortContent.workEffortId" from-field="newEntity.workEffortId"/>
+                    <set field="newWorkEffortContent.contentId" from-field="commEventContent.contentId"/>
+                    <set field="newWorkEffortContent.workEffortContentTypeId" value="SUPPORTING_MEDIA"/>
+                    <call-service service-name="createWorkEffortContent" in-map-name="newWorkEffortContent"/>
+                </iterate>
+            </iterate>
+        </if-not-empty>
     </simple-method>
     <simple-method method-name="updateWorkEffort" short-description="Update Work Effort">
         <!-- check permissions before moving on: if update or delete logged in user must be associated OR have the corresponding UPDATE or DELETE permissions -->

Modified: ofbiz/trunk/applications/workeffort/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/servicedef/services.xml?rev=684391&r1=684390&r2=684391&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/workeffort/servicedef/services.xml Sat Aug  9 18:13:14 2008
@@ -44,6 +44,7 @@
         <auto-attributes mode="INOUT" include="pk" optional="true"/>
         <attribute name="quickAssignPartyId" type="String" mode="IN" optional="true"/>
         <attribute name="requirementId" type="String" mode="IN" optional="true"/>
+        <attribute name="custRequestId" type="String" mode="IN" optional="true"/>
         <attribute name="communicationEventId" type="String" mode="IN" optional="true"/>
         <override name="workEffortTypeId" optional="false"/>
         <override name="workEffortName" optional="false"/>