You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Jonathon -- Improov <jo...@improov.com> on 2007/02/10 12:04:45 UTC
Services for Product Category hierarchies
Is there a service for retrieving all the child categories belonging to a parent category? Is the
related entity ProductCategoryRollup? This entity seems to allow a child category to have more
than 1 parent category.
What about field ProductCategory.primaryParentCategoryId?
I see services "createProductCategory" (and update) used to create the necessary
ProductCategoryRollup record, but not anymore. Same for service "updateProduct".
Do I use the CategoryWorker.java?
Jonathon
Re: Services for Product Category hierarchies
Posted by Jacques Le Roux <ja...@les7arts.com>.
Jonathon,
> Is there a service for retrieving all the child categories belonging
> to a parent category?
I'm not sure if a service exists. You may find a recursive algorithm in getCategoryContentWrappers that may be be adapted for that
use
Jacques
Subject: Services for Product Category hierarchies
> Is there a service for retrieving all the child categories belonging to a parent category? Is the
> related entity ProductCategoryRollup? This entity seems to allow a child category to have more
> than 1 parent category.
>
> What about field ProductCategory.primaryParentCategoryId?
>
> I see services "createProductCategory" (and update) used to create the necessary
> ProductCategoryRollup record, but not anymore. Same for service "updateProduct".
>
> Do I use the CategoryWorker.java?
>
> Jonathon
Re: Services for Product Category hierarchies
Posted by Jonathon -- Improov <jo...@improov.com>.
David,
I'm looking for descendant ProductCategory(s), not Products. I'll reuse codes from ProductSearch
if possible. Thanks.
My objective: Trim options to manageable size for field "Primary Category" in screen "LookupProduct".
If such a service isn't there yet, I could create one. For now, I just have it in my custom
hot-deploy app (as a bsh script, not service). Let me know if we should discuss about this service
and put it into OFBiz instead.
Jonathon
David E. Jones wrote:
>
> I'd recommend using the ProductSearch and related classes. They have
> features for searching for products (if you're looking for products, of
> course) in categories and their sub-cats, and many other things.
>
> -David
>
>
> On Feb 10, 2007, at 8:53 PM, Jonathon -- Improov wrote:
>
>> Chris,
>>
>> Can I say that I can safely ignore
>> ProductCategory.primaryParentCategoryId in my logics, but still
>> dutifully populate it (ie, copy value from
>> ProductCategoryRollup.parentProductCategoryId)?
>>
>> > I'd be happy to answer your "Do I use CategoryWorker.java" question
>> if you
>> > could answer..."For what?"
>>
>> Trying to do a "deep search" for all descendants of a ProductCategory,
>> the entire hierarchy.
>>
>> Yeah, I know I shouldn't have said "for retrieving all the child
>> categories". Sorry. :P
>>
>> Jonathon
>>
>> Chris Howe wrote:
>>> There may be a service, but depending on what data you're trying to
>>> retrieve it may be unnecessary to use. Is doing a search against the
>>> ProductCategoryRollup entity insufficient?
>>> ProductCategory.primaryParentCategoryId is a
>>> denormalized/non-normalized field. It's denormalized because the same
>>> entry should exist in ProductCategoryRollup. It's non-normalized
>>> because ProductCategoryRollup doesn't have a rollupTypeId field to
>>> specify an importance that the "primary" part of the description
>>> depicts. Being non-normalized here is rather trivial.
>>> I'd be happy to answer your "Do I use CategoryWorker.java" question if
>>> you could answer..."For what?"
>>> --- Jonathon -- Improov <jo...@improov.com> wrote:
>>>> Is there a service for retrieving all the child categories belonging
>>>> to a parent category? Is the related entity ProductCategoryRollup?
>>>> This entity seems to allow a
>>>> child category to have more than 1 parent category.
>>>>
>>>> What about field ProductCategory.primaryParentCategoryId?
>>>>
>>>> I see services "createProductCategory" (and update) used to create
>>>> the necessary ProductCategoryRollup record, but not anymore. Same
>>>> for service
>>>> "updateProduct".
>>>>
>>>> Do I use the CategoryWorker.java?
>>>>
>>>> Jonathon
>>>>
>>
>
Re: Services for Product Category hierarchies
Posted by "David E. Jones" <jo...@hotwaxmedia.com>.
I'd recommend using the ProductSearch and related classes. They have
features for searching for products (if you're looking for products,
of course) in categories and their sub-cats, and many other things.
-David
On Feb 10, 2007, at 8:53 PM, Jonathon -- Improov wrote:
> Chris,
>
> Can I say that I can safely ignore
> ProductCategory.primaryParentCategoryId in my logics, but still
> dutifully populate it (ie, copy value from
> ProductCategoryRollup.parentProductCategoryId)?
>
> > I'd be happy to answer your "Do I use CategoryWorker.java"
> question if you
> > could answer..."For what?"
>
> Trying to do a "deep search" for all descendants of a
> ProductCategory, the entire hierarchy.
>
> Yeah, I know I shouldn't have said "for retrieving all the child
> categories". Sorry. :P
>
> Jonathon
>
> Chris Howe wrote:
>> There may be a service, but depending on what data you're trying to
>> retrieve it may be unnecessary to use. Is doing a search against the
>> ProductCategoryRollup entity insufficient?
>> ProductCategory.primaryParentCategoryId is a
>> denormalized/non-normalized field. It's denormalized because the
>> same
>> entry should exist in ProductCategoryRollup. It's non-normalized
>> because ProductCategoryRollup doesn't have a rollupTypeId field to
>> specify an importance that the "primary" part of the description
>> depicts. Being non-normalized here is rather trivial.
>> I'd be happy to answer your "Do I use CategoryWorker.java"
>> question if
>> you could answer..."For what?"
>> --- Jonathon -- Improov <jo...@improov.com> wrote:
>>> Is there a service for retrieving all the child categories belonging
>>> to a parent category? Is the related entity
>>> ProductCategoryRollup? This entity seems to allow a
>>> child category to have more than 1 parent category.
>>>
>>> What about field ProductCategory.primaryParentCategoryId?
>>>
>>> I see services "createProductCategory" (and update) used to create
>>> the necessary ProductCategoryRollup record, but not anymore. Same
>>> for service
>>> "updateProduct".
>>>
>>> Do I use the CategoryWorker.java?
>>>
>>> Jonathon
>>>
>
Re: Services for Product Category hierarchies
Posted by Jonathon -- Improov <jo...@improov.com>.
Chris,
Can I say that I can safely ignore ProductCategory.primaryParentCategoryId in my logics, but still
dutifully populate it (ie, copy value from ProductCategoryRollup.parentProductCategoryId)?
> I'd be happy to answer your "Do I use CategoryWorker.java" question if you
> could answer..."For what?"
Trying to do a "deep search" for all descendants of a ProductCategory, the entire hierarchy.
Yeah, I know I shouldn't have said "for retrieving all the child categories". Sorry. :P
Jonathon
Chris Howe wrote:
> There may be a service, but depending on what data you're trying to
> retrieve it may be unnecessary to use. Is doing a search against the
> ProductCategoryRollup entity insufficient?
>
> ProductCategory.primaryParentCategoryId is a
> denormalized/non-normalized field. It's denormalized because the same
> entry should exist in ProductCategoryRollup. It's non-normalized
> because ProductCategoryRollup doesn't have a rollupTypeId field to
> specify an importance that the "primary" part of the description
> depicts. Being non-normalized here is rather trivial.
>
> I'd be happy to answer your "Do I use CategoryWorker.java" question if
> you could answer..."For what?"
>
>
> --- Jonathon -- Improov <jo...@improov.com> wrote:
>
>> Is there a service for retrieving all the child categories belonging
>> to a parent category? Is the
>> related entity ProductCategoryRollup? This entity seems to allow a
>> child category to have more
>> than 1 parent category.
>>
>> What about field ProductCategory.primaryParentCategoryId?
>>
>> I see services "createProductCategory" (and update) used to create
>> the necessary
>> ProductCategoryRollup record, but not anymore. Same for service
>> "updateProduct".
>>
>> Do I use the CategoryWorker.java?
>>
>> Jonathon
>>
>
Re: Services for Product Category hierarchies
Posted by Chris Howe <cj...@yahoo.com>.
There may be a service, but depending on what data you're trying to
retrieve it may be unnecessary to use. Is doing a search against the
ProductCategoryRollup entity insufficient?
ProductCategory.primaryParentCategoryId is a
denormalized/non-normalized field. It's denormalized because the same
entry should exist in ProductCategoryRollup. It's non-normalized
because ProductCategoryRollup doesn't have a rollupTypeId field to
specify an importance that the "primary" part of the description
depicts. Being non-normalized here is rather trivial.
I'd be happy to answer your "Do I use CategoryWorker.java" question if
you could answer..."For what?"
--- Jonathon -- Improov <jo...@improov.com> wrote:
> Is there a service for retrieving all the child categories belonging
> to a parent category? Is the
> related entity ProductCategoryRollup? This entity seems to allow a
> child category to have more
> than 1 parent category.
>
> What about field ProductCategory.primaryParentCategoryId?
>
> I see services "createProductCategory" (and update) used to create
> the necessary
> ProductCategoryRollup record, but not anymore. Same for service
> "updateProduct".
>
> Do I use the CategoryWorker.java?
>
> Jonathon
>