Solved

cfinvoke path

Posted on 2004-04-26
7
783 Views
Last Modified: 2013-12-24
do i need to use a different path than below if the cfm and cfc are not in the same folder?

<cfif isDefined("url.addProdID")>
<cfinvoke component="cartservice" method="newCart" >
</cfinvoke>
</cfif>


should i do this if the cfc is in a folder


<cfif isDefined("url.addProdID")>
<cfinvoke component="api/cartservice" method="newCart" >
</cfinvoke>
</cfif>
0
Comment
Question by:finnstone
  • 3
  • 3
7 Comments
 
LVL 17

Assisted Solution

by:Tacobell777
Tacobell777 earned 200 total points
Comment Utility
you can use the dot notation and you can use mappings, example:

/mapping/directory/cartservice
mapping.directory.cartservice
0
 

Author Comment

by:finnstone
Comment Utility
what is mapping in your example.

what shuld i do if my cfm is in wwroot/show

and my cfc is in wwroot/show/api
0
 
LVL 18

Accepted Solution

by:
Plucka earned 300 total points
Comment Utility
Hi finnstone,

You need to setup a mapping in CF administrator.

This mapping points to a directory containing your componenets, then you reference them with . (dot) notation.

MappingName.DirectoryName.Component Name

So if you have this structure.

C:\Com\test
C:\Com\live

and you have components in both test and live. You would setup a mapping say called com to C:\Com\

And then call the component using com.test.ComponentName

Regards
Plucka
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 18

Expert Comment

by:Plucka
Comment Utility
finnstone,

> what shuld i do if my cfm is in wwroot/show
> and my cfc is in wwroot/show/api

I'd setup a mapping in cf administrator called api pointing to wwroot/show/api.

Then in code

<cfinvoke component="api.cartservice" method="newCart" >

Regards
Plucka
0
 

Author Comment

by:finnstone
Comment Utility
oh..if i dont want to use a mapping, can i just use a absolute URL
0
 
LVL 18

Expert Comment

by:Plucka
Comment Utility
No, you must use a mapping unless it's in the current directory.
0
 

Author Comment

by:finnstone
Comment Utility
ok thx
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now