• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: JavaFSAdaptor and non-working EO methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JavaFSAdaptor and non-working EO methods


  • Subject: Re: JavaFSAdaptor and non-working EO methods
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 20 May 2009 11:40:05 -0700


On May 20, 2009, at 11:24 AM, Joe Little wrote:

And to answer Chuck's question, his way did "work better" and that is
how I found out about the read-only attribute failure on write. I took
my code example from the JavaFS examples (which Pascal further
immortalized on the wiki). If its the wrong way, perhaps that should
be updated and/or give the reason why what it says is murderous :) The
latter is something I'm unsure of myself as I fell into that hole.

The real issue is that you do myFile.takeValueForKey ("/tmp/mytest", "absolutePath");
BEFORE inserting the new EO into the editing context.





On Wed, May 20, 2009 at 11:12 AM, Chuck Hill <chill@global- village.net> wrote:

On May 20, 2009, at 11:06 AM, Joe Little wrote:

I got the JavaFSAdaptor up and running, created a model, eogenerated,
and was able to create a file just fine. However, let's look at an
example that fails. I'm trying to set the content, which apparently
can only be a string:


EOClassDescription aClassDescription =
EOClassDescription.classDescriptionForEntityName("FSFile");
EOEditingContext ec = session().defaultEditingContext();

FSFile myFile = (FSFile)
aClassDescription.createInstanceWithEditingContext(ec, null);
myFile.takeValueForKey ("/tmp/mytest", "absolutePath");
ec.insertObject(myFile);

That seems somewhere between scary and dangerous. How about this:

EOEditingContext ec = session().defaultEditingContext();
FSFile myFile = (FSFile)EOUtilities.createAndInsertInstance(ec, "FSFile");
myFile.takeValueForKey ("/tmp/mytest", "absolutePath");


then on with:

myFile.setContent("Good Test!"); ec.saveChanges();

Does that work any better?


Chuck





Now, later when I reference that file from a fresh fetch, I do get
"Good Test!" when viewing the content. However, the file itself is
empty on the filesystem. Perhaps content isn't what I think it is.
Well, FSFile.name() is a method to get the filename for the given
file. Referencing that always returns null. So does FSfile.path().
Something is seriously not going as expected with this adaptor and/ or
I'm missing some basic understanding of what the EO purports to
support.
_______________________________________________
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


-- Chuck Hill Senior Consultant / VP Development

Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/




-- 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      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >JavaFSAdaptor and non-working EO methods (From: Joe Little <email@hidden>)
 >Re: JavaFSAdaptor and non-working EO methods (From: Chuck Hill <email@hidden>)
 >Re: JavaFSAdaptor and non-working EO methods (From: Joe Little <email@hidden>)

  • Prev by Date: Re: JavaFSAdaptor and non-working EO methods
  • Next by Date: Re: JavaFSAdaptor and non-working EO methods
  • Previous by thread: Re: JavaFSAdaptor and non-working EO methods
  • Next by thread: Re: JavaFSAdaptor and non-working EO methods
  • Index(es):
    • Date
    • Thread