Blog

The Coldspring Plugin and what it can do for you!

For a while now we have been keeping a nifty little plugin in plain site, yet hidden away. This is our Coldspring plugin. It's been living the lonely life within our Plugins & Events page just waiting for the day to get out and show the world what it can do. Well in this blog post we are going to give that opportunity.

Lately I've been working on many heavy lifting projects that require some custom components to be built (services, factories, proxies, facades, etc) as well as 3rd party components to be readily available for quick and easy use. Coldspring for me has been great for this. It's native auto-wiring capabilities along with it's overall flexibility factor has made it my flavor of choice when it comes to component interaction.

Here is what it has to offer:

  • It can be used to do the common work of creating/housing singletons for future use:
    Just jump into the coldspring config found within the plugins /config directory and go to town.
  • You can inject the bean factory right into the event for quick and easy access: The plugin setting "Event Variable" will take care of injecting Coldspring right into the event for you.

    Here is an example on how you can refer to it as you are cycling through events (this example assumes that your variable name is "csFactory"):
    <cfset bean = event.getValue( "csFactory" ).getBean( {coldspringBean } ) />
  • Refer to pre-existing Mura components:
    Within the plugin settings you can flip the "Inject Mura Service Factory" switch and Mura's Coldspring factory becomes it's parent factory.

Now you may be asking, "Where would my library of components live?".

Well you have a choice here:

  • You can go the common ColdFusion route and place it in an easily accessible location that ColdFusion can find. 
  • Within Mura your best places are either within the requirements directory (since Mura loads all of the directories found there into their respective mappings for the application to use) or simply build your lib folder right inside the Coldspring plugin itself and either use the [plugin] key word (example below) or the plugin mapping (the plugin alias).

    It's important to note that if you use the alias approach you should update to the latest version of Mura since you will need to use our new mapping strategy.

Here is how you can setup a bean in Coldspring when using the [plugin] key:

<bean id="component1" class="[plugin]lib.component1" />

The [plugin] key will be replaced with the plugin directory itself during Coldspring's instantiation.

I encourage you to play around with the Coldspring plugin if your site depends on components outside of what Mura has to offer. You will not be disappointed.

You can read up on Coldspring by visiting its website.

----------------------------------

Pat Santora
Team Blue River

Comments

Grant

Just as a small testament to what you can do with this beauty, our Meld Forums plugin's foundation was in this little gem. It was the perfect place to start from.

January 29, 2010, 3:27 PM
Reply
Flag as Spam
Pat Santora

Glad that it helped!

January 31, 2010, 4:26 AM
Reply
Flag as Spam
Post a Comment

Required Field