Services for Product Category hierarchies

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

Services for Product Category hierarchies

jonwimp
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
Reply | Threaded
Open this post in threaded view
|

Re: Services for Product Category hierarchies

cjhowe
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 <[hidden email]> 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
>

Reply | Threaded
Open this post in threaded view
|

Re: Services for Product Category hierarchies

Jacques Le Roux
Administrator
In reply to this post by jonwimp
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

Reply | Threaded
Open this post in threaded view
|

Re: Services for Product Category hierarchies

jonwimp
In reply to this post by cjhowe
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 <[hidden email]> 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
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Services for Product Category hierarchies

David E Jones

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 <[hidden email]> 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
>>>
>


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

Re: Services for Product Category hierarchies

jonwimp
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 <[hidden email]> 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
>>>>
>>
>