You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by brian janaszek <bj...@collaborativefusion.com> on 2004/01/08 22:06:40 UTC

Custom PullTool Issue

Hi--

I have several custom pull tool implementations for a Turbine 2.2-based
web application.  These tools have worked without problems -- until
today.  Here's a brief process overview:

* A user can add information about academic classes they have taken. 
The app provides a list of classes, but the user has the option of
adding additional classes to the application's database.  A pull tool is
used to return of existing classes, which is then used in a Velocity
template to generate a select list.  At this point, the user can choose
a class from the list and enter information about it (date taken, grade,
etc), or they can choose to add a new class.  At this point, the pull
tool works.
* If the user chooses to add a new class, they are redirected to a
different screen to collect that information.  An action classes
processes that information, then the user is redirected back to the
template with the complete list of classes.
* At this point, the pull tool fails -- while the tool itself exists in
the context of the Velocity template, any calls to methods within the
tools are ignored and the Velocity log has "RHS of #set statement is
null" entries.  

I have logging messages within the pull tool methods to indicate that
the methods were called, but these messages aren't logged, indicating
that the methods were never called.  The pull tool seems to be present
in the Velocity context (via a #if ($pulltool) check), but I can't call
any methods on the tool when redirected back to the template from the
action class.  If I click on a menu link to that template immediately,
or type the URL in the location bar, the tool method is called properly.

Any clues?  The service behind the pull tool is being instantiated
correctly (as evidenced by successful calls to the tool prior to this
template).

TIA
b

RE: Custom PullTool Issue

Posted by brian janaszek <bj...@collaborativefusion.com>.
On Thu, 2004-01-08 at 16:16, David Demner wrote:
> Hi Brian,
> 
> I had something exactly like this happen to me last week.  It turns out that
> the name I had chosen for a class conflicted with something.  My tool was
> called $navigation, and I changed it to $navigationtool and all was well
> again.  Maybe 'pulltool' conflicts with something (it sounds common enough)?
> 
> Maybe try changing the name of the tool?  (In TurbineResources.properties I
> had tool.authorized.navigation=mypackage.Navigation which I changed to
> tool.authorized.navigationTool=mypackage.Navigation and in my .vm files I
> changed $navigation to $navigationtool).

Well.  Your response got me on the right track.  It was so much the name
of tool (I used "pulltool" as an example), but the fact that the
template screen class, in certain circumstances, puts an object in the
Velocity context with the same name as the tool -- thus causing the
conflict.

Thanks...
b

RE: Custom PullTool Issue

Posted by David Demner <tu...@demner.com>.
Hi Brian,

I had something exactly like this happen to me last week.  It turns out that
the name I had chosen for a class conflicted with something.  My tool was
called $navigation, and I changed it to $navigationtool and all was well
again.  Maybe 'pulltool' conflicts with something (it sounds common enough)?

Maybe try changing the name of the tool?  (In TurbineResources.properties I
had tool.authorized.navigation=mypackage.Navigation which I changed to
tool.authorized.navigationTool=mypackage.Navigation and in my .vm files I
changed $navigation to $navigationtool).

Good luck,

David

-----Original Message-----
From: brian janaszek [mailto:bjanaszek@collaborativefusion.com] 
Sent: Thursday, January 08, 2004 1:07 PM
To: Turbine Users List
Subject: Custom PullTool Issue


Hi--

I have several custom pull tool implementations for a Turbine 2.2-based
web application.  These tools have worked without problems -- until
today.  Here's a brief process overview:

* A user can add information about academic classes they have taken. 
The app provides a list of classes, but the user has the option of
adding additional classes to the application's database.  A pull tool is
used to return of existing classes, which is then used in a Velocity
template to generate a select list.  At this point, the user can choose
a class from the list and enter information about it (date taken, grade,
etc), or they can choose to add a new class.  At this point, the pull
tool works.
* If the user chooses to add a new class, they are redirected to a
different screen to collect that information.  An action classes
processes that information, then the user is redirected back to the
template with the complete list of classes.
* At this point, the pull tool fails -- while the tool itself exists in
the context of the Velocity template, any calls to methods within the
tools are ignored and the Velocity log has "RHS of #set statement is
null" entries.  

I have logging messages within the pull tool methods to indicate that
the methods were called, but these messages aren't logged, indicating
that the methods were never called.  The pull tool seems to be present
in the Velocity context (via a #if ($pulltool) check), but I can't call
any methods on the tool when redirected back to the template from the
action class.  If I click on a menu link to that template immediately,
or type the URL in the location bar, the tool method is called properly.

Any clues?  The service behind the pull tool is being instantiated
correctly (as evidenced by successful calls to the tool prior to this
template).

TIA
b


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org