Greg's Blog

helping me remember what I figure out

Mach-iied

| Comments

It’s done a few hours ago I switched my old PHP site over to Mach-II/cfml (BlueDragon) driven site. It may not be obvious from looking at the URLs, but that’s because I have plugin parsing the requests (which have been re-written with mod_rewrite and rules in the .htaccess file).
  1. 7 listeners
  2. 2 filters
  3. 14 events
  4. 2 plugins
  5. 11 custom views, 7 shared views
All in all it’s been a very enjoyable experience. Sure there was some head scratching at times (and more on that a little later), but overall I really enjoyed the fact that the framework made me think, sometimes hard, about how I designed and implemented my application. And yes, there were a few moments where things seemed to be the long way round, but when it came to extending and modifying the logic part of the code, the use of getters and setters really paid off. And now for a little aside. The whole lot was coded using Eclipse, initially using He3 and then CFEclipse. I started off with He3 because it had the Mach-ii plugin, which was pretty useful initially, but once I’d added a few plugins to my regular Eclipse (and they are as follows: CFEclipse, XMLBuddy, Quantum database, Brosinski’s RegEx, Grayski LogWatcher, VSS plugin), I kind of never looked back. The main appeal of He3 was the config file viewer, but with XMLbuddy I was able to gain an equally useful insight into my config file, which furthermore seemed more natural to me. Don’t get me wrong, I’ll be definetly check out the next beta release of He3, but for the time being it’s CFEclipse all the way. OK that’s the details side of things covered, what follows now are a few notes that I jotted down on while coding my Mach-ii application on this BlueDragon/Debian server set up, as code that ran seamlessly on CFMX had a few issues. One thing that didn’t help me were the error messages that BD was returning. So here’s a list of errors and the workarounds that worked for me. Unknown return type: One thing that got me initially was setting the return content type of your model CFCs. I had omitted the full path (say: main.content should have been model.main.content). Thanks to Phil’s excellent mach-ii.info site I found the answer to that one. Could not locate resource: Next casing got me. The files were properly cased, but the calls to the CFCs were mainly set to lower case. I worked through all of the CFCs and changed both the invoke path and return types to the proper casing just for consistency. No such function exists - geteventmapping: this error had made me stumped for quite a while. The problem lay in the return type of my object. Again capitalisation was to blame as was setting the return type to the object and I had inadvertently set it to Object instead of object. I encountered the error above on another occasion, but this time I wasn’t dealing with objects, so casing wasn’t the problem. Instead there was a type error that CFMX somehow was letting slip past, but BD caught. For my search I was passing in a parameter out of the event into another object. The expected type was numeric, however an empty string was being passed in. What had happened was that I was simply setting a var using arguments.event.getArg(“someVar”), without checking if it existed. If it doesn’t then it returns an empty string instead of throwing an exception. Well that taught me once again not to be sloppy about checking for the existence of variables. The only annoyance was the obscure error message that this caused. Finally I’d really appreciate any feedback on how it runs (especially the rdf feed using a feed reader [if you are reading this using one, hooray it works!]) or any errors that you may encounter.