On Wed, May 20, 2009 at 11:24 AM, Mike Schrag <[email protected]> wrote: > JavaFSAdaptor is intended to show people how to make a custom EO adaptor, > not to .. actually be used. >
Sigh.. I'm coming to that realization. I was hoping it would be useful as an in-wo way of documents uploaded (thousands of files, folders, subfolders, etc). Currently, this has been done with Apache and various config changes there, but the target sysadmins for my app sadly are more of the point-and-click skill set. > ms > > On May 20, 2009, at 2:22 PM, Joe Little wrote: > >> On Wed, May 20, 2009 at 11:12 AM, Chuck Hill <[email protected]> >> 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 >>> >>> >> >> Getting somewhere. I had thought content was writable -- and the code >> generation would make you think so. Alas, the model does say >> read-only, so it would appear that the JavaFSAdaptor in its current >> incarnation does not allow any setting of the content itself. Its all >> read-only across the board. One can create files or directories, but >> there is no way to save data to those files. Yikes. >> >> >> >> >>>> >>>> >>>> >>>> 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 protected]) >>>> Help/Unsubscribe/Update your Subscription: >>>> >>>> >>>> http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net >>>> >>>> This email sent to [email protected] >>>> >>> >>> -- >>> 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 protected]) >> Help/Unsubscribe/Update your Subscription: >> >> http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40mdimension.com >> >> This email sent to [email protected] > > > _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
