Cf8 cfmodule could not find included template
That's why GetCurrentTemplatePath is such a powerful function. Kenny, About platform specific paths, I make it a habit to convert any backslashes to forward slashes in the paths I get back from the various path functions, since forward slashes in CF work on Windows. I can then proceed happily without worrying about path separators in my applications.
I try to make that a habbit; but, I believe in the latest versions of ColdFusion, I am pretty sure that that no longer makes a difference.
I think part of the confusion stems from the fact that you cannot use application specific mappings in cfimport tags, so they do not work everywhere you would expect them to. Hmmm, maybe that was my problem. I could have sworn it was a cfc extends issue. Maybe it was a collection of problems :. Would GetBaseTemplatePath instead of getCurrentTemplatePath be 'technically' more accurate - as it's the 'Gets the absolute path of an application's base page. Ok - I'm still not convinced application specific mappings even work and I have verified 10x that I have the 'enable app settings' turned on in cfadmin.
Of course, once I go into the cfadmin and add that mapping in for that instance - then it works fine - I think this is my main cause of concern with this technique. In the application. However, after that, they do seem to take hold - confidence restored sort of. Thanks all for your patience - and feedback - these tips helped me get rid of a few mappings in our application and will ease deployment to multiple servers by not having to define new mappings via cfadmin.
Not only MUST the mappings be defined inside the pseudo construct code inside cfcomponent, outside cffunction , you need to wait until you are in an event handler ex. OnRequest before you can use them. Yup - works flawlessly now! Glad you got it working. Yeah, seems like an odd limitation. I guess it has to do with when the settings get applied. So, just so we're on the same page, what you're saying is that the Extends attribute of the remote-access CFC doesn't work with app-specific mappings?
From what I just found. I had app specific mappings in the application itself, but tried to call a component via flex and got a 'Could not find the ColdFusion Component or Interface' error in the cflogs.
Once I added the mapping to the cfadmin, the flex remote call worked again as I had removed the mapping from cfadmin to prove that the application mappings were the only mappings being taken.
Unfortunately application specific mappings won't work for flash remoting since the call isn't coming from the application, so you'll still need to create the mapping within your cfadmin. Works pretty well, but your application will need to be initialized before the flash remoting will work, which I don't think is too much to ask. When you say flash remoting, you are specially referring to AMF-style remoting, correct?
I think some work and some will not work with the app-specific mappings. Tony - Thanks for confirmation on that - yeah seems a bit inconsistent that it's not at the application level but more at the app server level then. I agree, the best method would be through admin api - which we're doing for enough other things as well. I hope this wasn't too far off the original topic - but VERY good information regardless, and not sure how 'well' documented some of these are.
I worked this out after not being able to set a dynamic mapping for Mach-II's directory, as it is required in the cfcomponent's extend method for Application.
For anyone that is curious on how to do this for Apache: Create an Alias for the folder and then set the folder permissions via a directory node. The following has worked for me:. These are run once variables in the onApplicationStart. Would I be able to use application level mappings this. Just to add another item to this thread - I came accross a reference in code from Adobe that had this:.
It returned the absolute path to the root of my application - which is a struggle to get at from various parts of an app if needed. Looks good. Does it matter where you call that from? Are you calling from within Application. No doesn't seem to matter - however it does return the my 'cfusion. Kevin, that doesn't work if you are using virtual directories in IIS.
So far I haven't been able to get this working. Off topic from the post, but possibly useful to the previous comment, I believe that Sean Corfield was working on a project to handle PHP files within Coldfusion using a java library. Might be work looking at if that's something you need.
I think he was working on a library that would run PHP scripts inline It's easier to build it in an. Have never found much use for it - but it's a pretty slick trick. Light Dark. This means that the custom tag expects the required data to be passed in the attribute Section from the calling template. This value is assigned to the variable Chosen in the tag for easy access Chosen requires less typing and code than attributes Section.
The calling template for the home page would then look something like this assuming the template for the custom tag is saved as menu. This process is encapsulated into the tag itself. Instead it will be treated as plain text and sent as such to the browser and displayed without processing.
In this scenario you will do things a little differently returning a result through a variable in the calling template. Although this approach means an extra line of code is required to output the results in the calling template it highlights the flexibility of a custom tag Multiple values can be passed to it in a standardized way and multiple values can be returned by it in a standardized way. Our example requires only one piece of information to be passed to the tag and only one piece of data to be returned.
Listing 8. Home About Pricing Services Contact. To refer to the custom tag in the ColdFusion installation directory, using dot notation to indicate its location, use the name attribute. On UNIX systems, ColdFusion searches first for a file with a name that matches the name attribute, but is all lower case. If it does not find the file, it looks for a file name that matches the attribute with identical character casing.
You can use the attributeCollection attribute and explicit custom tag attributes in the same call. Within the custom tag code, the attributes passed with attributeCollection are saved as independent attribute values, with no indication that they are grouped into a structure by the custom tag's caller. Similarly, if the custom tag uses a cfassociate tag to save its attributes, the attributes passed with attributeCollection are saved as independent attribute values, with no indication that they are grouped into a structure by the custom tag's caller.
If you specify an end tag to cfmodule, ColdFusion calls your custom tag as if it had both a start and an end tag.
0コメント