Overriding product display service

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

Overriding product display service

Grant Edwards-2
Hi,

I am trying to override the service that displays products in the
various categories. I need to change what data is returned, prior to the
rendering thereof.
org.ofbiz.product.category.CategoryServices.getCategoryMembers(......),
seemed like the correct service to override, but the overriding thereof
has had no effect.

Any help would be appreciated.

Kind regards

Grant Edwards
Reply | Threaded
Open this post in threaded view
|

Re: Overriding product display service

Jacques Le Roux
Administrator
Maybe I did not understand your question, but here we go :
OFBiz uses a Service Oriented Architecture (SOA). It does not use (only) Plain Old Java Object (POJO). In your case you must
understand that org.ofbiz.product.category.CategoryServices.getCategoryMembers(......),  is used by the service
getProductCategoryMembers (in applications/product/servicedef/services_view.xml) and overriding getCategoryMembers can't have no
effect in this service.

Please have a look at the documentation http://docs.ofbiz.org/display/OFBADMIN/Apache+OFBiz+Getting+Started
http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Documentation+Index

Jacques

From: "Grant Edwards" <[hidden email]>

> Hi,
>
> I am trying to override the service that displays products in the various categories. I need to change what data is returned,
> prior to the rendering thereof. org.ofbiz.product.category.CategoryServices.getCategoryMembers(......), seemed like the correct
> service to override, but the overriding thereof has had no effect.
>
> Any help would be appreciated.
>
> Kind regards
>
> Grant Edwards
>

Reply | Threaded
Open this post in threaded view
|

Re: Overriding product display service

Grant Edwards-2
Jacques, thank for the reply.

I do understand the architecture used by OFBiz, by all accounts my
question might not have been very clear.

I am attempting to override the getCategoryMembers(.....),  in a
hot-deploy component that I am writing, take a look at the service
definition below:

<service name="getProductCategoryMembers" engine="java"
location="com.gat.search.services.CategoryServices"
invoke="getCategoryMembers">
        <description>Gets ProductCategoryMembers for the
category_id</description>
        <attribute name="categoryId" type="String" mode="IN"/>
        <attribute name="category" type="org.ofbiz.entity.GenericValue"
mode="OUT"/>
        <attribute name="categoryMembers" type="java.util.Collection"
mode="OUT"/>
    </service>

Within my version of com.gat.search.services.CategoryServices I am
replacing/overriding the functionality provided by the service
getProductCategoryMembers. This has all worked fine, and within
https://localhost:8443/webtools/control/availableServices I can see my
new service.
https://localhost:8443/webtools/control/availableServices?constraint=location@...




Now getting back to my original question. I need to change what products
are displayed for any given category. I had assumed that
replacing/overriding the service called getProductCategoryMembers would
enable me to do this, but unfortunately I am still seeing the original
list of products displayed in the category in question.

Is getProductCategoryMembers the correct service to replace/override in
order to change what products are displayed for a given category ?

Kind regards

Grant Edwards






Jacques Le Roux wrote:

> Maybe I did not understand your question, but here we go :
> OFBiz uses a Service Oriented Architecture (SOA). It does not use
> (only) Plain Old Java Object (POJO). In your case you must understand
> that
> org.ofbiz.product.category.CategoryServices.getCategoryMembers(......),  
> is used by the service getProductCategoryMembers (in
> applications/product/servicedef/services_view.xml) and overriding
> getCategoryMembers can't have no effect in this service.
>
> Please have a look at the documentation
> http://docs.ofbiz.org/display/OFBADMIN/Apache+OFBiz+Getting+Started
> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Documentation+Index
>
> Jacques
>
> From: "Grant Edwards" <[hidden email]>
>> Hi,
>>
>> I am trying to override the service that displays products in the
>> various categories. I need to change what data is returned,
>> prior to the rendering thereof.
>> org.ofbiz.product.category.CategoryServices.getCategoryMembers(......),
>> seemed like the correct
>> service to override, but the overriding thereof has had no effect.
>>
>> Any help would be appreciated.
>>
>> Kind regards
>>
>> Grant Edwards
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Overriding product display service

Bilgin Ibryam
In reply to this post by Grant Edwards-2
Hi Grant,

I think the service you are looking for is getProductCategoryAndLimitedMembers

Bilgin
Reply | Threaded
Open this post in threaded view
|

Re: Overriding product display service

Grant Edwards-2
Thanks  Bilgin, that exactly what I was looking for.


Bilgin Ibryam wrote:
> Hi Grant,
>
> I think the service you are looking for is
> getProductCategoryAndLimitedMembers
>
> Bilgin
>