Jared Rypka-Hauer, Lead ColdFusion Developer, Minneapolis, MN

Proud Parents of SQLSurveyor and PayPalMX
Viewing By Entry / Main
November 10, 2006 - back to top
Just before MAX, I sent a new version of the ColdSpring DefaultXmlBeanFactory.cfc to the CS team with new code that implements the <import /> tag, which has now been committed to the main CVS repository:

<import resource="/path/to/file.xml" />

It supports the following path types:
  • relative (../../my/path/file.xml)
  • CF mappings (/modelglue/actionpack/foo/config/coldspring.xml)
  • absolute or physical (d:\my\extra\cs\file.xml or /opt/to/useit.xml)
It simply includes the resource (which must be a valid ColdSpring xml file) as part of the current one, so when you load the beans from a file that uses import, the ones from the included file are created too. And it features recursion protection so it won't kill your server if two files accidentally include eachother. It just loads each one once.

So head over to http://www.coldspringframework.org and check it out.

Laterz!

Comments

That is awesome! great addition.


Woot! I'd been trying <include /> instead of <import />.

Simply pimp. Gratz.


I have tried for a couple of hours to get this to work and have not had any luck, could someone post a working snippet of this?


Trevor, can you post the tag you have?

Just FYI, a later revision of ColdSpring cut out absolute paths, so using drive letters or a UNIX path from / no longer works, it's just webroot- or mapping-relative and dot-notation relative paths.

If you post the way you're using the tag, it may help with figuring out what the issue is...


You have to have a complete, valid ColdSpring file for the include, which means you need to have, at the very very minimum, <beans><bean /></beans> in the included file in order for it to work.

I'm posting this here just so that it's available for anyone else having this issue.





Aura skin for Raymond Camden's BlogCFC provided by Joe Rinehart.