I spent an afternoon with the extremely smart, creative folks at Blue River Interactive today, the minds behind the wonderful Mura Content Management System. We mostly focused on the FW/1 Plugin Template they've created, looking at ways to make it easier to use for Mura developers.
The end result was a couple of enhancements, one suggested by Steve Withington (thank you!) and one suggested by Matt Levine of Blue River, and a new version of the FW/1 Plugin Template on the Mura App Store (version 1.1). If you're building plugins for Mura and you're looking for a little structure, take a look at this plugin. The familiar $ object that provides access to the whole Mura ecosystem is now available directly in FW/1 views and layouts so the techniques you've learned for working with Mura in display objects can be applied to plugins you create with FW/1. Similarly, techniques you've learned for FW/1 - such as relying on the buildURL() and redirect() APIs - will work seamlessly in the Mura plugin, both in the admin and in user-facing pages.

11 responses so far ↓
1 jbuda // Aug 11, 2010 at 12:46 AM
2 Grant Shepert // Aug 11, 2010 at 7:42 AM
Also, I couldn't see any changes in the way $ was called, except that you used rc.$ instead of rc.Mura.$. Just wanted to make sure I didn't miss something there.
3 Grant Shepert // Aug 11, 2010 at 8:43 AM
<cfif structKeyExists(request,"serviceExecutionComplete")>
<cfset structDelete( request, "serviceExecutionComplete" )>
</cfif>
This, even though the structDelete clearly exists at the bottom (i.e. exactly like the new 1.1 version). Strangeness.
4 Steve Withington // Aug 11, 2010 at 1:00 PM
Thanks for taking the time to get this setup. I really do think this will help other developers attempting to integrate FW/1 with other applications (not just Mura).
You rock!
5 Bob // Aug 11, 2010 at 1:24 PM
6 Sean Corfield // Aug 12, 2010 at 4:51 PM
Can you email me details about service execution complete stuff - a blog isn't really the place for 'support' questions?
@Bob, var is needed in singletons to avoid thread safety issues - if a CFC is created per request, it wouldn't need var declarations. Sounds like you have an issue you need to take up with Mura directly - not on this blog?
7 Pat Santora // Aug 14, 2010 at 8:17 AM
8 Matt Levine // Aug 17, 2010 at 9:59 AM
<cfset variables.preserveKeyList="context,base,cfcbase,subsystem,subsystembase,section,item,services,action,controllerExecutionStarted">
<cffunction name="preseveInternalState" output="false">
<cfargument name="state">
<cfset var preserveKeys=structNew()>
<cfset var k="">
<cfloop list="#variables.preserveKeyList#" index="k">
<cfif isDefined("arguments.state.#k#")>
<cfset preserveKeys[k]=arguments.state[k]>
<cfset structDelete(arguments.state,k)>
</cfif>
</cfloop>
<cfset structDelete( arguments.state, "serviceExecutionComplete" )>
<cfreturn preserveKeys>
</cffunction>
<cffunction name="restoreInternalState" output="false">
<cfargument name="state">
<cfargument name="restore">
<cfloop list="#variables.preserveKeyList#" index="k">
<cfset structDelete(arguments.state,k)>
</cfloop>
<cfset structAppend(state,restore,true)>
<cfset structDelete( state, "serviceExecutionComplete" )>
</cffunction>
@bob If var scoping is an issue that hinders your adoption of Mura I would appreciate it if you would run varscoper on the the latest build and report back in the Mura forum.
9 Sean Corfield // Aug 17, 2010 at 10:38 AM
There are no thread safety issues with FW/1 itself (at least, by design, its behavior is intentional). What does your state manipulation achieve?
10 Matt Levine // Aug 17, 2010 at 11:25 AM
It become particularly important when binding custom Mura events to FW/1 actions. The custom event can be announced by other FW/1 based eventHandlers/displayObjects. This creates a situation where the second second FW/1 inovation happens inside of the first.
So it's not a FW/1 issue, it's a using FW/1 as a Mura sub application framework issue.
11 Sean Corfield // Aug 18, 2010 at 10:54 AM
Leave a Comment