You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ap...@apache.org on 2008/05/08 06:07:37 UTC

svn commit: r654405 - in /ofbiz/trunk/applications/marketing: script/org/ofbiz/sfa/lead/LeadServices.xml servicedef/services.xml widget/sfa/forms/LeadForms.xml

Author: apatel
Date: Wed May  7 21:07:36 2008
New Revision: 654405

URL: http://svn.apache.org/viewvc?rev=654405&view=rev
Log:
started work on creating company that lead works for. Remains to create relationship. Next in line. 

Modified:
    ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
    ofbiz/trunk/applications/marketing/servicedef/services.xml
    ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml

Modified: ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml?rev=654405&r1=654404&r2=654405&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml (original)
+++ ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml Wed May  7 21:07:36 2008
@@ -22,31 +22,31 @@
     xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
 
     <simple-method method-name="createLead"  short-description="create Lead Person or Lead Group">
-        <if-not-empty field-name="parameters.leadType">
-            <set field="leadType" from-field="parameters.leadType"/>
-            <else>
-                <set field="leadType" value="PERSON"/>
-            </else>
-        </if-not-empty>
     
         <set field="parameters.roleTypeId" value="LEAD"/>
-        <if-compare field-name="leadType" operator="equals" value="PERSON">
-            <call-simple-method method-name="createPersonRoleAndContactMechs" xml-resource="org/ofbiz/party/party/PartySimpleMethods.xml"/>
-         
-            <if-not-empty field-name="parameters.partyIdFrom">
-                <set field="partyRelationshipContext.partyIdFrom" from-field="parameters.partyIdFrom"/>
-                <set field="partyRelationshipContext.partyIdTo" from-field="partyId"/>
-                <set field="partyRelationshipContext.roleTypeIdFrom" value="LEAD"/>
-                <set field="partyRelationshipContext.roleTypeIdTo" value="OWNER"/>
-                <set field="partyRelationshipContext.partyRelationshipTypeId" value="LEAD_OWNER"/>
-                <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipContext"/>
-            </if-not-empty>
-        </if-compare>
-    
-        <if-compare field-name="leadType" operator="equals" value="GROUP">
-            <call-simple-method method-name="createPartyGroupRoleAndContactMechs" xml-resource="org/ofbiz/party/party/PartySimpleMethods.xml"/>
-        </if-compare>
-    
+        <call-simple-method method-name="createPersonRoleAndContactMechs" xml-resource="org/ofbiz/party/party/PartySimpleMethods.xml"/>
+        <if-not-empty field-name="parameters.partyIdFrom">
+            <set field="partyRelationshipContext.partyIdFrom" from-field="parameters.partyIdFrom"/>
+            <set field="partyRelationshipContext.partyIdTo" from-field="partyId"/>
+            <set field="partyRelationshipContext.roleTypeIdFrom" value="LEAD"/>
+            <set field="partyRelationshipContext.roleTypeIdTo" value="OWNER"/>
+            <set field="partyRelationshipContext.partyRelationshipTypeId" value="LEAD_OWNER"/>
+            <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipContext"/>
+        </if-not-empty>
+        <!-- Now create PartyGroup corresponding to the companyName, if its not null and then set up relationship of Person and PartyGroup as Employee and title -->
+        <if-not-empty field-name="parameters.groupName">
+        <set field="parameters.partyTypeId" value="PARTY_GROUP"/>    
+        <call-map-processor processor-name="partyGroup" in-map-name="parameters" out-map-name="partyGroupContext"
+            xml-resource="org/ofbiz/party/party/PartyMapProcs.xml"/>
+        <call-service service-name="createPartyGroup" in-map-name="partyGroupContext">
+            <result-to-field result-name="partyId" field-name="partyGroupPartyId"/>        
+        </call-service>
+        <set field="createPartyRoleCtx.partyId" from-field="partyId"/>
+        <set field="createPartyRoleCtx.roleTypeId" value="EMPLOYEE"/>
+        <call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/>
+        </if-not-empty>
+        
+        <log level="verbose" message=" ${partyGroupPartyId}"></log>
         <if-not-empty field-name="parameters.leadSource">
             <make-value entity-name="DataSource" value-name="dataSource"/>
             <sequenced-id-to-env sequence-name="DataSource" env-name="dataSourceId"/>

Modified: ofbiz/trunk/applications/marketing/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/servicedef/services.xml?rev=654405&r1=654404&r2=654405&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/marketing/servicedef/services.xml Wed May  7 21:07:36 2008
@@ -400,7 +400,7 @@
         </auto-attributes>
         <attribute name="partyId" type="String" mode="OUT" />
         <attribute name="emailAddress" type="String" mode="IN" optional="true"/>
-        <attribute name="companyName" type="String" mode="IN" optional="true"/>
+        <attribute name="groupName" type="String" mode="IN" optional="true"/>
         <attribute name="title" type="String" mode="IN" optional="true"/>
         <attribute name="numEmployees" type="String" mode="IN" optional="true"/>
         <attribute name="partyIdFrom" type="String" mode="IN" optional="true"/>

Modified: ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml?rev=654405&r1=654404&r2=654405&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/forms/LeadForms.xml Wed May  7 21:07:36 2008
@@ -45,7 +45,7 @@
         <field name="firstName" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text/></field>
         <field name="lastName" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text/></field>
         <field name="suffix"><text/></field>
-        <field name="companyName"><text/></field>
+        <field name="groupName"><text/></field>
         <field name="title"><text/></field>
         <field name="numEmployees" title="${uiLabelMap.MarketingNoOfEmployees}"><text size="30"/></field>
         <field name="siteName" title="${uiLabelMap.FormFieldTitle_officeSiteName}"><text size="30" maxlength="60"/></field>