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 2009/06/23 04:19:48 UTC
svn commit: r787518 -
/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
Author: hansbak
Date: Tue Jun 23 02:19:48 2009
New Revision: 787518
URL: http://svn.apache.org/viewvc?rev=787518&view=rev
Log:
add standard the contact role to person and the account to partygroup so that they appear in sfa and the contact/company relationship can be created more easy
Modified:
ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=787518&r1=787517&r2=787518&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java Tue Jun 23 02:19:48 2009
@@ -180,6 +180,10 @@
person = delegator.makeValue("Person", UtilMisc.toMap("partyId", partyId));
person.setNonPKFields(context);
toBeStored.add(person);
+
+ // standard add the role of "contact"
+ GenericValue partyRole = delegator.makeValue("PartyRole", UtilMisc.toMap("partyId", partyId, "roleTypeId", "CONTACT"));
+ toBeStored.add(partyRole);
try {
delegator.storeAll(toBeStored);
@@ -414,6 +418,12 @@
partyGroup = delegator.makeValue("PartyGroup", UtilMisc.toMap("partyId", partyId));
partyGroup.setNonPKFields(context);
partyGroup.create();
+
+ // standard add the role of "Account"
+ GenericValue partyRole = delegator.makeValue("PartyRole", UtilMisc.toMap("partyId", partyId, "roleTypeId", "ACCOUNT"));
+ partyRole.create();
+
+
} catch (GenericEntityException e) {
Debug.logWarning(e, module);
Map<String, String> messageMap = UtilMisc.toMap("errMessage", e.getMessage());
Re: svn commit: r787518 -
/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
Posted by David E Jones <de...@me.com>.
+1
-David
On Jun 22, 2009, at 9:20 PM, Scott Gray wrote:
> +1, not every person is a contact and not every party group is an
> account.
>
> Regards
> Scott
>
> On 23/06/2009, at 2:54 PM, Anil Patel wrote:
>
>> Hans,
>> I have objection to your modifications in PartyServices.java.
>>
>> I don't think its good idea to HARD CODE to add every Person in
>> CONTACT role similarly I don't think we should add every PartyGroup
>> in ACCOUNT role.
>>
>> We have lots of examples in ofbiz where we first create Person and
>> then assign a role to that party. In case you have special need
>> then its better to write a service that first creates Person and
>> then assigns it CONTACT role.
>>
>> Or write a seca in your hotdeploy application that will trigger
>> service to assign CONTACT role to person every time a person is
>> created. You can do similar thing for PartyGroup as well.
>>
>> Regards
>> Anil Patel
>>
>>
>> Begin forwarded message:
>>
>>> From: hansbak@apache.org
>>> Date: June 22, 2009 10:19:48 PM EDT
>>> To: commits@ofbiz.apache.org
>>> Subject: svn commit: r787518 - /ofbiz/trunk/applications/party/src/
>>> org/ofbiz/party/party/PartyServices.java
>>> Reply-To: dev@ofbiz.apache.org
>>>
>>> Author: hansbak
>>> Date: Tue Jun 23 02:19:48 2009
>>> New Revision: 787518
>>>
>>> URL: http://svn.apache.org/viewvc?rev=787518&view=rev
>>> Log:
>>> add standard the contact role to person and the account to
>>> partygroup so that they appear in sfa and the contact/company
>>> relationship can be created more easy
>>>
>>> Modified:
>>> ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
>>> PartyServices.java
>>>
>>> Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
>>> PartyServices.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=787518&r1=787517&r2=787518&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
>>> PartyServices.java (original)
>>> +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
>>> PartyServices.java Tue Jun 23 02:19:48 2009
>>> @@ -180,6 +180,10 @@
>>> person = delegator.makeValue("Person",
>>> UtilMisc.toMap("partyId", partyId));
>>> person.setNonPKFields(context);
>>> toBeStored.add(person);
>>> +
>>> + // standard add the role of "contact"
>>> + GenericValue partyRole = delegator.makeValue("PartyRole",
>>> UtilMisc.toMap("partyId", partyId, "roleTypeId", "CONTACT"));
>>> + toBeStored.add(partyRole);
>>>
>>> try {
>>> delegator.storeAll(toBeStored);
>>> @@ -414,6 +418,12 @@
>>> partyGroup = delegator.makeValue("PartyGroup",
>>> UtilMisc.toMap("partyId", partyId));
>>> partyGroup.setNonPKFields(context);
>>> partyGroup.create();
>>> +
>>> + // standard add the role of "Account"
>>> + GenericValue partyRole =
>>> delegator.makeValue("PartyRole", UtilMisc.toMap("partyId",
>>> partyId, "roleTypeId", "ACCOUNT"));
>>> + partyRole.create();
>>> +
>>> +
>>> } catch (GenericEntityException e) {
>>> Debug.logWarning(e, module);
>>> Map<String, String> messageMap =
>>> UtilMisc.toMap("errMessage", e.getMessage());
>>>
>>>
>>
>
Re: svn commit: r787518 - /ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
Posted by Scott Gray <sc...@hotwaxmedia.com>.
+1, not every person is a contact and not every party group is an
account.
Regards
Scott
On 23/06/2009, at 2:54 PM, Anil Patel wrote:
> Hans,
> I have objection to your modifications in PartyServices.java.
>
> I don't think its good idea to HARD CODE to add every Person in
> CONTACT role similarly I don't think we should add every PartyGroup
> in ACCOUNT role.
>
> We have lots of examples in ofbiz where we first create Person and
> then assign a role to that party. In case you have special need then
> its better to write a service that first creates Person and then
> assigns it CONTACT role.
>
> Or write a seca in your hotdeploy application that will trigger
> service to assign CONTACT role to person every time a person is
> created. You can do similar thing for PartyGroup as well.
>
> Regards
> Anil Patel
>
>
> Begin forwarded message:
>
>> From: hansbak@apache.org
>> Date: June 22, 2009 10:19:48 PM EDT
>> To: commits@ofbiz.apache.org
>> Subject: svn commit: r787518 - /ofbiz/trunk/applications/party/src/
>> org/ofbiz/party/party/PartyServices.java
>> Reply-To: dev@ofbiz.apache.org
>>
>> Author: hansbak
>> Date: Tue Jun 23 02:19:48 2009
>> New Revision: 787518
>>
>> URL: http://svn.apache.org/viewvc?rev=787518&view=rev
>> Log:
>> add standard the contact role to person and the account to
>> partygroup so that they appear in sfa and the contact/company
>> relationship can be created more easy
>>
>> Modified:
>> ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
>> PartyServices.java
>>
>> Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
>> PartyServices.java
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=787518&r1=787517&r2=787518&view=diff
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
>> PartyServices.java (original)
>> +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
>> PartyServices.java Tue Jun 23 02:19:48 2009
>> @@ -180,6 +180,10 @@
>> person = delegator.makeValue("Person",
>> UtilMisc.toMap("partyId", partyId));
>> person.setNonPKFields(context);
>> toBeStored.add(person);
>> +
>> + // standard add the role of "contact"
>> + GenericValue partyRole = delegator.makeValue("PartyRole",
>> UtilMisc.toMap("partyId", partyId, "roleTypeId", "CONTACT"));
>> + toBeStored.add(partyRole);
>>
>> try {
>> delegator.storeAll(toBeStored);
>> @@ -414,6 +418,12 @@
>> partyGroup = delegator.makeValue("PartyGroup",
>> UtilMisc.toMap("partyId", partyId));
>> partyGroup.setNonPKFields(context);
>> partyGroup.create();
>> +
>> + // standard add the role of "Account"
>> + GenericValue partyRole =
>> delegator.makeValue("PartyRole", UtilMisc.toMap("partyId", partyId,
>> "roleTypeId", "ACCOUNT"));
>> + partyRole.create();
>> +
>> +
>> } catch (GenericEntityException e) {
>> Debug.logWarning(e, module);
>> Map<String, String> messageMap =
>> UtilMisc.toMap("errMessage", e.getMessage());
>>
>>
>
Fwd: svn commit: r787518 - /ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
Posted by Anil Patel <an...@hotwaxmedia.com>.
Hans,
I have objection to your modifications in PartyServices.java.
I don't think its good idea to HARD CODE to add every Person in
CONTACT role similarly I don't think we should add every PartyGroup in
ACCOUNT role.
We have lots of examples in ofbiz where we first create Person and
then assign a role to that party. In case you have special need then
its better to write a service that first creates Person and then
assigns it CONTACT role.
Or write a seca in your hotdeploy application that will trigger
service to assign CONTACT role to person every time a person is
created. You can do similar thing for PartyGroup as well.
Regards
Anil Patel
Begin forwarded message:
> From: hansbak@apache.org
> Date: June 22, 2009 10:19:48 PM EDT
> To: commits@ofbiz.apache.org
> Subject: svn commit: r787518 - /ofbiz/trunk/applications/party/src/
> org/ofbiz/party/party/PartyServices.java
> Reply-To: dev@ofbiz.apache.org
>
> Author: hansbak
> Date: Tue Jun 23 02:19:48 2009
> New Revision: 787518
>
> URL: http://svn.apache.org/viewvc?rev=787518&view=rev
> Log:
> add standard the contact role to person and the account to
> partygroup so that they appear in sfa and the contact/company
> relationship can be created more easy
>
> Modified:
> ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
> PartyServices.java
>
> Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
> PartyServices.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=787518&r1=787517&r2=787518&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
> PartyServices.java (original)
> +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/
> PartyServices.java Tue Jun 23 02:19:48 2009
> @@ -180,6 +180,10 @@
> person = delegator.makeValue("Person",
> UtilMisc.toMap("partyId", partyId));
> person.setNonPKFields(context);
> toBeStored.add(person);
> +
> + // standard add the role of "contact"
> + GenericValue partyRole = delegator.makeValue("PartyRole",
> UtilMisc.toMap("partyId", partyId, "roleTypeId", "CONTACT"));
> + toBeStored.add(partyRole);
>
> try {
> delegator.storeAll(toBeStored);
> @@ -414,6 +418,12 @@
> partyGroup = delegator.makeValue("PartyGroup",
> UtilMisc.toMap("partyId", partyId));
> partyGroup.setNonPKFields(context);
> partyGroup.create();
> +
> + // standard add the role of "Account"
> + GenericValue partyRole =
> delegator.makeValue("PartyRole", UtilMisc.toMap("partyId", partyId,
> "roleTypeId", "ACCOUNT"));
> + partyRole.create();
> +
> +
> } catch (GenericEntityException e) {
> Debug.logWarning(e, module);
> Map<String, String> messageMap =
> UtilMisc.toMap("errMessage", e.getMessage());
>
>