Re: NSPropertyListSerialization fails with OpenStepFormat on OSX

2008-10-27 Thread David Ayers
Am Sonntag, den 26.10.2008, 22:07 +0100 schrieb David Wetzel:
  David Wetzel wrote:
 
   add [+NSPropertyListSerialization 
   dataFromPropertyList:format:errorDescription:] 
   to base-additions, call the Apple implementation if format != 
   NSPropertyListOpenStepFormat
   if code runs on Apple.
 
  What I cannot understand is your proposed solution to this problem. We
  should replace the method in the GNUstep extensions, but still call the
  Apple version of the same method in some cases? There may be way to do
  this, but this is clearly a dangerous proposal.
 
 Why? It will do the same like on a GNUstep or OPENSTEP system.
 
  Wouldn't it be easier to just convert property lists written on new Macs
  to be used on old installations of EOModeler? GNUstep should be able to
  do that conversion.
 
 I want to run DBModeler.app on OSX and read + write .eomodeld files in a 
 format all original 
 EOModelers understand. Otherwise DBModeler is useless.

Let me put that into perspective.  DBModeler is would not be useless if
we changed the plist format.

Yet it could not be used to write EOModel files that are understood by
WO45 anymore, and the reason why some of us are so picky about WO45
compatibility, is that we still have deployments with WO45 so we need to
test within a WO45 development environment to insure compatibility.

Now to a possible resolution.  Instead of a category overriding
Foundations implementation of NSPropertyListSerialization
dataFromPropertyList:format:errorDescription: I'm wondering whether a
category like:

dataInOpenStepFormatFromPropertyList:errorDescription:

would be acceptable for -base-additions...

I guess we could also put in GDL2-EOControl if no one else feels a need
to be able to write old style property lists... on OS X that is, since
-base does still support that format an hopefully will continue to do
so.

Cheers,
David




___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: NSPropertyListSerialization fails with OpenStepFormat on OSX

2008-10-27 Thread Matt Rice
Fred Wrote:..
 From the name of the format in the error message I gather that you are
 complaining about an Apple bug here. Is this correct?

no its really a feature of them deprecating the openstep style plists,
at some point writing worked for legacy apps (as shown by the example
link Dave posted),
and then at some point it appears they have removed it allowing only
to read legacy and write xml plists...

if you look here it is clearly deprecated..

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSPropertyListSerialization_Class/Reference/Reference.html

quote:
Important: The NSPropertyListOpenStepFormat constant is not supported
for writing. It can be used only for reading old-style property lists.

On Sun, Oct 26, 2008 at 2:07 PM, David Wetzel [EMAIL PROTECTED] wrote:
 David Wetzel wrote:

  add [+NSPropertyListSerialization 
  dataFromPropertyList:format:errorDescription:]
  to base-additions, call the Apple implementation if format != 
  NSPropertyListOpenStepFormat
  if code runs on Apple.

 What I cannot understand is your proposed solution to this problem. We
 should replace the method in the GNUstep extensions, but still call the
 Apple version of the same method in some cases? There may be way to do
 this, but this is clearly a dangerous proposal.

 Why? It will do the same like on a GNUstep or OPENSTEP system.

I think Fred's 'clearly a dangerous proposal.' mostly is coming from
the fact that in order to override a method with the category and then
call the original implementation will require runtime hacking through
method swizzling, and overrides intended noon-functionality of their
foundation...

http://www.cocoadev.com/index.pl?MethodSwizzling

It may be worthwhile to think of a less invasive (not to mention
easier) change, of just exposing the GNUstep implementation of
NSPropertyListSerialization as GSPropertyListSerialization and adding
it to base-additions then using that in gdl2


 Wouldn't it be easier to just convert property lists written on new Macs
 to be used on old installations of EOModeler? GNUstep should be able to
 do that conversion.

 I want to run DBModeler.app on OSX and read + write .eomodeld files in a 
 format all original
 EOModelers understand. Otherwise DBModeler is useless.

 http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Articles/OldStylePListsTa
 sk.html


yeah, that works with GNUstep but there is also old WebObjects
installations which predate xml plists entirely

let me just add another slightly related tidbit here
https://savannah.gnu.org/bugs/?22364

DBModeler is also in the same position as cenon I think, it is wanting
the old style plists when NSValue's etc were encoded as strings
it looks like if we used NSPropertyListSerialization we might be able
to get rid of the places when we encode where we manually convert
everything to strings, and we could go back to just encoding NSValue's
which might clean up that code a bit too..

as it is, the code dates back from when there was 'one plist format to
rule them all.', which predates NSPropertyListSerialisation, and when
the GNUstep plist format was changed, we just coaxed the code into
encoding the correct object types that it expects to find...

anyhow, i'm pro reliable way to write old openstep style plists.


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: NSPropertyListSerialization fails with OpenStepFormat on OSX

2008-10-26 Thread Fred Kiefer
David Wetzel wrote:
 Hi,
 
 this:
 
   NSData   *plistData = nil;
   NSString *error;
   NSString *fmt;
 
   plistData = [NSPropertyListSerialization dataFromPropertyList:plist
  
 format:NSPropertyListOpenStepFormat
errorDescription:error];
 
 fails:
 
 Save failed: Could not create file: 
 /private/tmp/newstuff.eomodeld/Address.plist -- Property list 
 format kCFPropertyListOpenStepFormat not supported for writing
 
 That disables exchange with older EOModeler programs.
 Which is in turn incompatible.
 
 Possible solution:
 
 add [+NSPropertyListSerialization 
 dataFromPropertyList:format:errorDescription:] 
 to base-additions, call the Apple implementation if format != 
 NSPropertyListOpenStepFormat
 if code runs on Apple.
 
 What do you think?

From the name of the format in the error message I gather that you are
complaining about an Apple bug here. Is this correct?

What I cannot understand is your proposed solution to this problem. We
should replace the method in the GNUstep extensions, but still call the
Apple version of the same method in some cases? There may be way to do
this, but this is clearly a dangerous proposal.
Wouldn't it be easier to just convert property lists written on new Macs
to be used on old installations of EOModeler? GNUstep should be able to
do that conversion.

Fred


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: NSPropertyListSerialization fails with OpenStepFormat on OSX

2008-10-26 Thread David Wetzel
 David Wetzel wrote:

  add [+NSPropertyListSerialization 
  dataFromPropertyList:format:errorDescription:] 
  to base-additions, call the Apple implementation if format != 
  NSPropertyListOpenStepFormat
  if code runs on Apple.

 What I cannot understand is your proposed solution to this problem. We
 should replace the method in the GNUstep extensions, but still call the
 Apple version of the same method in some cases? There may be way to do
 this, but this is clearly a dangerous proposal.

Why? It will do the same like on a GNUstep or OPENSTEP system.

 Wouldn't it be easier to just convert property lists written on new Macs
 to be used on old installations of EOModeler? GNUstep should be able to
 do that conversion.

I want to run DBModeler.app on OSX and read + write .eomodeld files in a format 
all original 
EOModelers understand. Otherwise DBModeler is useless.

http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Articles/OldStylePListsTa
sk.html

-- 
David Wetzel

___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev