This is cool stuff Baz. I'm sure Vince will response on your question. I 
have an additional question.

How is / does Open BD handle the object graph of a CFC (basically a CFC 
has that other CFCs via composition) and deserializing it to the Google 
Datastore?  Is that something that will be handled via cfproperty?  I'm 
asking because I'm sure there are some CFCs where you want to 
deserialize some, but all not all CFCs via composition (for instance an 
application wide CFC that you an inject after serialization).

Thanks in advance,
.Peter

Baz said the following on 06/02/2009 01:51 AM:
> I wrote some simple test code to write and read a cfc from the Google 
> Datastore, included below. It creates a test cfc, sets a few 
> properties to simlpe values, GoogleWrite()'s the cfc to the google 
> datastore, then reads back the cfc from the google datastore into a 
> new variable. If that new variable is dump'ed, the component defintion 
> along with its functions, displays successfully. If I try and get a 
> property value, however, the variable is undefined. It seems that 
> property values did not survive the write.
>
> Is there something wrong with the test code or some other issue to 
> consider? The google dashboard (under the heading "Data Viewer") 
> doesn't show any objects saved either.
>
> Cheers,
> Baz
>
>
> _*Contents of index.cfm*_
>
> <!--- create and populate testcfc --->
> <cfscript>
>     TestCFC=createobject('component', 'testcfc');
>     TestCFC.setProp1(123);
>     TestCFC.setProp2(now());
>     TestCFC.setProp3('this is a string');
> </cfscript>
>
> <!--- write component to datastore --->
> <cfset Google_Key=TestCFC.GoogleWrite() />
>    
> <!--- read back the object --->
> <cfset ReadTestCFC=GoogleRead(Google_Key) />
>
> <!--- ERROR: Variable PROP1 does not exist.) --->
> <cfdump var="#ReadTestCFC.getProp1()#">
>
>
> *CFML Runtime Error*
> *Variable PROP1 does not exist.*
> Request       /index.cfm
> File Trace    /home/baz/Source/GAE-OpenBD/war/index.cfm
> |
> +-- /home/baz/Source/GAE-OpenBD/war/testcfc.cfc
>
>
>
>
> _*Contents of testcfc.cfc*_
>
> <cfcomponent displayname="testdisplayname" output="false">
>
>     <cfproperty name="prop1" type="numeric" />
>     <cfproperty name="prop2" type="date" />
>     <cfproperty name="prop3" type="any" />
>
>     <cffunction name="getProp1" access="public" output="false" 
> returntype="numeric">
>         <cfreturn prop1 />
>     </cffunction>
>
>     <cffunction name="setProp1" access="public" output="false" 
> returntype="void">
>         <cfargument name="prop1" type="numeric" required="true" />
>         <cfset prop1 = arguments.prop1 />
>         <cfreturn />
>     </cffunction>
>
>     <cffunction name="getProp2" access="public" output="false" 
> returntype="date">
>         <cfreturn prop2 />
>     </cffunction>
>
>     <cffunction name="setProp2" access="public" output="false" 
> returntype="void">
>         <cfargument name="prop2" type="date" required="true" />
>         <cfset prop2 = arguments.prop2 />
>         <cfreturn />
>     </cffunction>
>
>     <cffunction name="getProp3" access="public" output="false" 
> returntype="any">
>         <cfreturn prop3 />
>     </cffunction>
>
>     <cffunction name="setProp3" access="public" output="false" 
> returntype="void">
>         <cfargument name="prop3" type="any" required="true" />
>         <cfset prop3 = arguments.prop3 />
>         <cfreturn />
>     </cffunction>
> </cfcomponent>
>
> >


--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
 http://groups.google.com/group/openbd?hl=en
 official site @ http://www.openbluedragon.org/

!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to