svn commit: r788593 - in /ofbiz/trunk/applications/party: script/org/ofbiz/party/communication/CommunicationEventEvents.xml script/org/ofbiz/party/communication/CommunicationEventServices.xml webapp/partymgr/WEB-INF/controller.xml

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

svn commit: r788593 - in /ofbiz/trunk/applications/party: script/org/ofbiz/party/communication/CommunicationEventEvents.xml script/org/ofbiz/party/communication/CommunicationEventServices.xml webapp/partymgr/WEB-INF/controller.xml

hansbak-2
Author: hansbak
Date: Fri Jun 26 05:54:30 2009
New Revision: 788593

URL: http://svn.apache.org/viewvc?rev=788593&view=rev
Log:
move an event from e services file to an event file

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml
    ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
    ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml?rev=788593&r1=788592&r2=788593&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml Fri Jun 26 05:54:30 2009
@@ -132,4 +132,65 @@
         <field-to-request field="my"/>
     </simple-method>
 
+    <simple-method method-name="allocateMsgToParty" short-description="Allocate an emailaddress to an existing/new party, update the communication event accordingly">
+        
+        <entity-one entity-name="CommunicationEvent" value-field="communicationEvent"/>
+        <if-empty field="communicationEvent">
+            <add-error><fail-message message="Communication Event ID: ${parameters.commnicationEventId} not found"/></add-error>
+        </if-empty>
+        
+        <if-empty field="parameters.partyId">
+            <if-empty field="parameters.emailAddress">
+                <add-error><fail-message message="Email address is required"/></add-error>
+            </if-empty>
+            
+            <if-empty field="parameters.lastName">
+                <add-error><fail-message message="Please enter a lastName"/></add-error>
+            </if-empty>
+            
+            <if-empty field="parameters.firstName">
+                <add-error><fail-message message="Please enter a firstName"/></add-error>
+                <check-errors/>
+            </if-empty>
+        </if-empty>
+        
+        <check-errors/>
+        
+        <!-- create partyId if not provided -->
+        <if-empty field="parameters.partyId">
+            <set-service-fields service-name="createPerson" map="parameters" to-map="newParty"/>
+            <call-service service-name="createPerson" in-map-name="newParty">
+                <result-to-field result-name="partyId" field="parameters.partyId"/>
+            </call-service>
+        </if-empty>
+        
+        <!-- allocate email to the party -->
+        <if-not-empty field="parameters.emailAddress">
+            <entity-one entity-name="Party" value-field="party"/>
+            <if-empty field="party">
+                <add-error>
+                    <fail-message message="Party ID: ${parameters.partyId} not found"/>
+                </add-error>
+                <check-errors />
+            </if-empty>
+            <set field="newEmail.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
+            <set field="newEmail.partyId" from-field="parameters.partyId"/>
+            <set field="newEmail.emailAddress" from-field="parameters.emailAddress"/>
+            <call-service service-name="createPartyEmailAddress"
+                in-map-name="newEmail">
+                <result-to-field result-name="contactMechId" field="inCom.contactMechIdFrom"/>
+            </call-service>
+        </if-not-empty>
+        
+        <!-- update the communication event -->
+        <set field="inCom.communicationEventId" from-field="parameters.communicationEventId"/>
+        <set field="inCom.partyIdFrom" from-field="parameters.partyId"/>
+        <set field="inCom.statusId" value="COM_ENTERED"/>
+        <call-service service-name="updateCommunicationEvent" in-map-name="inCom"/>
+        
+        <field-to-request field="parameters.communicationEventId" request-name="communicationEventId"/>
+        <entity-one entity-name="PartyNameView" value-field="nameView"/>
+        <set field="_event_message_" value="Email addres: ${parameters.emailAddress} allocated to party: ${nameView.groupName}${nameView.firstName} ${nameView.middleName} ${nameView.lastName}[${parameters.partyId}]"/>
+    </simple-method>
+    
 </simple-methods>

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml?rev=788593&r1=788592&r2=788593&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml Fri Jun 26 05:54:30 2009
@@ -475,67 +475,6 @@
         </iterate>
     </simple-method>
 
-    <simple-method method-name="allocateMsgToParty" short-description="Allocate an emailaddress to an existing/new party, update the communication event accordingly">
-
-        <entity-one entity-name="CommunicationEvent" value-field="communicationEvent"/>
-        <if-empty field="communicationEvent">
-            <add-error><fail-message message="Communication Event ID: ${parameters.commnicationEventId} not found"/></add-error>
-        </if-empty>
-
-        <if-empty field="parameters.partyId">
-            <if-empty field="parameters.emailAddress">
-                <add-error><fail-message message="Email address is required"/></add-error>
-            </if-empty>
-
-            <if-empty field="parameters.lastName">
-                <add-error><fail-message message="Please enter a lastName"/></add-error>
-            </if-empty>
-
-            <if-empty field="parameters.firstName">
-                <add-error><fail-message message="Please enter a firstName"/></add-error>
-                <check-errors/>
-            </if-empty>
-        </if-empty>
-
-        <check-errors/>
-
-        <!-- create partyId if not provided -->
-        <if-empty field="parameters.partyId">
-            <set-service-fields service-name="createPerson" map="parameters" to-map="newParty"/>
-            <call-service service-name="createPerson" in-map-name="newParty">
-                <result-to-field result-name="partyId" field="parameters.partyId"/>
-            </call-service>
-        </if-empty>
-
-        <!-- allocate email to the party -->
-        <if-not-empty field="parameters.emailAddress">
-            <entity-one entity-name="Party" value-field="party"/>
-            <if-empty field="party">
-                <add-error>
-                     <fail-message message="Party ID: ${parameters.partyId} not found"/>
-                </add-error>
-                <check-errors />
-            </if-empty>
-            <set field="newEmail.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
-            <set field="newEmail.partyId" from-field="parameters.partyId"/>
-            <set field="newEmail.emailAddress" from-field="parameters.emailAddress"/>
-            <call-service service-name="createPartyEmailAddress"
-                in-map-name="newEmail">
-                <result-to-field result-name="contactMechId" field="inCom.contactMechIdFrom"/>
-            </call-service>
-        </if-not-empty>
-
-        <!-- update the communication event -->
-        <set field="inCom.communicationEventId" from-field="parameters.communicationEventId"/>
-        <set field="inCom.partyIdFrom" from-field="parameters.partyId"/>
-        <set field="inCom.statusId" value="COM_ENTERED"/>
-        <call-service service-name="updateCommunicationEvent" in-map-name="inCom"/>
-
-        <field-to-request field="parameters.communicationEventId" request-name="communicationEventId"/>
-        <entity-one entity-name="PartyNameView" value-field="nameView"/>
-        <set field="_event_message_" value="Email addres: ${parameters.emailAddress} allocated to party: ${nameView.groupName}${nameView.firstName} ${nameView.middleName} ${nameView.lastName}[${parameters.partyId}]"/>
-    </simple-method>
-
     <simple-method method-name="createCustRequestCommEvent" short-description="Create CustRequestCommEvent" >
         <make-value value-field="newEntity" entity-name="CustRequestCommEvent"/>
         <set-pk-fields map="parameters" value-field="newEntity"/>

Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml?rev=788593&r1=788592&r2=788593&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Fri Jun 26 05:54:30 2009
@@ -821,7 +821,7 @@
 
     <request-map uri="allocateMsgToParty">
         <security https="true" auth="true"/>
-        <event type="simple" path="component://party/script/org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="allocateMsgToParty"/>
+        <event type="simple" path="component://party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml" invoke="allocateMsgToParty"/>
         <response name="success" type="view-home"/>
         <response name="error" type="view" value="ViewCommunicationEvent"/>
     </request-map>