I'm not sure, but if I remember well, when settings
lowercase-key to true, all the properties were completely lowercased instead of
uppercased.
To be confirmed...
Few months back, I did some testing, trying also for
example to use this['myProperty'] instead of this.myProperty in order to keep
the case on the ColdFusion side (a known workaround in
Flex1.5).
But I did not manage to send the ColdFusion typed object
with properties correctly "cased".
To use a setter function on the AS VO is the best
workaround I've found till now.
When migrating from Java VO to CFC VO, you do not have
to change anything on the AS side except to add those setters to deal with case
insensitivity of ColdFusion.
Benoit Hediard
De : [email protected] [mailto:[EMAIL PROTECTED] De la part de Ian Welsh
Envoyé : mardi 29 novembre 2005 11:33
À : [email protected]
Objet : [coldspring-dev] AS VO to CF VO in current Flex 2 alpha
Benoit, does this setting in gateway-config.xml (CF Server)
make any difference to the uppercase issue?
<!-- ActionScript 1.0 and ColdFusion
use case insensitive data structures
to store associative arrays, objects and structs - the Java representation
of these datatypes requires a case-insensitive Map, which the gateway
achieves by looking up all keys in lowercase. If case insensitivity is desired
then this setting should be set to true. ActionScript 2.0 is now case sensitive,
but setting this to true will allow ColdFusion to look up keys case insensitively, and
will not actually change the case of the keys. For AS 2.0 to java this should be false,
since both are case sensitive. -->
<lowercase-keys>true</lowercase-keys>
to store associative arrays, objects and structs - the Java representation
of these datatypes requires a case-insensitive Map, which the gateway
achieves by looking up all keys in lowercase. If case insensitivity is desired
then this setting should be set to true. ActionScript 2.0 is now case sensitive,
but setting this to true will allow ColdFusion to look up keys case insensitively, and
will not actually change the case of the keys. For AS 2.0 to java this should be false,
since both are case sensitive. -->
<lowercase-keys>true</lowercase-keys>
I don't have time to try a test but I thought this setting
in CF7 took the mapping problem away. CFAdapter is CF7 only, so I am surprised
you still need to do this mapping.
++++ Stops to look in the CFAdapter zip
++++
In the CFAdapter coldfusionsamples.xml
file
<destination
id="UserManager_usrCollection">
<properties>
<source>CFIDE.samples.usermanager.components.UserCollection</source>
<lowercase-keys>false</lowercase-keys>
</properties>
<channels>
<channel ref="my-cfamf"/>
</channels>
</destination>
<destination id="UserManager_usrManager">
<properties>
<source>CFIDE.samples.usermanager.components.UserManager</source>
<lowercase-keys>false</lowercase-keys>
</properties>
<channels>
<channel ref="my-cfamf"/>
</channels>
</destination>
<properties>
<source>CFIDE.samples.usermanager.components.UserCollection</source>
<lowercase-keys>false</lowercase-keys>
</properties>
<channels>
<channel ref="my-cfamf"/>
</channels>
</destination>
<destination id="UserManager_usrManager">
<properties>
<source>CFIDE.samples.usermanager.components.UserManager</source>
<lowercase-keys>false</lowercase-keys>
</properties>
<channels>
<channel ref="my-cfamf"/>
</channels>
</destination>
the destination has lowercase keys as false. Would setting
it to true make a difference.
When I get a minute I'll have a go
Or have I missed something ....
Regards
Ian
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Benoit Hediard
Sent: 29 November 2005 09:48
To: [email protected]
Subject: [coldspring-dev] AS VO to CF VO in current Flex 2 alpha
Here is an example of AS VO and CF VO in current Flex
2 alpha.
To solve the uppercase problem, i've only added the
corresponding setter in the AS VO (only used during deserialization
process).
(better approach than defining properties in
uppercase using getter/setter to access them, as in UserManager CFAdapter
sample app, see User.as)
SomeVO.as:
package com.mycompany.myapp.model {
import flash.net.*;
public class SomeVO {
public var text:String;
public var title:String;
public function SomeVO() {
registerClassAlias("com.mycompany.myapp.model.SomeVO", SomeVO);
text =
"";
title = "";
}
public function set TEXT(text:String):Void {
this.text = text;
}
public function set TITLE(title:String):Void {
this.title = title;
}
}
}
title = "";
}
public function set TEXT(text:String):Void {
this.text = text;
}
public function set TITLE(title:String):Void {
this.title = title;
}
}
}
SomeVO.cfc:
<cfcomponent>
<cfproperty name="text" type="String">
<cfproperty name="title" type="String">
<cffunction
name="init">
<cfscript>
this.text = "";
this.title = "";
</cfscript>
<cfreturn this />
</cffunction>
<cfscript>
this.text = "";
this.title = "";
</cfscript>
<cfreturn this />
</cffunction>
</cfcomponent>
Benoit Hediard
De : [email protected] [mailto:[EMAIL PROTECTED] De la part de Kurt Wiersma
Envoyé : mardi 29 novembre 2005 02:07
À : [email protected]
Objet : [coldspring-dev] Ping.
--Kurt
On 11/28/05, Chris
Scott <[EMAIL PROTECTED]
> wrote:
Welcome to the ColdSpring list Scott!
We've been looking at / thinking about the CFAdapter and how it will
fit into our remoting plans. I think we will be going in the
direction of offering 2 types if RemitingProxyFactories, one relying
on the CFadapter, one using the mapping utility class for legacy /
non-flex apps. One thing is certain, flex developers is a key target
audience for ColdSpring.
Chris
On Nov 28, 2005, at 7:05 AM, Scott Barnes wrote:
> Sorry, wasn't sure if my email-mic-test was working.
>
> BTW: The new CFAdapter should negate the need to resolve Mappings from
> ASObject to CFC, it should do all that for you?
>
> ie:
> com.mossyblog.cfc.testVO returned out *should* resolve to
> com.mossyblog.as.testVO auto-magically instead of having to do
> ASObject.setType(), ASObject.put() approach (ie FLEX 1.5 approach).
>
>
>
> On 11/28/05, Scott Barnes <[EMAIL PROTECTED]> wrote:
>> Ping.
>>
>> --
>> Regards,
>> Scott Barnes
>> http://www.mossyblog.com
>>
>>
>
>
> --
> Regards,
> Scott Barnes
> http://www.mossyblog.com
>
