Test Dashboard plugin

37 views
Skip to first unread message

Alex Sante

unread,
Apr 25, 2013, 3:36:47 PM4/25/13
to cfwh...@googlegroups.com
Guys,

I'm working on a testing dashboard plugin that will utilize ajax requests to run each test and provide real-time feedback.  It will also monitor your test directory for changes and run test suites automatically.  The question I have is -  is there a way to tell wheels not to use a layout for ajax requests?

I had to modify "/wheels/public/layout.cfm" in order to make this work, but I was wondering if there was another way.  

thanks!
Screenshot_4_25_13_3_32_PM.png

Donald Humphreys

unread,
Apr 25, 2013, 3:46:06 PM4/25/13
to cfwh...@googlegroups.com
That looks pretty slick! I think you can just use
renderPage(layout=false) along with any other options you need. You
would have to do that on every action, though. I would probably go
with something like this at the bottom of each action:

if (isAjax())
renderPage(layout=false);

Also, calling renderPartial() doesn't wrap the partials in a layout.
But that wouldn't allow you to use any views you have already built
unless you copied them into partials first.
> --
> You received this message because you are subscribed to the Google Groups
> "ColdFusion on Wheels" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cfwheels+u...@googlegroups.com.
> To post to this group, send email to cfwh...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cfwheels?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Alex Sante

unread,
Apr 25, 2013, 3:57:04 PM4/25/13
to cfwh...@googlegroups.com
I hear ya, but this would all be part of a plugin package. As far as I can tell, the Controller/View concept does not apply for plugins.  So "renderPage(..)" and other helper methods don't apply here. It's basically an index.cfm page and a cfc used for mixing in special functionality into wheels.

What i've done so far to get things working is modify the public wheels layout.cfm file to:

<cfif isAjax() or get("includeSystemLayoutForPlugins") EQ FALSE>
<cfoutput>#includeContent()#</cfoutput>
<cfelse>
<cfinclude template="../styles/header.cfm">
<cfoutput>#includeContent()#</cfoutput>
<cfinclude template="../styles/footer.cfm">
</cfif>

Obviously I don't want to modify the core wheels code, so I'm hoping there's another way.

Andy Bellenie

unread,
Apr 26, 2013, 5:58:43 AM4/26/13
to ColdFusion on Wheels
The index.cfm within a plugin is really meant for documentation, rather than functionality.

Instead I would create a method with mixin="controller" that actually runs the plugin code. You will then be able to use all regular wheels functions and call it from a normal Wheels URL.

A

Tom King

unread,
Apr 26, 2013, 8:01:45 AM4/26/13
to cfwh...@googlegroups.com
On a bit of a sidetrack, it's something which definitely stops me doing certain types of plugin (specifically the lack of being able to have view folders etc within the plugins folder). It means the end user has to copy out those view files when installing, which I think is less than ideal. (or you have to render all the HTML in the plugin CFC, and return it that way which is again, less than ideal.)

Would love to see the dashboard code - I need to do something v similar soon!

Andy Bellenie

unread,
Apr 26, 2013, 8:32:52 AM4/26/13
to ColdFusion on Wheels
Isn't it possible to just cfinclude the view code from inside the plugin directories, despite calling it from a regular action?

Tom King

unread,
Apr 26, 2013, 9:00:06 AM4/26/13
to cfwh...@googlegroups.com
Oo - fair point. Not even occurred to me. Interesting... :)

Alex Sante

unread,
Apr 26, 2013, 2:30:10 PM4/26/13
to cfwh...@googlegroups.com
I should have something ready pretty soon.  I'll be committing to github soon and will share the url once it's ready.

Alex Sante

unread,
Apr 29, 2013, 2:55:09 PM4/29/13
to cfwh...@googlegroups.com
I'm still working on cleaning it up a bit, but I've been able to use it for all of my test suites.  Here's a quick no-audio screencast showing how it works.

http://www.screenr.com/b1w7

Chris Geirman

unread,
Apr 29, 2013, 3:26:20 PM4/29/13
to ColdFusion on Wheels
I'm impressed... this looks super sweet!


On Mon, Apr 29, 2013 at 11:55 AM, Alex Sante <alexand...@gmail.com> wrote:
I'm still working on cleaning it up a bit, but I've been able to use it for all of my test suites.  Here's a quick no-audio screencast showing how it works.

http://www.screenr.com/b1w7

MacAllister, Colin

unread,
Apr 29, 2013, 4:38:08 PM4/29/13
to cfwh...@googlegroups.com

Wow, really cool.

 

—CM

--

Reply all
Reply to author
Forward
0 new messages