November 21, 2008

Pages


Search Site


Topics



Archives

Tweets

Entries Tagged as 'Model-Glue'

Model-Glue 2 Cheat Sheet

June 26 2008 by Adam

Someone by the name of Nando posted his Model-Glue cheat sheet to the Model-Glue discussion group. I took the time to clean it up and make it a little more readable, and fit onto two pages. I've printed it out as front and back of a single page, and keep it with my laptop for reference. I think I'll also add it to my sidebar for easy reference. Thanks to Nando for doing the leg work. I just made it pretty! Click the thumbnail to download the PDF.

Posted in Frameworks | Model-Glue |

Improve Model-Glue 3 Load Time: Remove Unwanted Helpers

May 30 2008 by Adam
I've been spending a fair amount of time playing with the latest Release Candidate of Model-Glue 3 lately, and I've stumbled on a way to vastly improve load time. One of the new features of MG3 is "helpers", which is an easy way to make UDFs available throughout your applications. It really does make working with UDFs in Model-Glue easier, but there's one problem: It comes packaged with hundreds and hundreds of them. In fact – almost every single UDF on CFLib! And especially on your development server, where you're likely to reload the entire framework on every request loading them takes a good long time. If you prefer to hand-pick which UDFs to include – as I do – you have a couple of options. The simplest is to edit your config/coldspring.xml file, and remove the reference to the packaged helpers: <property name="helperMappings"><value>/helpers,/ModelGlue/helpers</value></property> becomes: <property name="helperMappings"><value>/helpers</value></property> Now you can selectively put UDFs that you want to use into your /helpers folder and have access to them without having to tack an extra 10 seconds onto the load of every page.

Posted in ColdFusion | Frameworks | Model-Glue |

Making New Toys Play Nice: Model Glue 3 & Open Blue Dragon

May 27 2008 by Adam

If you're like me (a glutton for spiffy new technology, and even more-so when it's free) then you've played around with Open Blue Dragon, and probably the latest release candidate for Model Glue 3. Unfortunately, they don't play nicely with each other out of the box. In this post, I'll document everything I've done in order to make MG3 run on OpenBD.

For reference, I'm running the Jetty-server-included version of OpenBD on Debian, against MySQL — which, by the way, is an awesome way to get a development environment up and running in no time flat!

The first problem I hit was this error: Bean creation exception during init() of ModelGlue.gesture.modules.internal.generation.service.XMLEventGenerationService MG3 error on OpenBD

After a little searching around, I found this post on the Model-Glue discussion group, where the issue reporter was describing almost exactly the same issue, and the response by Dan Wilson was that MG3 requires some of the new functionality packaged with ColdFusion 8 — but that he had submitted a bug report for it in the MG bug tracker, and provided a modified version of the file in question that uses a work-around for the issue. I tried this file and it resolved my issue. Dan says that the resulting XML may not be very pretty, but this is at least a starting point and might be improved on. Once you've gotten that resolved, you'll find that Model-Glue is throwing errors while loading itself.

Model-Glue 3 includes something called "helpers" which appears to mostly be a collection of UDFs; and this will be where your errors are happening. If you don't intend to use any of the helpers (or can/will copy any needed functions into your application manually), you can just delete the .cfm files in /ModelGlue/helpers/ and skip the rest of this step. Otherwise, what you'll need to do is run each helper file as if it were one of your pages, individually, and resolve all of the errors it throws. I will include downloads for any files I modified for this post.

OpenBD has some functions defined (CharAt, listRemoveDuplicates, etc) that aren't defined in Adobe ColdFusion CFML — these you can just comment out — and you'll also find some syntax like !=, ++, <=, and % that will need to be converted to neq, mod, lte, etc. NOTE: The baked in functions that collide with UDFs may not work the same way as the ones you're commenting out, so be sure to either look up their documentation, or thoroughly test before you rely on them. I changed: StrLib.cfm, DataManipulationLib.cfm, and DatabaseLib.cfm (switched a cfscript-style comment outside of a cfscript block to a normal CFML comment). Once each of these files will run individually without error, try your index.cfm again and you should see everything up and running!

As promised, here are the three files I modified. Don't forget to grab the modified copy of CGCodeGenerator.cfc from this post. I see that these helper issues have also been logged as bugs, so hopefully they will all be resolved before a final version is released.

MG3 working on OpenBD

UPDATE 5/30: At this point, it looks like code generation just doesn't want to work on Open Blue Dragon. Sean Corefield responded to a post of mine on the model-glue mailing list about it not working, and says that Joe is aware of the issue (with another Java class used) and plans to rewrite the code without using these problem classes at some point. Hopefully we'll see them fixed before a final release.

Posted in ColdFusion | Frameworks | Model-Glue | OpenBD |

CFMenuCal overhaul, feature request, and more!

February 11 2008 by Adam
I'm getting pretty close to finishing my secret goals for the next iteration of CFMenuCal. To be honest, I don't remember what information I was planning on sharing before it becomes available so I'll tell you a few things now. I've got to keep some secrets though. ;)
  • It's getting a new name! I was never terribly fond of the name "CFMenuCal" but I was anxious to get the project posted on RIAForge so I just gave it that boring overly descriptive name. Hopefully the new name will provide a little bit of "branding" or something. The new name doesn't contain "CF", because it's no longer a tool that requires you to use ColdFusion…
  • It will be a free online service! In other words: A site where you can go sign up for an account and log in every now and then to create some meal calendars from your stored settings. That means I've already registered a domain and started setting it up. Can you guess what it is?
  • Model Glue! This may not be terribly exciting to you, but I'm thrilled about it. This is my first real Model-Glue application, and I'm excited to have a real-world application in an MVC architecture and using a ColdFusion framework.
Rewriting everything to fit into the MVC architecture was a pain in the butt because the code was an absolute mess to begin with. But it has helped because I've already thought of and implemented new features with just a few lines of code. So, what kind of features would make it an even more appealing service to you?
  • Would you want an iCal feed so that you can import your menu calendars into your Google Calendar or other Calendaring tool of choice?
  • What about saving the finished product as a PDF, so that you don't have to print from your browser?
These are just a few of the things I've been rattling around in my head. What other things would you like to see added? Nothing is off limits here… ask for anything!

Posted in CFMenuCal | Model-Glue | My projects |