On 30/04/2010, at 4:12 PM, Bob Morley wrote:

> 
> 
> Scott Gray-2 wrote:
>> 
>> What about adding something like the following to ofbiz-component.xml
>> schema
>> <extend-web-app name="order"
>>    include-controller="path/to/controller.xml"
>> />
>> 
>> This would basically be similar to the "include" element available in the
>> controller schema except that it would override any elements in the
>> web-app's normal controller.
>> 
>> Doing this would allow us to externally override any requests and views in
>> a base application's controller without needing to completely replace the
>> existing webapp and could be a good starting point for building "plug-in"
>> support.
>> 
>> Say for example you simply want to make a few changes to the EditProduct
>> screen, you could just override the view-mapping to point to a screen in
>> your custom component and boom, you're done.
>> 
> 
> I really like the concept.  Building on this, two variances for your
> consideration came to mind ...
> 
> <request-map webapp-name="partymgr" uri="EditParty"> ...
> <view-map webapp-name="partymgr" name="EditParty" type="view" ...

Well what I could do is just make include-controller a child element and allow 
more than one entry, then you can just put your requests in one and the views 
in the other (if your that way inclined).

> OR a new element ...
> 
> <controller-override webapp="partymgr">
>   [standard request & view maps elements]
> </ ...

Not 100% sure what you mean there.

> This came from a perceived desire to be more granular in what I override in
> another application.  The other is to be able to separate out my "overrides"
> from my standard controller.  ie.  I could see having a controller.xml and a
> controller-override.xml (where controller.xml includes override).

Not entirely sure I follow you there, the existing model whereby you replace 
the legacy webapp with a new one from hot-deploy does what you describe above 
i.e. it only contains your modifications to the original because you use 
include-controller and then only override what you need to.

> The other thought is maybe consider a "global" definition -- I believe
> services does there service definitions are in general global, but the
> infrastructure is in place to have a local set of services (I think it keeps
> two maps and looks in "local" for your dispatcher first).  If memory
> services, there are not examples of this usage in OOB Ofbiz mind you. 
> Naturally name collisions become a real consideration with this type of
> thing ...

I wasn't aware of services having that capability, I'll have to look into it 
sometime as it sounds interesting.  But back to the point, I'm not entirely 
sure I understand what a global definition would mean from controller entries?

> PS.  You can see I used "override" instead of "extend" because it seem more
> clear to me what it was doing.

To me override means to "replace" whereas extend means "inherit and alter", the 
latter feels clearer to me since it is much more analogous to extending a class 
then it is to overriding a method.

Regards
Scott

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to