Just read this... I guess Bruno is thinking along the same lines.

-David


On May 2, 2010, at 12:04 AM, Bruno Busco wrote:

> Thank you Scott for working on this feature.
> "plug-in" type extensions will help a lot.
> 
> I agree with you, I prefer the latter solution also.
> It simply overrides the entries in a single file with the ones contentained
> in a new one. Crystal clear.
> 
> Wouldn't it be better to use the "merge" term instead of the "extend" to
> differentiate from the "extension" mechanism that is already in place?
> 
> About the menu widget, I remember we talk about some time ago.
> At that time I proposed something like a "merge" feature more than an
> extension.
> This was because base menu items should be added/modified/deleted in the
> plugin file.
> There should be also some way to specify in which place the new menu entries
> are shown in the existent menu.
> 
> Thank you,
> Bruno
> 
> 2010/5/2 Scott Gray <[email protected]>
> 
>> On 1/05/2010, at 12:35 AM, Scott Gray wrote:
>> 
>>> On 30/04/2010, at 1:49 PM, Scott Gray wrote:
>>> 
>>>> What about adding something like the following to ofbiz-component.xml
>> schema
>>>> <extend-web-app name="order"
>>>>  include-controller="path/to/controller.xml"
>>>> />
>>> 
>>> Finding the webapp to extend doesn't look so easy, it looks like it would
>> need to be something like:
>>> <extend-webapp server-name="default-server" mount-point="/ordermgr">
>>> That would be the only way to be sure that you're extending the correct
>> webapp.  The name attribute is really only informational and does nothing, I
>> could for example name every webapp in OFBiz "order" and it would have no
>> effect whatsoever.
>> 
>> So I ended up doing two implementations:
>>   <!-- extends the catalog webapp with the ordermgr's controller from a
>> hot-deploy component -->
>> 
>>   <extend-webapp server="default-server" mount-point="/catalog">
>>       <controller-extension
>> location="../../applications/order/webapp/ordermgr/WEB-INF/controller.xml"/>
>>   </extend-webapp>
>> 
>> and:
>>   <!-- extends the catalog's controller with the ordermgr's controller
>> from a hot-deploy component -->
>> 
>>   <extend-controller
>> base-location="component://product/webapp/catalog/WEB-INF/controller.xml"
>> 
>> extend-location="component:///order/webapp/ordermgr/WEB-INF/controller.xml"/>
>> 
>> And I prefer the latter for a number of reasons:
>> - The former requires that you supply a ServletContext (or server name and
>> mount point) when retrieving a ControllerConfig and a number of calling
>> methods do not have that information available
>> - The latter doesn't depend on the mount point or server name meaning that
>> you can change them at will without breaking the extensions
>> - The latter allows you to extend controllers that don't have a webapp, for
>> example you can extend common-controller.xml and then your extensions will
>> be available to everything that includes it.
>> - The implementation on the latter feels a lot cleaner
>> 
>> Any thoughts?
>> 
>> Both work and I really like this feature, having the ability to plug
>> additional functionality into the base apps so easily seems pretty cool.
>> It's a pity I didn't decide to work on this earlier for 10.04.
>> 
>> I think the next step would be to add a similar type of feature for
>> extending the menu widget so that you don't have to override
>> view-maps/screens to add access to extensions.
>> 
>> Regards
>> Scott

Reply via email to