AbstractRemotingService.cfc 'Template' not defined

7 views
Skip to first unread message

Kevin Penny

unread,
Feb 3, 2010, 11:41:22 PM2/3/10
to model-glue
I'm a bit new to mg, but have been building an app that we now wanna
take advantage of the AbstractRemotingService.cfc. I've done remoting
via ColdSpring in the past which I really like but this was the path
we've chosen for now.

So I create my RemoteService.cfc in the application root directory and
Extend the ModelGlue.gesture.remoting.AbstractRemotingService
component and that's pretty much all I have to do right?

When I execute a call to it via URL at say mydomain.com/
RemotingService.cfc?method=executeEvent&eventname=goal.metertest I get
the following error:


Variable TEMPLATE is undefined.

The error occurred in D:\www\xyz\classes\frameworks\ModelGlue_3\gesture
\remoting\AbstractRemotingService.cfc: line 11

9 : <cfset request._modelglue.bootstrap.blockEvent = 1 />
10 :
11 : <cfmodule template="#template#" />

And following the call from the AbstractRemotingService executeEvent()
method it calls getModelGlue() - which looks for some 'template'
variable which I have no idea where that would come from.

Any help?

I'd love to try this out before I scamper back to using CS to expose
things.

Thanks

Kevin Penny

unread,
Feb 4, 2010, 12:03:51 AM2/4/10
to model-glue
Ok - and when I set the value of template inside the
AbstractRemotingService.cfc it actually works:

<cfset template = "../../../../../application/index.cfm">

Since the ModelGlue Directory is located in a subdirectory maybe it's
getting confused - or do you have to explicitly set it?

Directory Structure is:
trunk
application (where index.cfm and RemotingService.cfc live)
classes
frameworks
modelGlue_3
gesture
remoting (where AbstractRemotingService.cfc lives)

Ezra Parker

unread,
Feb 4, 2010, 12:04:23 AM2/4/10
to model...@googlegroups.com
Hi Kevin,

The Model-Glue application template includes a RemotingService.cfc
file that you can drop into your application, and there is a line in
this file which sets the "template" variable that you are missing. In
case you don't happen to have the application template handy, I've
pasted a copy of RemotingService.cfc here:

http://modelglue.pastebin.com/m5b2a310d

Note that you will need to change line 6:

<cfset template = "/modelglueapplicationtemplate/index.cfm" />

This path needs to resolve to your application's index.cfm file, so
for example, if you are hitting the app at
http://localhost/myapp/index.cfm, then this line should be:

<cfset template = "/myapp/index.cfm" />

That should get you up and running, but be sure to report back if you
encounter further problems.

--
Ezra Parker

> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to model...@googlegroups.com
> To unsubscribe from this group, send email to
> model-glue+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en
>

Dan Skaggs

unread,
Feb 4, 2010, 12:07:05 AM2/4/10
to model...@googlegroups.com
You really want the ModelGlue folder to be off the root of your site or to have a mapping named /ModelGlue created pointing to the ModelGlue folder created in the CF administrator.  The framework is designed internally to work from /ModelGlue and you should not make any changes to the core framework files to implement it into your application.

Dan

Kevin Penny

unread,
Feb 4, 2010, 12:12:42 AM2/4/10
to model-glue
Right - I didn't want to make a change to the actual Abstract cfc core
file, but rather my RemotingService.cfc that extended it (I modified
the abstract just as a test though) -

Yes we have a mapping as the entire app works -

So it sounds like what I did in my RemotingService.cfc is the norm
then.

I checked for that file in the repo we have and didn't find it - but
I'll certainly check out the link above -

This is the file as it ended up being:
<cfcomponent displayname="Remoting Service"
extends="ModelGlue.gesture.remoting.AbstractRemotingService"
output="false" hint="generic remoting service to extend mg abstract
remoting service">

<cfset template = "../../../../../application/index.cfm">
</cfcomponent>

Excellent thanks!

Ezra Parker

unread,
Feb 4, 2010, 12:21:25 AM2/4/10
to model...@googlegroups.com
There are also a couple of other wrinkles to the RemotingService file
in addition to setting the template variable, so you may want to go
ahead and grab a copy of application template version if either of
these issues matters to you:

It ensures that CF debugging is suppressed to prevent it from breaking
remoting calls, and actually includes the executeEvent() method (which
just turns around and calls super.executeEvent()) in order to work
around a bug with <cfajaxproxy>.

--
Ezra Parker

Kevin Penny

unread,
Feb 4, 2010, 12:25:20 AM2/4/10
to model-glue
cool yeah I saw there were some notes in there re: ajaxproxy etc so
I'll be safe - thanks

On Feb 3, 9:21 pm, Ezra Parker <e...@cfgrok.com> wrote:
> There are also a couple of other wrinkles to the RemotingService file
> in addition to setting the template variable, so you may want to go
> ahead and grab a copy of application template version if either of
> these issues matters to you:
>
> It ensures that CF debugging is suppressed to prevent it from breaking
> remoting calls, and actually includes the executeEvent() method (which
> just turns around and calls super.executeEvent()) in order to work
> around a bug with <cfajaxproxy>.
>
> --
> Ezra Parker
>

Reply all
Reply to author
Forward
0 new messages