Re: Re: Adding EOModels embedded in an external framework to an existing project [Solved]
Re: Re: Adding EOModels embedded in an external framework to an existing project [Solved]
- Subject: Re: Re: Adding EOModels embedded in an external framework to an existing project [Solved]
- From: Peter <email@hidden>
- Date: Tue, 11 Jul 2006 15:28:34 -0400
Thanks Chuck,
You saved me some time with a few good points.
On 7/11/06, Chuck Hill <email@hidden> wrote:
Hi Peter,
On Jul 11, 2006, at 10:59 AM, Peter wrote:
> I have read some of the past post on adding an EOModel to an existing
> WO project. It seems like much of the problems with adding a model to
> the project have been no adding it as "Create Folder References".
>
> I have a slightly different problem. I have an EOModel that is part
> of a separate framework. I need to use some of the entities in that
> EOModel (and business logic in the related java classes in the
> framework) in an existing project.
>
> I can add the framework to the project without a problem (application
> server target) and compile my project successfully. However, when
> running the project, I do not see my the model I added (via the
> external framework).
Has the framework been installed in /Library/Frameworks?
No. This framework is in a different location. This is part of my
problem as this was in a non standard location. This is part of my
testing and design, so I still wanted to get this to work.
> I am checking this using the following (EOModelGroup.defaultGroup
> ()).models().
That is the correct test for this.
> As a test I created a new WO Application project and added the
> framework in the wizard setup. After I add the framework, the next
> part of the wizard asks to Add EOModels. (My model appears). When I
> run the test project, I can see the model and all works fine.
I have not used that before, but it seems to me that your model
should _not_ show up if it is in a framework.
> Further testing, I removed the framework from the project, cleaned,
> re-indexed and re-ran the project. As I expected, the model did not
> show. However, when I attempted to re-add the framework the project,
> I could no longer get it to show up again.
>
> I am just not sure what "magic" happens during the wizard setup for
> the project and how I can manually add a framework (with an EOModel)
> to a project. How does a WO Application "know" what models it "has"
> (i.e. where in the project is this information stored)? I have
> searched the targets, and project files without luck.
It is not explicitly stored. The models are located from the
classpath at runtime. For example, if the classpath as
/Library/Frameworks/MyFramework.framework/Resources/Java/MyFramework.jar
Then the app will load any EOModels found in
/Library/Frameworks/MyFramework.framework/Resources/*.eomodeld
Thanks... now I can finally rest that eomodels are not explicitly
stored within the project file or targets. It is seemed more like a
matter of classpath.
Look in your app project in the directory
MyApp/build/Development/MyApp.woa/Contents/MacOS/MacOSClassPath.txt
and see what is getting on the classpath.
That was it. When I added the framework with the embedded eomodel, it
was added at "relative to project", so my classpath was point to an
errant location for the resulting woa. I should have used "absolute
path" or "relative to build" for it to resolve correctly in the
classpath . Once I changed the reference, checked the MacOSClassPath
of the resulting woa, it found the model just fine when running.
Thanks again!
It could also be a problem in the framework with the eomodeld not
being included in the FW properly.
I did check and the eomodel, was in
myFramework.framework/Resources/myModel.eomodeld.
Chuck
--
Coming sometime... - an introduction to web applications using
WebObjects and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
Pete
_______________________________________________
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