Suggested change to ProductFeatureServices.getVariantCombinations()

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

Suggested change to ProductFeatureServices.getVariantCombinations()

jonwimp
Currently, that function appends the ProductFeature idCode(s) immediately to the end of the
Product ID. So, WG-9943 will have WG-9943B3 rather than WG-9943-B3.

Can I just add a '-' before the entire string of ProductFeature idCode(s)? Or should I do more
work to store this prefix '-' in some entity linked to a Product?

I'd like to have this feature rolled into OFBiz. Thanks!

Jonathon

Reply | Threaded
Open this post in threaded view
|

Re: Suggested change to ProductFeatureServices.getVariantCombinations()

Scott Gray
Hi Jonathan

I have done the same thing, I would say if any objected it could always
be added to one of the property files.  Something like
product.variant.id.feature.separator=-

Jonathon -- Improov wrote:

> Currently, that function appends the ProductFeature idCode(s)
> immediately to the end of the Product ID. So, WG-9943 will have
> WG-9943B3 rather than WG-9943-B3.
>
> Can I just add a '-' before the entire string of ProductFeature
> idCode(s)? Or should I do more work to store this prefix '-' in some
> entity linked to a Product?
>
> I'd like to have this feature rolled into OFBiz. Thanks!
>
> Jonathon
>


Reply | Threaded
Open this post in threaded view
|

Re: Suggested change to ProductFeatureServices.getVariantCombinations()

Jacques Le Roux
Administrator
Yes, sounds lilke a good idea indeed

Jacques

----- Original Message -----
From: "Scott Gray" <[hidden email]>
To: <[hidden email]>
Sent: Friday, January 12, 2007 8:22 PM
Subject: Re: Suggested change to ProductFeatureServices.getVariantCombinations()


> Hi Jonathan
>
> I have done the same thing, I would say if any objected it could always
> be added to one of the property files.  Something like
> product.variant.id.feature.separator=-
>
> Jonathon -- Improov wrote:
> > Currently, that function appends the ProductFeature idCode(s)
> > immediately to the end of the Product ID. So, WG-9943 will have
> > WG-9943B3 rather than WG-9943-B3.
> >
> > Can I just add a '-' before the entire string of ProductFeature
> > idCode(s)? Or should I do more work to store this prefix '-' in some
> > entity linked to a Product?
> >
> > I'd like to have this feature rolled into OFBiz. Thanks!
> >
> > Jonathon
> >

Reply | Threaded
Open this post in threaded view
|

RE: Suggested change to ProductFeatureServices.getVariantCombinations()

Bsmithson
In reply to this post by jonwimp

I agree, it is our practice as well to add the '-'.

- Brent

-----Original Message-----
From: Jacques Le Roux [mailto:[hidden email]]
Sent: Friday, January 12, 2007 12:06 PM
To: [hidden email]
Subject: Re: Suggested change to
ProductFeatureServices.getVariantCombinations()

Yes, sounds lilke a good idea indeed

Jacques

----- Original Message -----
From: "Scott Gray" <[hidden email]>
To: <[hidden email]>
Sent: Friday, January 12, 2007 8:22 PM
Subject: Re: Suggested change to
ProductFeatureServices.getVariantCombinations()


> Hi Jonathan
>
> I have done the same thing, I would say if any objected it could
always

> be added to one of the property files.  Something like
> product.variant.id.feature.separator=-
>
> Jonathon -- Improov wrote:
> > Currently, that function appends the ProductFeature idCode(s)
> > immediately to the end of the Product ID. So, WG-9943 will have
> > WG-9943B3 rather than WG-9943-B3.
> >
> > Can I just add a '-' before the entire string of ProductFeature
> > idCode(s)? Or should I do more work to store this prefix '-' in some

> > entity linked to a Product?
> >
> > I'd like to have this feature rolled into OFBiz. Thanks!
> >
> > Jonathon
> >

Reply | Threaded
Open this post in threaded view
|

Re: Suggested change to ProductFeatureServices.getVariantCombinations()

Jacques Le Roux
Administrator
 Jonathon,

May you want to create a patch for this ?

Jacques

----- Original Message -----
From: "Brent Smithson" <[hidden email]>
To: <[hidden email]>
Sent: Friday, January 12, 2007 10:30 PM
Subject: RE: Suggested change to ProductFeatureServices.getVariantCombinations()


>
> I agree, it is our practice as well to add the '-'.
>
> - Brent
>
> -----Original Message-----
> From: Jacques Le Roux [mailto:[hidden email]]
> Sent: Friday, January 12, 2007 12:06 PM
> To: [hidden email]
> Subject: Re: Suggested change to
> ProductFeatureServices.getVariantCombinations()
>
> Yes, sounds lilke a good idea indeed
>
> Jacques
>
> ----- Original Message -----
> From: "Scott Gray" <[hidden email]>
> To: <[hidden email]>
> Sent: Friday, January 12, 2007 8:22 PM
> Subject: Re: Suggested change to
> ProductFeatureServices.getVariantCombinations()
>
>
> > Hi Jonathan
> >
> > I have done the same thing, I would say if any objected it could
> always
> > be added to one of the property files.  Something like
> > product.variant.id.feature.separator=-
> >
> > Jonathon -- Improov wrote:
> > > Currently, that function appends the ProductFeature idCode(s)
> > > immediately to the end of the Product ID. So, WG-9943 will have
> > > WG-9943B3 rather than WG-9943-B3.
> > >
> > > Can I just add a '-' before the entire string of ProductFeature
> > > idCode(s)? Or should I do more work to store this prefix '-' in some
>
> > > entity linked to a Product?
> > >
> > > I'd like to have this feature rolled into OFBiz. Thanks!
> > >
> > > Jonathon
> > >

Reply | Threaded
Open this post in threaded view
|

Re: Suggested change to ProductFeatureServices.getVariantCombinations()

jonwimp
In reply to this post by Jacques Le Roux
Jacques,

Which is a good idea? Hardcoding separator '-', or putting it in config folder like Scott said?
And will OFBiz receive this suggested change?

Please let me know, because I'm implementing it now. If my boss says he only ever needs '-', then
changing ProductFeatureServices.getVariantCombinations() is enough, I'm done. But I'd like to do
something that can be rolled into OFBiz.

For now, I'm maintaining the '-' separator change in my private branch of development, until OFBiz
accepts the change. That's that, I'm done. It's just a 1-second change, so if someone in charge of
commits can let me know "the right thing to do", I'll do it right away just so OFBiz can take in
my changes.

At risk of "asking for it (more work) for myself", would anyone want this separator to be
specify-able on the QuickAddVariants page/form itself?

Thanks!

Jonathon

Jacques Le Roux wrote:

> Yes, sounds lilke a good idea indeed
>
> Jacques
>
> ----- Original Message -----
> From: "Scott Gray" <[hidden email]>
> To: <[hidden email]>
> Sent: Friday, January 12, 2007 8:22 PM
> Subject: Re: Suggested change to ProductFeatureServices.getVariantCombinations()
>
>
>> Hi Jonathan
>>
>> I have done the same thing, I would say if any objected it could always
>> be added to one of the property files.  Something like
>> product.variant.id.feature.separator=-
>>
>> Jonathon -- Improov wrote:
>>> Currently, that function appends the ProductFeature idCode(s)
>>> immediately to the end of the Product ID. So, WG-9943 will have
>>> WG-9943B3 rather than WG-9943-B3.
>>>
>>> Can I just add a '-' before the entire string of ProductFeature
>>> idCode(s)? Or should I do more work to store this prefix '-' in some
>>> entity linked to a Product?
>>>
>>> I'd like to have this feature rolled into OFBiz. Thanks!
>>>
>>> Jonathon
>>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Suggested change to ProductFeatureServices.getVariantCombinations()

jonwimp
In reply to this post by Jacques Le Roux
Jacques,

Oh, ok. But it's a 1-second change. Anyway, patch is attached.

Is this the right place/way to discuss suggested changes to OFBiz? Is there a place where I should
put all my change requests?

Jonathon

Jacques Le Roux wrote:

>  Jonathon,
>
> May you want to create a patch for this ?
>
> Jacques
>
> ----- Original Message -----
> From: "Brent Smithson" <[hidden email]>
> To: <[hidden email]>
> Sent: Friday, January 12, 2007 10:30 PM
> Subject: RE: Suggested change to ProductFeatureServices.getVariantCombinations()
>
>
>> I agree, it is our practice as well to add the '-'.
>>
>> - Brent
>>
>> -----Original Message-----
>> From: Jacques Le Roux [mailto:[hidden email]]
>> Sent: Friday, January 12, 2007 12:06 PM
>> To: [hidden email]
>> Subject: Re: Suggested change to
>> ProductFeatureServices.getVariantCombinations()
>>
>> Yes, sounds lilke a good idea indeed
>>
>> Jacques
>>
>> ----- Original Message -----
>> From: "Scott Gray" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Friday, January 12, 2007 8:22 PM
>> Subject: Re: Suggested change to
>> ProductFeatureServices.getVariantCombinations()
>>
>>
>>> Hi Jonathan
>>>
>>> I have done the same thing, I would say if any objected it could
>> always
>>> be added to one of the property files.  Something like
>>> product.variant.id.feature.separator=-
>>>
>>> Jonathon -- Improov wrote:
>>>> Currently, that function appends the ProductFeature idCode(s)
>>>> immediately to the end of the Product ID. So, WG-9943 will have
>>>> WG-9943B3 rather than WG-9943-B3.
>>>>
>>>> Can I just add a '-' before the entire string of ProductFeature
>>>> idCode(s)? Or should I do more work to store this prefix '-' in some
>>>> entity linked to a Product?
>>>>
>>>> I'd like to have this feature rolled into OFBiz. Thanks!
>>>>
>>>> Jonathon
>>>>
>
>

Index: ProductFeatureServices.java
===================================================================
--- ProductFeatureServices.java (revision 494312)
+++ ProductFeatureServices.java (working copy)
@@ -227,7 +227,7 @@
                                List newFeatures = new LinkedList();
                                List newFeatureIds = new LinkedList();
                                if (currentFeature.getString("idCode") != null)
-                                newCombination.put("defaultVariantProductId", productId + currentFeature.getString("idCode"));
+                                newCombination.put("defaultVariantProductId", productId + "-" + currentFeature.getString("idCode"));
                             else
                                 newCombination.put("defaultVariantProductId", productId);
                             newFeatures.add(currentFeature);
Reply | Threaded
Open this post in threaded view
|

Re: Suggested change to ProductFeatureServices.getVariantCombinations()

cjhowe
Create a JIRA issue here:

http://issues.apache.org/jira/browse/OFBIZ

you will need to quickly register


--- Jonathon -- Improov <[hidden email]> wrote:

> Jacques,
>
> Oh, ok. But it's a 1-second change. Anyway, patch is
> attached.
>
> Is this the right place/way to discuss suggested
> changes to OFBiz? Is there a place where I should
> put all my change requests?
>
> Jonathon
>
> Jacques Le Roux wrote:
> >  Jonathon,
> >
> > May you want to create a patch for this ?
> >
> > Jacques
> >
> > ----- Original Message -----
> > From: "Brent Smithson" <[hidden email]>
> > To: <[hidden email]>
> > Sent: Friday, January 12, 2007 10:30 PM
> > Subject: RE: Suggested change to
> ProductFeatureServices.getVariantCombinations()
> >
> >
> >> I agree, it is our practice as well to add the
> '-'.
> >>
> >> - Brent
> >>
> >> -----Original Message-----
> >> From: Jacques Le Roux
> [mailto:[hidden email]]
> >> Sent: Friday, January 12, 2007 12:06 PM
> >> To: [hidden email]
> >> Subject: Re: Suggested change to
> >> ProductFeatureServices.getVariantCombinations()
> >>
> >> Yes, sounds lilke a good idea indeed
> >>
> >> Jacques
> >>
> >> ----- Original Message -----
> >> From: "Scott Gray" <[hidden email]>
> >> To: <[hidden email]>
> >> Sent: Friday, January 12, 2007 8:22 PM
> >> Subject: Re: Suggested change to
> >> ProductFeatureServices.getVariantCombinations()
> >>
> >>
> >>> Hi Jonathan
> >>>
> >>> I have done the same thing, I would say if any
> objected it could
> >> always
> >>> be added to one of the property files.
> Something like
> >>> product.variant.id.feature.separator=-
> >>>
> >>> Jonathon -- Improov wrote:
> >>>> Currently, that function appends the
> ProductFeature idCode(s)
> >>>> immediately to the end of the Product ID. So,
> WG-9943 will have
> >>>> WG-9943B3 rather than WG-9943-B3.
> >>>>
> >>>> Can I just add a '-' before the entire string
> of ProductFeature
> >>>> idCode(s)? Or should I do more work to store
> this prefix '-' in some
> >>>> entity linked to a Product?
> >>>>
> >>>> I'd like to have this feature rolled into
> OFBiz. Thanks!
> >>>>
> >>>> Jonathon
> >>>>
> >
> >
>
> > Index: ProductFeatureServices.java
>
===================================================================

> --- ProductFeatureServices.java (revision 494312)
> +++ ProductFeatureServices.java (working copy)
> @@ -227,7 +227,7 @@
>                                 List newFeatures =
> new LinkedList();
>                                 List newFeatureIds =
> new LinkedList();
>                                 if
> (currentFeature.getString("idCode") != null)
> -                              
> newCombination.put("defaultVariantProductId",
> productId + currentFeature.getString("idCode"));
> +                              
> newCombination.put("defaultVariantProductId",
> productId + "-" +
> currentFeature.getString("idCode"));
>                              else
>                                
> newCombination.put("defaultVariantProductId",
> productId);
>                            
> newFeatures.add(currentFeature);
>

Reply | Threaded
Open this post in threaded view
|

Re: Suggested change to ProductFeatureServices.getVariantCombinations()

David E Jones
In reply to this post by jonwimp

This isn't a universal policy or anything, but I'd say for something  
minor like this there isn't a problem with hard-coding it.

The whole point of the ID generation is to make the IDs unique. In  
the UI you can specify an ID instead of using the default, so it only  
matters so much.

-David


On Jan 12, 2007, at 7:17 PM, Jonathon -- Improov wrote:

> Jacques,
>
> Which is a good idea? Hardcoding separator '-', or putting it in  
> config folder like Scott said? And will OFBiz receive this  
> suggested change?
>
> Please let me know, because I'm implementing it now. If my boss  
> says he only ever needs '-', then changing  
> ProductFeatureServices.getVariantCombinations() is enough, I'm  
> done. But I'd like to do something that can be rolled into OFBiz.
>
> For now, I'm maintaining the '-' separator change in my private  
> branch of development, until OFBiz accepts the change. That's that,  
> I'm done. It's just a 1-second change, so if someone in charge of  
> commits can let me know "the right thing to do", I'll do it right  
> away just so OFBiz can take in my changes.
>
> At risk of "asking for it (more work) for myself", would anyone  
> want this separator to be specify-able on the QuickAddVariants page/
> form itself?
>
> Thanks!
>
> Jonathon
>
> Jacques Le Roux wrote:
>> Yes, sounds lilke a good idea indeed
>> Jacques
>> ----- Original Message ----- From: "Scott Gray" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Friday, January 12, 2007 8:22 PM
>> Subject: Re: Suggested change to  
>> ProductFeatureServices.getVariantCombinations()
>>> Hi Jonathan
>>>
>>> I have done the same thing, I would say if any objected it could  
>>> always be added to one of the property files.  Something like  
>>> product.variant.id.feature.separator=-
>>>
>>> Jonathon -- Improov wrote:
>>>> Currently, that function appends the ProductFeature idCode(s)  
>>>> immediately to the end of the Product ID. So, WG-9943 will have  
>>>> WG-9943B3 rather than WG-9943-B3.
>>>>
>>>> Can I just add a '-' before the entire string of ProductFeature  
>>>> idCode(s)? Or should I do more work to store this prefix '-' in  
>>>> some entity linked to a Product?
>>>>
>>>> I'd like to have this feature rolled into OFBiz. Thanks!
>>>>
>>>> Jonathon
>>>>
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Suggested change to ProductFeatureServices.getVariantCombinations()

jonwimp
In reply to this post by cjhowe
Done. See https://issues.apache.org/jira/browse/OFBIZ-620 .

Jonathon

Chris Howe wrote:

> Create a JIRA issue here:
>
> http://issues.apache.org/jira/browse/OFBIZ
>
> you will need to quickly register
>
>
> --- Jonathon -- Improov <[hidden email]> wrote:
>
>> Jacques,
>>
>> Oh, ok. But it's a 1-second change. Anyway, patch is
>> attached.
>>
>> Is this the right place/way to discuss suggested
>> changes to OFBiz? Is there a place where I should
>> put all my change requests?
>>
>> Jonathon
>>
>> Jacques Le Roux wrote:
>>>  Jonathon,
>>>
>>> May you want to create a patch for this ?
>>>
>>> Jacques
>>>
>>> ----- Original Message -----
>>> From: "Brent Smithson" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Friday, January 12, 2007 10:30 PM
>>> Subject: RE: Suggested change to
>> ProductFeatureServices.getVariantCombinations()
>>>
>>>> I agree, it is our practice as well to add the
>> '-'.
>>>> - Brent
>>>>
>>>> -----Original Message-----
>>>> From: Jacques Le Roux
>> [mailto:[hidden email]]
>>>> Sent: Friday, January 12, 2007 12:06 PM
>>>> To: [hidden email]
>>>> Subject: Re: Suggested change to
>>>> ProductFeatureServices.getVariantCombinations()
>>>>
>>>> Yes, sounds lilke a good idea indeed
>>>>
>>>> Jacques
>>>>
>>>> ----- Original Message -----
>>>> From: "Scott Gray" <[hidden email]>
>>>> To: <[hidden email]>
>>>> Sent: Friday, January 12, 2007 8:22 PM
>>>> Subject: Re: Suggested change to
>>>> ProductFeatureServices.getVariantCombinations()
>>>>
>>>>
>>>>> Hi Jonathan
>>>>>
>>>>> I have done the same thing, I would say if any
>> objected it could
>>>> always
>>>>> be added to one of the property files.
>> Something like
>>>>> product.variant.id.feature.separator=-
>>>>>
>>>>> Jonathon -- Improov wrote:
>>>>>> Currently, that function appends the
>> ProductFeature idCode(s)
>>>>>> immediately to the end of the Product ID. So,
>> WG-9943 will have
>>>>>> WG-9943B3 rather than WG-9943-B3.
>>>>>>
>>>>>> Can I just add a '-' before the entire string
>> of ProductFeature
>>>>>> idCode(s)? Or should I do more work to store
>> this prefix '-' in some
>>>>>> entity linked to a Product?
>>>>>>
>>>>>> I'd like to have this feature rolled into
>> OFBiz. Thanks!
>>>>>> Jonathon
>>>>>>
>>>
>>> Index: ProductFeatureServices.java
> ===================================================================
>> --- ProductFeatureServices.java (revision 494312)
>> +++ ProductFeatureServices.java (working copy)
>> @@ -227,7 +227,7 @@
>>                                 List newFeatures =
>> new LinkedList();
>>                                 List newFeatureIds =
>> new LinkedList();
>>                                 if
>> (currentFeature.getString("idCode") != null)
>> -                              
>> newCombination.put("defaultVariantProductId",
>> productId + currentFeature.getString("idCode"));
>> +                              
>> newCombination.put("defaultVariantProductId",
>> productId + "-" +
>> currentFeature.getString("idCode"));
>>                              else
>>                                
>> newCombination.put("defaultVariantProductId",
>> productId);
>>                            
>> newFeatures.add(currentFeature);
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Suggested change to ProductFeatureServices.getVariantCombinations()

jonwimp
In reply to this post by David E Jones
David,

True, no problem hardcoding it because it's just a suggested default that can be manually
overridden by the user. But it's not trivial for those who need to automatically create HUNDREDS
of variants at once!

And for other users who also need to create huge numbers of variants at once, it'll be a pain to
manually replace my separator '-' with say '--'.

Jonathon

David E. Jones wrote:
>
> This isn't a universal policy or anything, but I'd say for something
> minor like this there isn't a problem with hard-coding it.
>
> The whole point of the ID generation is to make the IDs unique. In the
> UI you can specify an ID instead of using the default, so it only
> matters so much.
>
> -David
Reply | Threaded
Open this post in threaded view
|

Re: Suggested change to ProductFeatureServices.getVariantCombinations()

David E Jones

On Jan 12, 2007, at 9:43 PM, Jonathon -- Improov wrote:

> David,
>
> True, no problem hardcoding it because it's just a suggested  
> default that can be manually overridden by the user. But it's not  
> trivial for those who need to automatically create HUNDREDS of  
> variants at once!
>
> And for other users who also need to create huge numbers of  
> variants at once, it'll be a pain to manually replace my separator  
> '-' with say '--'.
The "huge numbers" is what catches my attention here. Usually when  
huge numbers are involved custom requirements and patterns come along  
for the ride. In other words, we could guess all we want about the  
variations that people might want in the future for something like  
this, but unless we have a number of examples or existing  
requirements to design to we're not going to get a very good hit rate.

Which is why for something like this, hard coding is even more  
thrilling and sexy than a custom XML config file... ;)

-David


> David E. Jones wrote:
>> This isn't a universal policy or anything, but I'd say for  
>> something minor like this there isn't a problem with hard-coding it.
>> The whole point of the ID generation is to make the IDs unique. In  
>> the UI you can specify an ID instead of using the default, so it  
>> only matters so much.
>> -David


smime.p7s (3K) Download Attachment