Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

ANT to build Model Glue Project

If you use Eclipse and are creating a lot of Model Glue project check out Wayne Grahams ANT script. Not only does it help you create a MG project quickly, but if like me you don't know ANT all too well its a good guide to creating your own build.xml files.

Comments Comments (0) | Print Print | Send Send | 2496 Views

Escaping characters in model glue xml files

More of a reminder to myself. But when adding text to .xml files (in my case the beans.xml) don't forget to Ascii escape characters like £(£).

You can find a pretty comprehensive Ascii list here http://www.lookuptables.com/

Comments Comments (0) | Print Print | Send Send | 2220 Views

Model Glue : Setting up global variables

Unlike Fusebox there is not a global init variable setting file With MG. If you do need to set up some global vars the way i'm doing this (and seems to be the norm nearly) is:

  1. Set up a cfc called /config/beans/global.cfc
  2. Create an xml file at /config/beans/global.xml - (for my current site this covered about 5-8 small structures/arrays/values that is used through out the site)
  3. In the controller add the following line -
    <cfset variables.global = GetModelGlue().GetConfigBean("global.xml") />
  4. and on request start -
    <cfset arguments.event.setValue("global", variables.global) />

Now on any page to get the variable you want you can use
view plain print about
1<cfset customerTitles = viewState.getValue('global').getTitles() />

I've seen no documentation on this, but have posted to the Topica List. Sean Corfield has another method using a new controller you can find it on the Topica lists also see the GGCC examples (7/8/9) in his frameworks Pod.


For more information on Config beans in MG see :
Eat Your Beans: ConfigBeans in Model-Glue

Comments Comments (1) | Print Print | Send Send | 2616 Views

Model Glue Controller config explained

Below is a quick run down of the config.xml setting in Model Glue, though i would like to take credit :o) i got this from the MG lists, posted by Doug Hughes

Here's a rundown of the settings:

<setting name="applicationMapping" value="/" />


This is where your application is located. If it's in a subdirectory (or a
mapping put that here.
<setting name="beanMappings" value="/config/beans/" />


[More]

Comments Comments (0) | Print Print | Send Send | 1875 Views

Previous Entries

BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .