Re: Retrieving an EO from a serialized Propertylist in database table textfield

2010-02-24 Thread Andrew Lindesay
Hello Johan;

You really need to serialise a GID and then deserialise the GID and fault it on 
the target system.  NSKeyGlobalID and NSTemporaryGlobalID both conform to 
NSCoding so I guess that you could use that to achieve what you are after?  You 
could also use something like my JSON serialisation as an alternative.

cheers.


> I am trying to get a NSarray of NSDictionaries with Objects from one 
> application to another application via a database text field. 
> 
> My idea was that I would first serialize the stuff on one side:
> 
> setPlistTextField ( NSPropertyListSerialization.stringFromPropertyList( 
> cart() ) )
> 
> next, get it out on the other side:
> 
> itemsList= (NSArray) NSPropertyListSerialization.propertyListFromString( 
> plistTextField() )
> 
> And then from the NSDictionary retrieve the EO Objects with some EOUtilities 
> method. 
> 
> I first thought that 
> 
> Product ciProduct = (Product) EOUtilities.localInstanceOfObject( 
> session.myEc(), (nl.netsense.theater.Product) 
> tmpCartItem.objectForKey("product") )
> 
> would do the trick, but that is not the case (I can imagine that the stuff I 
> am sending it is not really a EnterpriseObject.
> 
> The NSDictionary that I am getting contains stuff like this:
> 
> {performance = ""; total = "11.0"; 
> qty = "1"; product = ""; }
> 
> Which EOUtilities method would be able to retrieve the EO again from a 
> dictionary value like:
> 
> performance = ""
> 
> ?

___
Andrew Lindesay
www.lindesay.co.nz

 ___
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


Retrieving an EO from a serialized Propertylist in database table textfield

2010-02-24 Thread Johan Henselmans
I am trying to get a NSarray of NSDictionaries with Objects from one 
application to another application via a database text field. 

My idea was that I would first serialize the stuff on one side:

setPlistTextField ( NSPropertyListSerialization.stringFromPropertyList( cart() 
) )

next, get it out on the other side:

itemsList= (NSArray) NSPropertyListSerialization.propertyListFromString( 
plistTextField() )

And then from the NSDictionary retrieve the EO Objects with some EOUtilities 
method. 

I first thought that 

Product ciProduct = (Product) EOUtilities.localInstanceOfObject( 
session.myEc(), (nl.netsense.theater.Product) 
tmpCartItem.objectForKey("product") )

would do the trick, but that is not the case (I can imagine that the stuff I am 
sending it is not really a EnterpriseObject.

The NSDictionary that I am getting contains stuff like this:

{performance = ""; total = "11.0"; 
qty = "1"; product = ""; }

Which EOUtilities method would be able to retrieve the EO again from a 
dictionary value like:

performance = ""

?


Johan Henselmans
jo...@netsense.nl



 ___
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