Re: Using __type__ to return objects to Flex

2008-02-21 Thread Gareth Arch
I think there must be a setting that I'm missing.  I copied the code over to 
new install of Eclipse 3 and CF8 (on a clean PC) and ran the code and it 
returned the correctly Typed Objects (instead of the generic objects I was 
seeing).  I'll probably go through some of the files and see if there's 
something that's installed on the new copy vs. my local copy.  There are quite 
a few xml files in my jrun folder that may be affecting things.  I'll have to 
check it out and see.  What's really frustrating is that if I knew it *didn't* 
work in CF7, then I would just stop, but as I know it *does* work and is 
insanely faster than instantiating objects in CF (and transferring them back to 
AS), that I really want to get it working.

Do you guys think that it is one of the XML files that is causing the weirdness 
or another setting?  I just want to make sure I'm focusing my efforts in the 
correct area.
Thanks.

 On Wednesday 20 Feb 2008, Gareth Arch wrote:
  Thanks for trying.  I'll keep plugging away.  If I find anything, 
 I'll be
  sure to post back (perhaps it will help someone else)
 
 Did you reboot and clean re-compile both ends ?
 
 -- 
 Tom Chiverton
 Helping to biannually build fine-grained design-patterns
 on: http://thefalken.livejournal.com
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in 
 England and Wales under registered number OC307980 whose registered 
 office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, 
 Manchester, M3 3EB.  A list of members is available for inspection at 
 the registered office. Any reference to a partner in relation to 
 Halliwells LLP means a member of Halliwells LLP.  Regulated by The 
 Solicitors Regulation Authority.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above 
 and may be confidential or legally privileged.  If you are not the 
 addressee you must not read it and must not use any information 
 contained in nor copy it nor inform any person other than Halliwells 
 LLP or the addressee of its existence or contents.  If you have 
 received this email in error please delete it and notify Halliwells 
 LLP IT Department on 0870 365 2500.
 
 For more information about Halliwells LLP visit www.halliwells.com.


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299577
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Using __type__ to return objects to Flex

2008-02-21 Thread Gareth Arch
Just figured I would post a follow up here for anyone who is following along 
(or may be in the future).  I've tried way too many different things with 
settings files and could not get it working.  Jon Messer retried and found that 
it was using a CF8 instance from his CFMX7 install, so was not actually using 
CFMX7 to return the values, so thus far returning objects by just using remote 
object on CFMX7 does not appear to work unless using LiveCycle or some other 
dataservices intermediary.  If anyone does get it working (or knows some 
alterations on CFMX7 to get it working), please post.  Thanks.

 I think there must be a setting that I'm missing.  I copied the code 
 over to new install of Eclipse 3 and CF8 (on a clean PC) and ran the 
 code and it returned the correctly Typed Objects (instead of the 
 generic objects I was seeing).  I'll probably go through some of the 
 files and see if there's something that's installed on the new copy vs. 
 my local copy.  There are quite a few xml files in my jrun folder that 
 may be affecting things.  I'll have to check it out and see.  What's 
 really frustrating is that if I knew it *didn't* work in CF7, then I 
 would just stop, but as I know it *does* work and is insanely faster 
 than instantiating objects in CF (and transferring them back to AS), 
 that I really want to get it working.
 
 Do you guys think that it is one of the XML files that is causing the 
 weirdness or another setting?  I just want to make sure I'm focusing 
 my efforts in the correct area.
 Thanks.
 
  On Wednesday 20 Feb 2008, Gareth Arch wrote:
   Thanks for trying.  I'll keep plugging away.  If I find anything, 
 
  I'll be
   sure to post back (perhaps it will help someone else)
  
  Did you reboot and clean re-compile both ends ?
  
  -- 
  Tom Chiverton
  Helping to biannually build fine-grained design-patterns
  on: http://thefalken.livejournal.com
  
  
  
  This email is sent for and on behalf of Halliwells LLP.
  
  Halliwells LLP is a limited liability partnership registered in 
  England and Wales under registered number OC307980 whose registered 
 
  office address is at Halliwells LLP, 3 Hardman Square, 
 Spinningfields, 
  Manchester, M3 3EB.  A list of members is available for inspection 
 at 
  the registered office. Any reference to a partner in relation to 
  Halliwells LLP means a member of Halliwells LLP.  Regulated by The 
  Solicitors Regulation Authority.
  
  CONFIDENTIALITY
  
  This email is intended only for the use of the addressee named above 
 
  and may be confidential or legally privileged.  If you are not the 
  addressee you must not read it and must not use any information 
  contained in nor copy it nor inform any person other than Halliwells 
 
  LLP or the addressee of its existence or contents.  If you have 
  received this email in error please delete it and notify Halliwells 
 
  LLP IT Department on 0870 365 2500.
  
  For more information about Halliwells LLP visit www.halliwells.com.


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299631
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Using __type__ to return objects to Flex

2008-02-21 Thread Gareth Arch
Yeah, I finally finding that out (after many trials), I was wondering if 
BlazeDS + CFMX7 would work using the __type__ method?  I didn't know if that 
would translate the structs to objects before passing it off to ActionScript.

I don't think it will be possible in cfmx7 (I might be wrong) but I 
think that __type__ solution was introduced with CF8 for supporting 
faster object creation for LCDS 2.5.1 data management destinations.

-- 

João Fernandes

http://www.onflexwithcf.org
http://www.riapt.org

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299652
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Using __type__ to return objects to Flex

2008-02-20 Thread Gareth Arch
Thanks for taking the time to answer all of my questions...

OK,
I had been originally trying to do this in my main application, but seeing as 
that wasn't working, I set up a test environment.

I've created (all in my src folder of my Test Flex project)
Test.mxml
TestClass.as
TestClass.cfc
TestClassGateway.cfc

In my gateway file I generate a struct VO.  The function I use is:

cffunction name=buildStruct output=false access=remote
cfset var i = 0
cfset var obj = structNew() /
cfset var ret = arrayNew( 1 )
cfscript
while (i lt 100) {
obj['__type__'] = 'TestClass';
obj['firstName'] = ;
obj['lastName'] = ;
obj['address1'] = ;
obj['address2'] = ;
obj['city'] = ;
obj['state'] = ;
obj['zip'] = ;
obj['country'] = ;
obj['email'] = ;
obj['phone'] = ;
obj['fax'] = ;
arrayAppend( ret, duplicate( obj ) );
i = i+1;
}
/cfscript
cfreturn ret /
/cffunction

I use a getAll function to return this newly created VO to my calling AS object

cffunction name=getAll output=false access=remote
cfreturn buildStruct() /
/cffunction

My TestClass.cfc has:
cfcomponent output=false alias=TestClass
cfproperty name=firstName type=string default= /
cfproperty name=lastName type=string default= /
cfproperty name=address1 type=string default= /
cfproperty name=address2 type=string default= /
cfproperty name=city type=string default= /
cfproperty name=state type=string default= /
cfproperty name=zip type=string default= /
cfproperty name=country type=string default= /
cfproperty name=email type=string default= /
cfproperty name=phone type=string default= /
cfproperty name=fax type=string default= /

cfscript
this.firstName = ;
this.lastName = ;
this.address1 = ;
this.address2 = ;
this.city = ;
this.state = ;
this.zip = ;
this.country = ;
this.email = ;
this.phone = ;
this.fax = ;
/cfscript
/cfcomponent

My TestClass.as has

[RemoteClass(alias=TestClass)]
public class TestClass extends EventDispatcher {

(along with getters/setters and my constructor and function call to the 
TestClassGateway).

When the data is returned back to AS from CF, it is still just an array of 
generic objects.  If I create CF objects and return them, they come back as an 
array of TestClass objects.  I also noticed that in the list of properties of 
the generic objects, __type__ is one of them.  If it's being converted, this 
shouldn't be there, should it?

Sorry I guess I wasn't clear, you absolutely can return arrays of typed
structs and have them converted for you. That's the main point of doing
this. You can return thousands of objects in arrays, and it is ridiculously
faster then creating cfcs, you do not need LCDS to do this.

I mentioned the array because in Flex if you don't have an instance of the
AddressBook object compiled into the app, it will come in as a generic
object. But if it works when you return arrays of vos that were created with
CreateObject, then that's not the problem.

Is the AddressBook.cfc in your webroot or is it under some path?

This :

[RemoteClass(alias=AddressBook)]

will only work (with this method) if AddressBook is in your webroot, if you
use CreateObject it will work without the fully qualified path, but if you
want to use this typed struct method you have to use the full path.

So if your AddressBook is actually in com.vo.AddressBook then you have to
use

struct['__type__'] = 'com.vo.AddressBook'

and

[RemoteClass(alias=com.vo.AddressBook)]

Sorry if I am making it sound more complicated then it is, but it basically
boils down to making sure your __type__ is fully qualified and matches your
alias.


On Feb 19, 2008 5:15 PM, Gareth Arch [EMAIL PROTECTED] wrote:

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299402
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Using __type__ to return objects to Flex

2008-02-20 Thread Gareth Arch
Here's the remote object info:

import mx.rpc.events.ResultEvent;
import mx.rpc.remoting.mxml.Operation;
import mx.rpc.remoting.mxml.RemoteObject;

private var _ro:RemoteObject;
private var _op:Operation;

public function TestClass() {
_ro=new RemoteObject;
_ro.source=TestClassGateway;
_ro.destination=ColdFusion;
_ro.showBusyCursor=true;

_op=Operation(_ro.getOperation(getAll));
_op.addEventListener(ResultEvent.RESULT, receiveAll);
}

public function getAll():void {
_ro.getAll();
}

public function receiveAll( event:ResultEvent ):void {
this.dispatchEvent( new Event( TestClass.ALL_RECEIVED ) ); 
}

I put a breakpoint at the dispatchEvent point so I could see what was contained 
in the resultEvent.

Could you post what I'm supposed to change in my services-config.xml file to 
get that working?  This is what I have for logging in there currently

logging
target class=flex.messaging.log.ConsoleTarget level=Error
properties
prefix[Flex] /prefix
includeDatefalse/includeDate
includeTimefalse/includeTime
includeLevelfalse/includeLevel
includeCategoryfalse/includeCategory
/properties
filters
patternEndpoint.*/pattern
patternService.*/pattern
patternConfiguration/pattern
patternMessage.*/pattern
/filters
/target
/logging

I also wanted to point out that I'm on CFMX7 (not 8).  In the mailing list I 
originally saw this on, Sean Corfield mentioned that this was available in MX7 
so I've been trying to get it to work (I just wanted to put that out there in 
case that's what is messing things up).


 On Wednesday 20 Feb 2008, Gareth Arch wrote:
  When the data is returned back to AS from CF, it is still just an 
 array of
  generic objects.  If I create CF objects and return them, they come 
 back as
 
 Can you post your AS code (RemoteObject call and result handler) ?
 Also, set the log level to 'debug' at the bottom of services-config.
 xml, and 
 let us know the output in the CF log file.
 
 -- 
 Tom Chiverton
 Helping to evangelistically consolidate fine-grained experiences
 on: http://thefalken.livejournal.com
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in 
 England and Wales under registered number OC307980 whose registered 
 office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, 
 Manchester, M3 3EB.  A list of members is available for inspection at 
 the registered office. Any reference to a partner in relation to 
 Halliwells LLP means a member of Halliwells LLP.  Regulated by The 
 Solicitors Regulation Authority.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above 
 and may be confidential or legally privileged.  If you are not the 
 addressee you must not read it and must not use any information 
 contained in nor copy it nor inform any person other than Halliwells 
 LLP or the addressee of its existence or contents.  If you have 
 received this email in error please delete it and notify Halliwells 
 LLP IT Department on 0870 365 2500.
 
 For more information about Halliwells LLP visit www.halliwells.com.


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299404
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Using __type__ to return objects to Flex

2008-02-20 Thread Gareth Arch
=, 
address1=, zip=, fax=, firstName=, city=, lastName=},
  {phone=, address2=, country=, __type__=TestClass, state=, email=, 
address1=, zip=, fax=, firstName=, city=, lastName=}
]

[Flex] Serializing AMF/HTTP response
Version: 3
  (Message #0 targetURI=/2/onResult, responseURI=)
(Typed Object #0 'flex.messaging.messages.AcknowledgeMessage')
  destination = null
  headers = (Object #1)
  correlationId = BE545A8C-2563-069E-DCA8-37432AB6FBDE
  messageId = 1EEB00D0-CB0D-8B04-2C39-4837CFE66988
  timestamp = 1.203517992187E12
  clientId = 1EEAFE1D-E008-1D8C-1417-19C0822F5EF4
  timeToLive = 0.0
  body = (Array #2)
[0] = (Object #3)
  phone = 
  address2 = 
  country = 
  __type__ = TestClass
  state = 
  email = 
  address1 = 
  zip = 
  fax = 
  firstName = 
  city = 
  lastName = 
[1] = (Object #4)
  phone = 
  address2 = 
  country = 
  __type__ = TestClass
  state = 
  email = 
  address1 = 
  zip = 
  fax = 
  firstName = 
  city = 
  lastName = 
[2] = (Object #5)
  phone = 
  address2 = 
  country = 
  __type__ = TestClass
  state = 
  email = 
  address1 = 
  zip = 
  fax = 
  firstName = 
  city = 
  lastName = 
[3] = (Object #6)
  phone = 
  address2 = 
  country = 
  __type__ = TestClass
  state = 
  email = 
  address1 = 
  zip = 
  fax = 
  firstName = 
  city = 
  lastName = 
[4] = (Object #7)
  phone = 
  address2 = 
  country = 
  __type__ = TestClass
  state = 
  email = 
  address1 = 
  zip = 
  fax = 
  firstName = 
  city = 
  lastName = 

 On Wednesday 20 Feb 2008, Gareth Arch wrote:
  target class=flex.messaging.log.ConsoleTarget 
 level=Error
 

 target class=flex.messaging.log.ConsoleTarget level=Debug
 
 I've not tried it on 7 myself, but if Sean says it works it probably 
 does :-)
 
 -- 
 Tom Chiverton
 Helping to globally customize vertical interfaces
 on: http://thefalken.livejournal.com
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in 
 England and Wales under registered number OC307980 whose registered 
 office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, 
 Manchester, M3 3EB.  A list of members is available for inspection at 
 the registered office. Any reference to a partner in relation to 
 Halliwells LLP means a member of Halliwells LLP.  Regulated by The 
 Solicitors Regulation Authority.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above 
 and may be confidential or legally privileged.  If you are not the 
 addressee you must not read it and must not use any information 
 contained in nor copy it nor inform any person other than Halliwells 
 LLP or the addressee of its existence or contents.  If you have 
 received this email in error please delete it and notify Halliwells 
 LLP IT Department on 0870 365 2500.
 
 For more information about Halliwells LLP visit www.halliwells.com.


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299406
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Using __type__ to return objects to Flex

2008-02-20 Thread Gareth Arch
I hadn't, but I shall now.  If I find anything out, I'll post back here.  
Thanks for all the help.

 On Wednesday 20 Feb 2008, Gareth Arch wrote:
   body = (Array #2)
  [0] = (Object #3)
 
 I would have expected 'typed object' here, if it were working... have 
 you 
 tried dropping Sean/the Transfer list an email ?
 
 -- 
 Tom Chiverton
 Helping to administratively reinvent industry-wide models
 on: http://thefalken.livejournal.com
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in 
 England and Wales under registered number OC307980 whose registered 
 office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, 
 Manchester, M3 3EB.  A list of members is available for inspection at 
 the registered office. Any reference to a partner in relation to 
 Halliwells LLP means a member of Halliwells LLP.  Regulated by The 
 Solicitors Regulation Authority.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above 
 and may be confidential or legally privileged.  If you are not the 
 addressee you must not read it and must not use any information 
 contained in nor copy it nor inform any person other than Halliwells 
 LLP or the addressee of its existence or contents.  If you have 
 received this email in error please delete it and notify Halliwells 
 LLP IT Department on 0870 365 2500.
 
 For more information about Halliwells LLP visit www.halliwells.com.


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299409
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Using __type__ to return objects to Flex

2008-02-20 Thread Gareth Arch
I swear, I'm not starting to believe it myself :)

I actually did have a Test.mxml page that was instantiating the TestClass, but 
I didn't add that bit.  Sorry about that.

OK.

I pasted the code you sent (exactly as sent into separate files) and I still 
get the generic objects returned.  My code is outputting to
C:\Inetpub\wwwroot\OptimizationDemo

Do I need to do something else to aliases if I it is setup like this?  I have 
my https://localhost pointing to C:\Inetpub\wwwroot\OptimizationDemo though, so 
my test page would be https://localhost/Test.html  My CFCs are also right in 
this folder.

As long as you keep giving me hope that this really does work, I'll keep making 
changes to try to get this working :)

 On Wednesday 20 Feb 2008, Jon Messer wrote:
  As soon as you compile TestClass into the app it works for
  both cases with the code you posted...
 
 *Ahh*, I bet that's it.
 We'd normally have some component somewhere with a variable of the 
 RemoteClass 
 type, so this doesn't occur - it's basically because the demo code is 
 *too* 
 simple :-)
 
 All Gareth needs to do is add
   import TestClass;
   private var dummy:TestClass=new TestClass();
 to his SWF app. somewhere. Anywhere :-)
 
 -- 
 Tom Chiverton
 Helping to heterogeneously morph edge-of-your-seat convergence
 on: http://thefalken.livejournal.com
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in 
 England and Wales under registered number OC307980 whose registered 
 office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, 
 Manchester, M3 3EB.  A list of members is available for inspection at 
 the registered office. Any reference to a partner in relation to 
 Halliwells LLP means a member of Halliwells LLP.  Regulated by The 
 Solicitors Regulation Authority.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above 
 and may be confidential or legally privileged.  If you are not the 
 addressee you must not read it and must not use any information 
 contained in nor copy it nor inform any person other than Halliwells 
 LLP or the addressee of its existence or contents.  If you have 
 received this email in error please delete it and notify Halliwells 
 LLP IT Department on 0870 365 2500.
 
 For more information about Halliwells LLP visit www.halliwells.com.


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299428
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Using __type__ to return objects to Flex

2008-02-20 Thread Gareth Arch
Thanks for trying.  I'll keep plugging away.  If I find anything, I'll be sure 
to post back (perhaps it will help someone else)

I don't know what to say.

That exact code (and only that code) works for me on a Mac CF8, on Linux CF8
and Windows CF7. The only difference I see is that I didn't run it over SSL
and it looks like you are, but I use this method in production with SSL.

I'm at a total loss...  :-(

On Feb 20, 2008 8:43 AM, Gareth Arch [EMAIL PROTECTED] wrote:

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299456
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Using __type__ to return objects to Flex

2008-02-20 Thread Gareth Arch
OK, one last try.  Here's my services-config.xml file.  Could you compare it to 
yours and see if there's anything that doesn't add up.

?xml version=1.0 encoding=UTF-8?
services-config

services
service id=coldfusion-flashremoting-service
 class=flex.messaging.services.RemotingService
 messageTypes=flex.messaging.messages.RemotingMessage

adapters
adapter-definition id=cf-object 
class=coldfusion.flash.messaging.ColdFusionAdapter default=true/
/adapters

destination id=ColdFusion
channels
channel ref=my-securecfamf/
/channels
properties
source*/source
!-- define the resolution rules and access level of the 
cfc being invoked --
access
!-- Use the ColdFusion mappings to find CFCs, by 
default only CFC files under your webroot can be found. --
use-mappingstrue/use-mappings
!-- allow public and remote or just remote methods 
to be invoked --
method-access-levelremote/method-access-level
/access

property-case
!-- cfc property names --
force-cfc-lowercasefalse/force-cfc-lowercase
!-- Query column names --
force-query-lowercasefalse/force-query-lowercase
!-- struct keys --
force-struct-lowercasefalse/force-struct-lowercase
/property-case

/properties
/destination

/service
/services

channels
channel-definition id=my-cfamf 
class=mx.messaging.channels.AMFChannel
endpoint 
uri=http://{server.name}:{server.port}{context.root}/flex2gateway/; 
class=flex.messaging.endpoints.AMFEndpoint/
properties
polling-enabledfalse/polling-enabled
serialization
instantiate-typesfalse/instantiate-types
/serialization

/properties
/channel-definition
channel-definition id=my-securecfamf 
class=mx.messaging.channels.SecureAMFChannel
endpoint 
uri=https://{server.name}:{server.port}{context.root}/flex2gateway/; 

class=flex.messaging.endpoints.SecureAMFEndpoint/
properties
polling-enabledfalse/polling-enabled
serialization
instantiate-typesfalse/instantiate-types
/serialization
add-no-cache-headersfalse/add-no-cache-headers
/properties
/channel-definition

/channels

logging
target class=flex.messaging.log.ConsoleTarget level=Debug
properties
prefix[Flex] /prefix
includeDatefalse/includeDate
includeTimefalse/includeTime
includeLevelfalse/includeLevel
includeCategoryfalse/includeCategory
/properties
filters
patternEndpoint.*/pattern
patternService.*/pattern
patternConfiguration/pattern
patternMessage.*/pattern
/filters
/target
/logging

system
/system

/services-config


 Thanks for trying.  I'll keep plugging away.  If I find anything, I'll 
 be sure to post back (perhaps it will help someone else)
 
 I don't know what to say.
 
 That exact code (and only that code) works for me on a Mac CF8, on 
 Linux CF8
 and Windows CF7. The only difference I see is that I didn't run it 
 over SSL
 and it looks like you are, but I use this method in production with 
 SSL.
 
 I'm at a total loss...  :-(
 
 On Feb 20, 2008 8:43 AM, Gareth Arch [EMAIL PROTECTED] wrote:
 
  


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299489
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Using __type__ to return objects to Flex

2008-02-20 Thread Gareth Arch
And one other thing to mention (that hopefully wouldn't have made a big 
difference).  Our environment is running through JRun server.  I don't think 
that would make any difference, but it's something else to note.

 OK, one last try.  Here's my services-config.xml file.  Could you 
 compare it to yours and see if there's anything that doesn't add up.
 
 ?xml version=1.0 encoding=UTF-8?
 services-config
 

 services

 service id=coldfusion-flashremoting-service
 
 class=flex.messaging.services.RemotingService
 
 messageTypes=flex.messaging.messages.RemotingMessage
 

 adapters

 adapter-definition id=cf-object class=coldfusion.flash.messaging.
 ColdFusionAdapter default=true/

 /adapters
 
   destination id=ColdFusion

 channels

 channel ref=my-securecfamf/

 /channels

 properties

 source*/source

 !-- define the resolution rules and access level of the cfc being 
 invoked --

 access

 !-- Use the ColdFusion mappings to find CFCs, by default only CFC 
 files under your webroot can be found. --

 use-mappingstrue/use-mappings

 !-- allow public and remote or just remote methods to be invoked 
 --

 method-access-levelremote/method-access-level

 /access
 

 property-case

 !-- cfc property names --

 force-cfc-lowercasefalse/force-cfc-lowercase

 !-- Query column names --

 force-query-lowercasefalse/force-query-lowercase

 !-- struct keys --

 force-struct-lowercasefalse/force-struct-lowercase

 /property-case
   

 /properties

 /destination
 

 /service

 /services
 

 channels

 channel-definition id=my-cfamf class=mx.messaging.channels.
 AMFChannel

 endpoint uri=http://{server.name}:{server.port}{context.
 root}/flex2gateway/ class=flex.messaging.endpoints.AMFEndpoint/

 properties

 polling-enabledfalse/polling-enabled

 serialization

 instantiate-typesfalse/instantiate-types

 /serialization
   

 /properties

 /channel-definition

 channel-definition id=my-securecfamf class=mx.messaging.channels.
 SecureAMFChannel

 endpoint uri=https://{server.name}:{server.port}{context.
 root}/flex2gateway/ 
 
 class=flex.messaging.endpoints.SecureAMFEndpoint/

 properties

 polling-enabledfalse/polling-enabled

 serialization

 instantiate-typesfalse/instantiate-types

 /serialization
   add-no-cache-headersfalse/add-no-cache-headers

 /properties

 /channel-definition
 

 /channels
 

 logging

 target class=flex.messaging.log.ConsoleTarget level=Debug

 properties

 prefix[Flex] /prefix

 includeDatefalse/includeDate

 includeTimefalse/includeTime

 includeLevelfalse/includeLevel

 includeCategoryfalse/includeCategory

 /properties

 filters

 patternEndpoint.*/pattern

 patternService.*/pattern

 patternConfiguration/pattern

 patternMessage.*/pattern

 /filters

 /target

 /logging
 

 system

 /system
 
 /services-config
 
 
  Thanks for trying.  I'll keep plugging away.  If I find anything, 
 I'll 
  be sure to post back (perhaps it will help someone else)
  
  I don't know what to say.
  
  That exact code (and only that code) works for me on a Mac CF8, on 
 
  Linux CF8
  and Windows CF7. The only difference I see is that I didn't run it 
 
  over SSL
  and it looks like you are, but I use this method in production with 
 
  SSL.
  
  I'm at a total loss...  :-(
  
  On Feb 20, 2008 8:43 AM, Gareth Arch [EMAIL PROTECTED] wrote:
  
   


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299509
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Using __type__ to return objects to Flex

2008-02-19 Thread Gareth Arch
I am giving this a try on my current app.  However, when the data is returned 
to Flex, it is not of the type that I specified.  All fields are camelCased 
correctly (I added the properties argument to get around the uppercasing 
issue), the type is set correctly, and all data is returned, but it is not of 
type AddressBook.  If I do cfreturn createObject( component, AddressBook 
).init( arguments.id ) / the data is returned as AddressBook.  Any ideas?  
(Code is below).

cffunction name=getAllProperties output=false access=remote
cfargument name=queryData type=query required=true /
cfargument name=properties type=string required=false 
default=addressBookId,ownerId,connectionSourceId,addressTypeId,address1,address2,city,state,zip,countryId,longitude,latitude,radianLat,radianLong,lastUpdate,lastUpdateBy,lastUpdateByConnectionSourceId
 /

cfset var INST = structNew() /
cfset INST.obj = structNew() /
cfset INST.ret = arrayNew( 1 ) /

!---  default object to addressbook ---
cfset INST.obj['__type__'] = AddressBook /
!--- loop over query ---
cfloop query=arguments.queryData
!--- loop over columns and assign to temporary object ---
cfloop list=#arguments.properties# index=INST.property
cfset INST.obj[INST.property] = 
arguments.queryData[INST.property][currentRow] /
/cfloop
cfscript
ArrayAppend( INST.ret, duplicate( INST.obj ) );
/cfscript
/cfloop

cfreturn INST.ret /
/cffunction 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299343
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Using __type__ to return objects to Flex

2008-02-19 Thread Gareth Arch
Argh!  For some reason I skipped completely over that part.  Other than having 
to use createobject, do you know of anything that will just return the 
properties rather than the whole shebang (in CFMX7)?  I've returned the data as 
a query before, but that then requires manipulation on the ActionScript side of 
things, so if there was a way to tell it this is an AddressBook from CF, that 
would be extremely useful (without going through LiveCycle).  Thanks for the 
help.

How are you calling it from Flex?  __type__ only works with FDS, I
believe, not with remote objects.

cheers,
barneyb

On Feb 19, 2008 10:54 AM, Gareth Arch [EMAIL PROTECTED] wrote:
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299349
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Using __type__ to return objects to Flex

2008-02-19 Thread Gareth Arch
Hmmm...not too sure what you mean by this.

I had the code setup in a DAO gateway, so the cfcomponent alias=AddressBook 
was in an AddressBook.cfc (the code I posted was a cffunction in 
AddressBookGateway.cfc).  In my AS class, I have 
[RemoteClass(alias=AddressBook)] to handle the class that is returned from CF 
(and convert it to the correct AddressBook class).  In the code, I'm trying to 
return an array of AddressBook objects (thus the array that I'm returning).  If 
I do a createobject for CF AddressBook objects and put it in an array, it 
correctly returns an array of AddressBook objects back to AS; however, if I use 
the __type__ and a struct of the other variables (even with correct 
camelCasing), it returns an array of generic objects.  If I try a returntype of 
AddressBook[] from CF, it states that it is not a valid AddressBook (which 
makes sense as it hasn't been converted yet).  If I can only return one item 
back to AS from CF using this method, I'll probably just stick with the method 
I was using before (as creating one object vs. one struct isn't going to make a 
big difference), but if it can send multiple items back as VOs, then that's 
what I'm looking for.  There's something I'm missing between the gateway and 
the AS.  If, as Barney states, it is the LiveCycle intermediary, then I'm fresh 
out as my company won't pony up for that, but if there's something else that 
I'm missing that can do the conversion via AMF, then I'm all ears :)

Thanks.
Gareth

sorry pressed send too soon. To finish that sentence :

The only thing I see that is odd about your posted code is that you are
returning an array, so on the flex side you need to make sure that you are
compiling an instance of your VO into the application or you will get a
generic object...

On Feb 19, 2008 1:13 PM, J

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299378
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: SQL help - inserting a dynamic variable

2005-04-11 Thread Gareth Arch
You've more or less posted the answer.  The method to use would be:

INSERT INTO  tblContactAddress(contactID,addressTypeID,address1, etc.)
SELECT #contactIDValue#, ID, '#address1Value#',etc.
FROM tblAddressType
WHERE typename = 'General'

Just make sure typename = 'General' will only return one value or it will 
insert those values each time it finds 'General' in tblAddressType (i.e. if you 
have 3 typename = 'General' it will insert 3 records)

I'm making life harder on myself than I need to.  Salient facts:
CFMX7, SQL Server 2000

I'm trying to insert an address.  The contact address table has the
usual fields, i.e. id, contactID, address1, address2, city, state,
zip, etc., but it also has an addressTypeID that is a lookup column
that references values in an addressType table that has typeid,
typename

What I _WANT_ to be able to do is something like this:

INSERT INTO  tblContactAddress(contactID,addressTypeID,address1, etc.)
VALUES  (#contactIDValue#, (SELECT ID FROM tblAddressType WHERE
typename = 'General'), '#address1Value#',etc.)

Of course, I would be using cfqueryparam for all variables.

SQL Server doesn't like this.  Is there a way to accomplish what I'm after?

Thanks!

Pete

~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:202200
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: SQL help - inserting a dynamic variable

2005-04-11 Thread Gareth Arch
You should be able to join as many tables as you like (just as in a regular 
query).  Just select the column names you need

insert into tblthis
(columnone, columntwo, columnthree)
select c.dataone, d.datatwo, e.datathree
from mycolumns c
inner join mycolumnstwo d on (c.my_id = d.my_id)
inner join mycolumnsthree e on (c.my_id = e.my_id)
where c.typename = 'General'

Oh, so IOW I can only do that for one join table, not more than one? 
I have a couple of lookup columns that I'll be inserting...

Pete



~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:202213
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54