Ah... you were trying to use a relative path (../folder/cfcs/etc). No-can-do. You have to provide an _absolute_ path to a component via <cfinvoke> and createObject() using dot notation.
-----Original Message----- From: Rick Faircloth [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2008 1:59 PM To: CF-Talk Subject: RE: cfc question... Yes, I did get it, finally, Jason. Thanks to you and everyone who has given advice! I've got a lot to think about and consider making the change from .cfm and includes to cfc's, but I'm off to a good start, I think. The first step for me is to get something *simple* to work and then to build my knowledge from there. What was complicating my path problem was the fact that the main website has a component folder and a certain webroot. The folder that is holding the templates for the subdomains is also the webroot folder for those subdomains. I was trying to use the components in the main website's folder, which is above the subdomain folder (webroot folder for subdomains) in the folder hierarchy. That wasn't working. I think what I had to understand is that the "dot" notation and paths for the cfc's is logical, not "physical". I was trying to figure out some way to jump back up two folder levels and down one to get into the main website component folder...wasn't working. I finally just created a component folder in the subdomain root folder and then I could easily access it. Does my "newbie" confusion make any sense? Rick > -----Original Message----- > From: Jason Durham [mailto:[EMAIL PROTECTED] > Sent: Monday, June 16, 2008 10:20 AM > To: CF-Talk > Subject: RE: cfc question... > > Did you get it straightened out Rick? Azadi gave you what you need. > You need to explicitly call the component using a path from the web root > (dot notation). > > From Azadi's email... > <cfinvoke component="dot.delimited.path.to.cfc.from.webroot" > method="your_cfc_method_name_here" ...> > > For your situation... > <cfinvoke component="c21-ar.components.agent" method="get_agent_info" > returnvariable="agent_info" agent_id="url.agent_id" /> > > > > > -----Original Message----- > From: Rick Faircloth [mailto:[EMAIL PROTECTED] > Sent: Sunday, June 15, 2008 11:57 PM > To: CF-Talk > Subject: RE: cfc question... > > I looked over the info and I'm sure I'll end up doing that, > but I still have to execute the code at some point, which leads > me back to the question of how to set up paths for the cfc's. > > Let's say I've got a root folder of > e:\inetpub\webroot\c21ar > and a component folder path of > e:\inetpub\webroot\c21ar\components > > How do I set the path when using the cfinvoke function? > All the examples I've used have the cfc in the same folder as > the calling document, so it hasn't been an issue. > > Now that it is, I can't figure out how to satisfy the cfinvoke > function concerning the path to a cfc other that in the same folder > as the calling document. > > I tried the "source" attribute in the cfinvoke function, but that > just returned an error any way I coded it. > > CF Admin Mappings? IIS Mappings? Virtual Directories? > I know this is probably something simple, but I'm just not getting it. > > Hints, anyone? > > Thanks, > > Rick > > > > > -----Original Message----- > > From: Gerald Guido [mailto:[EMAIL PROTECTED] > > Sent: Monday, June 16, 2008 12:02 AM > > To: CF-Talk > > Subject: Re: cfc question... > > > > >> Anyway, what's lame about putting all the cfc's together in a > directory > > where I can find them easily? > > > > There is nothing lame about it (you gotta stick them somewhere). What > he > > means is that you are going to want to stick them in memory (the > application > > scope) cuz there is a lot of overhead with firing them up > (instantiating or > > creating an instance of them) every time you need to use them. > Basically you > > are caching them. > > > > You can do the same thing with functions too. It is pretty damn slick. > I > > blarged on the matter here: > > > http://www.myinternetisbroken.com/index.cfm/2008/5/24/Caching-Functions- > -Creating-variables-that-are > - > > executable > > > > G$ > > > > > > On Sun, Jun 15, 2008 at 11:49 PM, Rick Faircloth > <[EMAIL PROTECTED]> > > wrote: > > > > > Now, Will... all that's a bit complicated for a newbie to cfc's! > > > Didja haf'ta make it so hard! I just wanted a path! :o) > > > > > > Anyway, what's lame about putting all the cfc's together in a > directory > > > where I can find them easily? > > > > > > > > > > -----Original Message----- > > > > From: Will Tomlinson [mailto:[EMAIL PROTECTED] > > > > Sent: Sunday, June 15, 2008 11:00 PM > > > > To: CF-Talk > > > > Subject: Re: cfc question... > > > > > > > > >Another issue I've run into is how to help my calling page find > > > > >my cfc's. While learning, I've just placed the cfc in the same > > > > >folder as the calling page. But now I'm placing them in a > components > > > > >folder and the calling page can't find it. > > > > > > > > Rick, I mostly initialize them in application scope in > Application.cfc > > > > > > > > Like this: > > > > > > > > <cfset APPLICATION.reportDAO = > > > > CreateObject("component","cfcs.reportDAO").init(dsn=APPLICATION.dsn)> > > > > > > > > Then build a constructor in your cfc like so: > > > > > > > > <cffunction name="init" access="public" returntype="reportDAO" > > > output="false" > > > > hint="Returns an instance of the CFC initialized with the > correct > > > settings."> > > > > <cfargument name="dsn"> > > > > <cfset variables.dsn = arguments.dsn> > > > > <cfreturn this> > > > > </cffunction> > > > > > > > > Once you do all that, it's ready to use anywhere in the > application. > > > > > > > > Just refer to it using the application scope: > > > > > > > > <cfset getReport = APPLICATION.reportDAO.monthEnd()> > > > > > > > > Puttin it in a cfc's directory is lame, but I'm sure more advice > will > > > roll in for ya. :) > > > > > > > > hth, > > > > Will > > > > > > > > > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307564 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4