Overriding component in a framework ???
Overriding component in a framework ???
- Subject: Overriding component in a framework ???
- From: Peter Vandoros <email@hidden>
- Date: Fri, 02 Sep 2005 15:09:54 +1000
I have recently turned an application into a framework with the hope of
creating another application using the new framework as the base
(extending Application, Session, etc... classes) and "overriding" some
components to provide some customization for a client without affecting
the main application (the new framework).
All seemed to go well until I tried to override one of these components.
It seems that my application is using the component template from the
application but using the
java class from the framework rather than the applications java class.
Example
Framework contains TestComponent.wo
package com.foo.components;
public class TestComponent extends WOComponent {
public TestComponent(WOContext woContext) {
super(context);
}
public WOComponent testAction() {
System.out.println("Test Action called from framework");
return null;
}
... more functionality here ...
}
Application also contains TestComponent.wo
package com.foo.bar.components;
public class TestComponent extends com.foo.components.TestComponent {
public TestComponent(WOContext woContext) {
super(context);
}
public WOComponent testAction() {
System.out.println("Test Action called from application");
return null;
}
}
After looking into this for some time I belive I have tracked it down to
NSBundle searching the available packages in the wrong order.
When I print the application bundle I get something like this.
<com.webobjects.foundation.NSBundle name:'fooapplication'
bundlePath:'C:\Projects\Fubar' packages:'("com.foo.components",
"com.foo.bar.components")' 256 classes >
So it seems obvious that its looking in the framework
'com.foo.components' package before it looks in the applications
'com.foo.bar.components' package.
Does anyone know how this package order is determined or have any other
suggestions on how this problem can be fixed.
Any help would be greatly appreciated.
Thanks
Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden