RE: Referencing a .CFC in a sub directory.
So...is it that I am asking a really stupid question, or does no one know a) whether it's even possible to reference .cfcs using either CFINVOKE or CFOBJECT with a directory structure like this b) If so how to do it? Oreilly programming CFMX says this: This is known as package notation. In the Java world, it's typical to create packages for storing your class files. For example, for the example.com company we've been using throughout the book, you might create a package off the web root called com.example (webroot\com\example). In the \example subdirectory, you would categorize your CFCs according to functionality. For example, you might have a subdirectory called \utils for utility CFCs, \news for news-related CFCs, etc. To refer to CFCs in a package, you use dot notation in the component attribute, such as com.example.utils.employee to refer to the employee CFC. So I have a simple /components directory off the webroot. So components.helpdesk_users should do the trick. But it doesn't work. cfinvoke COMPONENT=components.helpdesk_users METHOD=GetUser RETURNVARIABLE=GetUserRet cfinvokeargument NAME=userid VALUE=#userid#/ /cfinvoke Produces the error: Could not find the ColdFusion Component components.helpdesk_users. Please check that the given name is correct and that the component exists. Can anyone tell me where I'm going wrong or if this is even possible? -Gel -Original Message- From: Angel Stewart [mailto:[EMAIL PROTECTED] Just some additional info, I have gotten the CFCs to work perfectly via the FORM Action attribute using the html pathname of the CFC. Action="" Method=POST Works fine. Can't get the CFINVOKE to work. -Gel --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.544 / Virus Database: 338 - Release Date: 11/25/2003 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Referencing a .CFC in a sub directory.
For that to work (i.e. using dot notation for CFOBJECT) you must setup a CF mapping. Action="" Method=POST will work as its IIS/Apache/Whatever handling the path to the CFC. CFINVOKE/CFOBJECT/CreateObject use CF to get the path to the CFC so either the CFC must be in the same directory as the code invoking the CFC or a CF Mapping must be setup HTH -Original Message- From: Angel Stewart [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 9, 2003 13:28 To: CF-Talk Subject: RE: Referencing a .CFC in a sub directory. So...is it that I am asking a really stupid question, or does no one know a) whether it's even possible to reference .cfcs using either CFINVOKE or CFOBJECT with a directory structure like this b) If so how to do it? Oreilly programming CFMX says this: This is known as package notation. In the Java world, it's typical to create packages for storing your class files. For example, for the example.com company we've been using throughout the book, you might create a package off the web root called com.example (webroot\com\example). In the \example subdirectory, you would categorize your CFCs according to functionality. For example, you might have a subdirectory called \utils for utility CFCs, \news for news-related CFCs, etc. To refer to CFCs in a package, you use dot notation in the component attribute, such as com.example.utils.employee to refer to the employee CFC. So I have a simple /components directory off the webroot. So components.helpdesk_users should do the trick. But it doesn't work. cfinvoke COMPONENT=components.helpdesk_users METHOD=GetUser RETURNVARIABLE=GetUserRet cfinvokeargument NAME=userid VALUE=#userid#/ /cfinvoke Produces the error: Could not find the ColdFusion Component components.helpdesk_users. Please check that the given name is correct and that the component exists. Can anyone tell me where I'm going wrong or if this is even possible? -Gel -Original Message- From: Angel Stewart [mailto:[EMAIL PROTECTED] Just some additional info, I have gotten the CFCs to work perfectly via the FORM Action attribute using the html pathname of the CFC. Action="" Method=POST Works fine. Can't get the CFINVOKE to work. -Gel --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.544 / Virus Database: 338 - Release Date: 11/25/2003 _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Referencing a .CFC in a sub directory.
Just some additional info, I have gotten the CFCs to work perfectly via the FORM Action attribute using the html pathname of the CFC. Action="" Method=POST Works fine. Can't get the CFINVOKE to work. -Gel -Original Message- From: Angel Stewart [mailto:[EMAIL PROTECTED] Hello all, I have a directory structure off a particular webroot on a multihomed server: /admin /public /components. I placed my .cfcs in the /components directory. I am trying to call the CFCs using cfinvoke and also directly using the form action="" attributes. I do not want to have to put the components directory beneath the /admin or /public folder. I want to store all my components in just one directory. How would I reference cfcs from files in the /admin or /public folders? I have tried . notation to no effect. Referencing these cfcs workes perfectly when they are placed in the relevant subdirectory..either /admin or /public. What am I doing wrong? -Gel --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.544 / Virus Database: 338 - Release Date: 11/25/2003 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]