Chuck,

The second method you mentioned worked very well.

Thanks,
Darich

-----Original Message-----
From: Chuck Hill
To: Darich Runyan
Cc: WebObjects-Dev Mailing List List
Sent: 6/16/2009 2:21 PM
Subject: Re: EOF in Java  Application

Hi Darich,


On Jun 16, 2009, at 10:42 AM, Darich Runyan wrote:

> Dave,
>
> I had a legacy swing based Java application that was using a home- 
> spun data
> access layer.  The powers that be decided they wanted to quickly  
> move to a
> web application.  I did not/still do not have the time to re-write the
> entire app because it is huge so my team wrote a flash front end  
> quickly and
> interfaced that with a bunch of the legacy objects and methods that  
> had been
> wrapped up and deployed within Tomcat (I realize it is not the best  
> method
> but money and time were short).  We are still using the home spun  
> ORM.  I
> want to move to a better ORM and I had worked with WO on a couple of
> projects in the past and remember the power of EOF so I suggested to  
> my lead
> developer to look into it.  He created a model and reworked some of  
> our code
> to use the EOF Java Objects but it is not working.  I am pretty sure  
> that it
> has something to do with loading the model, which brings up your  
> second
> question.  Yes, I think it can't find the model.

Yes, you can do what you want.  There was an example somewhere called,  
I think, JavaTool.  /System/Library/WebObjects/JavaApplications/ 
javaeoutil.woa on your hard drive is another example that this is  
possible.

There are two approaches to this: the easy way and the hard "fight the  
tool" way.

The easy way is to package your app as a .woa bundle with the models  
in App.woa/Contents/Resources and the working directory at launch of  
App.woa.  This structure is what allows all the automatic loading  
behavior you are expecting.

The hard way (and I suspect it is not all that hard) is to create the  
default model group and then manually load the model(s).  See the  
JavaDocs on EOModelGroup and EOModel for how to do this.

Chuck


> On 6/16/09 1:25 PM, "David Avendasora" <webobje...@avendasora.com>  
> wrote:
>
>> Hi Darich,
>>
>> A couple questions because it is unclear what you are trying to do.
>>
>> 1) By Pure Java do you mean a Java Client application where the  
>> client
>> machines are using a Swing UI?
>>
>> 2) Do you have an EOModel file that it can't find, or are you trying
>> to create an EOF app without a model?
>>
>> Dave
>>
>> On Jun 16, 2009, at 1:08 PM, Darich Runyan wrote:
>>
>>> Hello,
>>>
>>> I would like to use EOF in a pure Java application and not from
>>> within WO.
>>> I have searched and not found any good information on this topic.
>>> It seems
>>> that I should be possible but all of the code that I have written
>>> keeps
>>> tanking and if it cannot find the model.  Is there any information
>>> on this
>>> subject available?
>>>
>>> Thanks
>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
>>> Help/Unsubscribe/Update your Subscription:
>>>
http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avend
asora
>>> .com
>>>
>>> This email sent to webobje...@avendasora.com
>>>
>>>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
>
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-vil
lage.net
>
> This email sent to ch...@global-village.net
>

-- 
Chuck Hill             Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/
 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to