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.cfmFile
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