Code Depot

This page has a listing of contributed plugins, interceptors and more until the ColdBox website supports it. If you have any ColdBox material that you would like to share with the community, please send them to info@… with a description, a license type, and the zip file of your content and it will be posted here.

Official ColdBox Custom Plugins

The plugins offered below are developed by Team ColdBox and are supported as such.

Update All the official ColdBox Plugins are now offered as a plugin pack download: Plugin Pack Download

GroovyLoader

The GroovyLoader plugin is distributed as part of the projects pack in the extra downloads section of ColdBox as it includes a mini sample application to show how the plugin works. This plugin was inspired by the great work of Barney Boisevert and his CFGroovy project. As of now this plugin supports the following:

  • Load a groovy environment (1.6.0) into any ColdBox application without modifying the running CF engine
  • Choosing of a directory that will hold groovy classes/scripts: configureClassPath().
  • Integration with the ColdBox cache to provide resolution of parsed java classes for all parsed groovy source, including custom source executions
  • Ability to clean the parsed class cache from the ColdBox cache
  • Ability to clean the groovy classloader cache of parsed bits
  • Ability to handle complex groovy/java relationships
  • Ability to load any jar or classes, just by adding your jar/class files to the GroovyLoader lib directory. This leverages the usage of the JavaLoader plugin to class load at runtime.
  • Easily extend/decorate the plugin to meet your needs or enhance it
  • Create groovy classes: create(clazz)
  • Execute groovy scripts: runScript(scriptName,varCollection)
  • Execute groovy source code: runSource(scriptSource,varCollection)
  • Execute groovy source code using a custom tag import
  • Groovy scripts and source code executions will be binded with the following variables. This means that the groovy scripts that are executed using runScript() and runSource() will have the following variables IMPLICITLY created at runtime:
    • A custom passed structure called varCollection. This can have anything you like.
    • The coldbox request collection: coldbox_rc
    • The following coldfusion variables:
      • cf_pagecontext : The coldfusion pagecontext object
      • cf_application : The coldfusion application scope
      • cf_server : The coldfusion server scope
      • cf_session : The coldfusion session scope (if available)

Init the plugin

<cffunction name="onAppInit" access="public" returntype="void" output="false">
<cfargument name="Event" type="any">
  <!--- Init the Groovy Loader --->
  <cfset getMyPlugin("GroovyLoader.GroovyLoader").configureClassPath(getSetting("ApplicationPath") & "model/groovy")>
</cffunction>

Handler Code Samples:

<cfcomponent name="groovy" hint="My groovy handler" output="false" extends="coldboxy.system.EventHandler">
<!--- dependencies --->
<cfproperty name="groovyLoader" type="coldbox:myplugin:GroovyLoader.GroovyLoader" />

<!--- Import Groovy Scripting --->
<cfimport prefix="groovy" taglib="../plugins/GroovyLoader/tags" />

<!--- runTagSource --->
<cffunction name="runTagSource" access="public" returntype="void" output="false" hint="">
        <cfargument name="Event" type="any" required="yes">
        <cfset var rc = event.getCollection()>
        <!--- Place Date --->
        <cfset rc.today = now()>
        <!--- Groovy Script --->
        <groovy:script>
        <cfoutput>
                def today = coldbox_rc["today"]
                def SubjectLine = ["Hello","my","name","is","Luis Majano.","Expressed at",today]
                //Place in ColdBox event context
                coldbox_rc["SubjectLine"] = SubjectLine.join("_")
        </cfoutput>
        </groovy:script>
        <cfset event.setView("runTagSource")>
</cffunction>

</cfcomponent>

Sample Method Calls

//create a groovy class called Hello.groovy
rc.oHello = getMyPlugin("GroovyLoader.GroovyLoader").create("Hello");

//Run a script called Test.groovy
getMyPlugin("GroovyLoader.GroovyLoader").runScript('Test',rc.varCollection);
                        
//Run dynamic source
var source = "varCollection.GroovyArray = [1,2,3,4]";
rc.varCollection = {createdAt=now()};
getMyPlugin("GroovyLoader.GroovyLoader").runSource(source,rc.varCollection);

System Requirements

  • ColdBox 2.6.2 and above
  • Railo 3.0 and above
  • Adobe ColdFusion 8.0 and above

FileWriter

Uses the Java FileOutputStream, OutputStreamWriter, and BufferedWriter to provide a way to GREATLY increase performance of file output. Must faster and less resource intensive than trying to build large strings and perform fewer CFFILE append actions. Also less memory intensive than putting strings into an array and then performing a listToArray() call.

cfengine

A cool utility that let's you know which flavor of ColdFusion and what version you are running on. It also has a set of public properties for you to do testing to.

paging

A very cool and simple to use paging plugin. It can create a paging carousel for any recordset or array or whatever you want to page. Instructions are located inside of the plugin.

diff

Another cool plugin to help you create differences between files, strings or arrays. This plugin is used by the [Codex Wiki] to create wiki pages diffs.

ClusterStorage

A great storage plugin for Railo's cluster scope. You can now easily talk to any servers in a cluster with this nifty plugin.


Official Interceptors

The interceptors offered below are developed by Team ColdBox and are supported as such. Please download at your own risk, they are offered "As Is".


Third Party Plugins

The plugins offered below are contributed to the ColdBox project and are therefore maintained by those authors and not the ColdBox effort. Please download at your own risk, they are offered "As Is".

Captcha

CFImage CAPTCHA Plugin.

toXML

Set of utility functions to generate XML.

Spry Plugin

A great plugin for Adobe Spry and the ColdBox Framework.

JS Calendar Plugin

A great JS Calendar plugin for the ColdBox Framework.

Webcharts3D Plugin

A great plugin for WebCharts3D and the ColdBox Framework. WebCharts3D is included in ColdFusion.

CSS Graphing Plugin

A great CSS based graphing plugin.


Request Method Plugin

A plugin that allows for POST's only on certain executions.


I have just written what I feel to be a handy plugin. Right now, it only has one function, and that's the make sure the current request method is POST. It can be conveniently used inside a preHandler() method of an event handler.

    <cffunction name="preHandler" output="false" returntype="void" access="public">
        <cfargument name="Event" type="coldbox.system.beans.requestContext">
        <cfif "confirm,create" CONTAINS event.getCurrentAction()>
            <cfset controller.getPlugin('RequestMethod',true).requirePost() />       
        </cfif>
    </cffunction>

ScriptInclude Plugin

The ScriptInclude plug-in was built for the ColdBox Framework to simplify including external stylesheets and JavaScript files. Additionally, ScriptInclude simplifies injecting internal JavaScript into your views and layouts.

Third Party Interceptors

The interceptors offered below are contributed to the ColdBox project and are therefore maintained by those authors and not the ColdBox effort. Please download at your own risk, they are offered "As Is".

Form Inspector Interceptor

When you create form fields with names like:

<input type="text" id="firstName" name="user.firstName" />
<input type="text" id="lastName" name="user.lastName" />
<input type="text" id="email" name="user.email" />

The interceptor will create a 'user' structure in the requestContext. So you can do

getPlugin("beanFactory").populateFromStruct(User, event.getValue('user'));

The advantage is that you can now use your form to group related data together into structures.