nested Application.cfc question

2006-11-07 Thread Barthle, Robert \(Contractor\)
I am having a problem with nesting Application CFCs.
 
I have an Application.cfc in the root directory with a call to onRequestStart, 
and in there I have a variety of variables set in the request scope. 
 
I have another Application.cfc in a sub directory that I built primarily to 
handle user authentication (the only files needing to be protected reside 
there, so I was going to set the authentication checks in that Application.cfc 
so it's only referenced when needed). 
 
I set it up so that this second Application.cfc extends the root 
Application.cfc by using the dot-notation mapping to the root Application - 
like extends=SharedSites.Site1.Application. In this file's onRequestStart 
function, I try and access the request scope variables set in the parent 
Application.cfc. I am getting errors saying these variables have not been set.
 
This is a legacy application that I am converting over to Application.cfc, so I 
cannot unscope those variables, I have to use them in the request scope.
 
Any guidelines or ideas?
 



thanks 
-r 
_ 
Rob Barthle 
Contractor - Sr. Software Developer 
[EMAIL PROTECTED] 
202-245-6484 

 


~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

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


RE: nested Application.cfc question

2006-11-07 Thread Ian Skinner
I set it up so that this second Application.cfc extends the root 
Application.cfc by using the dot-notation mapping to the root Application - 
like extends=SharedSites.Site1.Application. In this file's onRequestStart 
function, I try and access the request scope variables set in the parent 
Application.cfc. I am getting errors saying these variables have not been set.


That's not the way extension/inheritance works.  When you created the new 
onRequestStart function in the child Application.cfc it replaced the one in the 
parent Application.cfc.  To run the parents application.cfc you need to use 
CF's version of the super scope inside of the child.  I think this would be 
super.onReqestStart() in side the child's onRequestStart, but I am not sure.




--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Soduko
|   |   |
-
 
C code. C code run. Run code run. Please!
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

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


RE: nested Application.cfc question

2006-11-07 Thread Barthle, Robert \(Contractor\)
I found the super.onRequestStart() function not too long after I sent this. 
That fixed that problem, you were correct about it. Thanks, Ian. :)
 
Now my problem is just making this work correctly! It seems to be ignoring some 
IF statements in the child onRequestStart function, and I'm noodling through 
that one now.
 
Are there public examples of code around with this kind of setup that I could 
look at somewhere? I have to assume this is nowhere near rocket science, but 
I'm fairly new to CFC's.
 
 
 

thanks 
-r 
_ 
Rob Barthle 
Contractor - Sr. Software Developer 
[EMAIL PROTECTED] 
202-245-6484 
 
 
 
-Original Message-
From: CF-Talk [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 07, 2006 5:00 PM
To: CF-Talk
Subject: ColdFusion Talk (CF-Talk): Digest every hour
 


~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

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