Implement filtering non-invasively

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

Implement filtering non-invasively

benni23
Hi,

I am currently trying to add a feature to the ecommerce component that allows to restrict visibility of products by assigning customer groups (party groups) to an associated  category. I would like to do that without changing any of the existing code. My approach was to use secas but I discovered that I have no mean to get hold on the result of the service that triggered my seca. Thus I can't add filtering without touching existing code. Now I wonder if there is a different way of doing this, since I can't imagine that there is no way of changing the result of a service without changing framework code.

regards,
Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: Implement filtering non-invasively

Jacopo Cappellato-4
On Apr 15, 2009, at 12:25 PM, benni23 wrote:

> Now I wonder if there is a different way of doing this, since I can't
> imagine that there is no way of changing the result of a service  
> without
> changing framework code.

You can re-implement (override) the service in your custom component.

Jacopo


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

Re: Implement filtering non-invasively

benni23
Hi,

I am not sure if I understand fully what you mean. If I define a service with the same name in my custom component, how should the service engine know which one to invoke.
I can write my own implementation and tell the service engine that it should use my implementation instead of the existing one. But to do this,  I would need to change framework code (the service mapping) and that is what i want to avoid. Also, I want to use the original service and add some logic (filtering) to it and not replace it.
Currently, I have renamed the original service and mapped my custom implementation to the original service name and call the original service from my custom implementation and then postprocess its result. But I would rather use something like the ECA mechanism and not change any of the existing mappings.

regards


Jacopo Cappellato-4 wrote
On Apr 15, 2009, at 12:25 PM, benni23 wrote:

> Now I wonder if there is a different way of doing this, since I can't
> imagine that there is no way of changing the result of a service  
> without
> changing framework code.

You can re-implement (override) the service in your custom component.

Jacopo