Coldfusion 8 xml decode1/25/2024 And, oh boy, there's a lot going on here! I don't fully understand what their code is doing but, between their code and the neo-datasource.xml file, I was finally able to get something comprehensive working!Īfter 3 mornings of trial-and-error and poking through various configuration files, here's what the datasource configuration in my Application.cfc now looks like:ĬAUTION: While I was able to confirm that some of these configuration settings work as advertised, I wasn't sure how to go about testing the pooling configuration. I hopped over to cfconfig/models/BaseAdobe.cfc source code to look at their writeDatasource() method. Which means, they are possibly reading-from or writing-to this XML file. cfconfig.json file to configure my local CFML Docker container. Half way through this process, it occurred to me that the CommandBox CFConfig module was probably messing with all of this stuff as well. From there, I embarked on a process of trial and error, plugging those values into my this.datasources code and seeing what would happen. This gave an XML document with a bunch of elements that outlined all of the datasource configuration options. # Output the entire contents of the XML file. # Move to the configure files directory within the ColdFusion install.Ĭd /usr/local/lib/serverHome/WEB-INF/cfusion/lib/ # Enter the running Docker container for ColdFusion 2021. This may not align with your particular server setup. ![]() NOTE: I am using CommandBox Docker Image from Ortus Solutions and, this is where they have configured the ColdFusion server root. So, I bashed into my local Docker CFML container and output the contents of this XML file: Based on the documentation for, Purpose and location of XML configuration files used in ColdFusion, I learned that the datasource information was saved in an XML file, neo-datasource.xml. I thought maybe the best idea would be to look at how the datasource was configured on disk - ie, how ColdFusion stores the configuration across server restarts. And, the examples that it did have only included a fraction of the possible configuration values outlined in the aforementioned "Data Source Management for ColdFusion" article. But, it was still severely lacking! It didn't even have a MySQL example. This page started to give me some information about how the this.datasources property could be defined. This told me what kind of information I could provide in my MySQL connection but, it didn't offer me any insight into how that information actually gets provided in the code.įrom there, I went to the documentation on ColdFusion Application.cfc variables. First, I went to the documentation on Data Source Management for ColdFusion. Ultimately, I had to piece together the MySQL per-application datasource code by picking through several other sources. That, or my Google-skills just weren't up to the task. Mostly because the documentation on this ColdFusion feature is severely lacking. All in all, making this change took me 3-mornings. Moving from a ColdFusion Administrator-based datasource configuration over to a per-application datasource configuration was easier said than done. SECURITY NOTE: When I say that this workflow should be in source-control, I do not mean that any credentials should be in the source-control! Never store credentials in the source-control! As such, I've decided to move my blog to a per-Application datasource. In a modern application context, this is highly disturbing! My application's datasource configuration workflow should be in source-control. And, more than that, there was no record of these changes being made which meant that undoing said changes would be quite challenging. And it occurred to me that manually updating the MySQL datasource in the ColdFusion Administrator represented a huge point of human failure. * given you're using namespaces, you need to use them *everywhere* in your xpath string.Over the weekend, after my ColdFusion blog was accidentally upgraded from MySQL 5.0.10 to 8.0.28, I had to scurry and update the datasource configuration in both my production environment as well as in my local Docker development environment. Or the way CF builds its XML objects from the XML source doc, or something. I'm pretty ignorant when it comes to XML namespaces, but judging by the behaviour of all the other bits, it looks like a bug in xmlSearch() to me. Now: as far as I can tell, it's completely fine to have it the way you've done it as ar as the XML side of things is concerned: and even CF parses it fine, as you know, but xmlSearch() didn't like it. * CF didn't seem to know how to deal with the namespaces for the xmlSearch() unless they were in the node, not the node. ![]() * xpath is case-sensitive, so you need to reference "DataSet" not "Dataset" in your xmlSearch() statement OK, I had to do three things to get this to work.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |