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: [hidden email] > Date: June 22, 2009 10:19:48 PM EDT > To: [hidden email] > Subject: svn commit: r787518 - /ofbiz/trunk/applications/party/src/ > org/ofbiz/party/party/PartyServices.java > Reply-To: [hidden email] > > 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()); > > |
+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: [hidden email] >> Date: June 22, 2009 10:19:48 PM EDT >> To: [hidden email] >> Subject: svn commit: r787518 - /ofbiz/trunk/applications/party/src/ >> org/ofbiz/party/party/PartyServices.java >> Reply-To: [hidden email] >> >> 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()); >> >> > smime.p7s (3K) Download Attachment |
In reply to this post by Anil Patel-3
I haven't looked into this issue specifically, but I've noticed recently that a number of the Project Manager improvements break existing code. I really appreciate the effort Hans and his team are making to build out OFBiz, but at the same time, it appears that a lot of the code is being committed before it is tested. -Adrian --- On Mon, 6/22/09, Scott Gray <[hidden email]> wrote: > From: Scott Gray <[hidden email]> > Subject: Re: svn commit: r787518 - /ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java > To: [hidden email] > Cc: "Anil Patel" <[hidden email]> > Date: Monday, June 22, 2009, 8:20 PM > +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: [hidden email] > >> Date: June 22, 2009 10:19:48 PM EDT > >> To: [hidden email] > >> Subject: svn commit: r787518 - > /ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java > >> Reply-To: [hidden email] > >> > >> 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()); > >> > >> > > > > |
In reply to this post by Scott Gray-2
+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: [hidden email] >>> Date: June 22, 2009 10:19:48 PM EDT >>> To: [hidden email] >>> Subject: svn commit: r787518 - /ofbiz/trunk/applications/party/src/ >>> org/ofbiz/party/party/PartyServices.java >>> Reply-To: [hidden email] >>> >>> 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()); >>> >>> >> > |
Free forum by Nabble | Edit this page |