From: Eric B. R. <eb...@tc...> - 2003-04-03 17:01:11
|
On Thursday, April 3, 2003, at 11:51 AM, Marc Palmer wrote: > On Thu, 3 Apr 2003 10:36:43 -0500, Eric B. Ridge <eb...@tc...> wrote: > >>> I am only now starting to use #macro (good work by the way)... but I >>> think that if your template experiences an error and you get the >>> exception showing line number and column in the template, this value >>> can be incorrect if you define/use macros in the template. I'm >>> certainly seeing this... >> >> Can you be more specific? Got an example? > > OK. The template it's happening on is shown below. WM is reporting: > > 2003-04-03 02:42:48 WebMacro:servlet WARNING Ignition encountered an > error while executing a template: > StreamTemplate:jndi:/localhost/ignition/WEB- > INF/templates/system/moduleHelp.wmt: org.webmacro.PropertyException: > Attempt to invoke method public static int > org.webmacro.servlet.ListUtil.size(java.util.List) on object > org.webmacro.servlet.ListUtil raised an exception: > java.lang.NullPointerException > java.lang.NullPointerException at jndi:/localhost/ignition/WEB- > INF/templates/system/moduleHelp.wmt:29.7 > > Here's the (work in progress) template... there is no call to > $List.size() anywhere near line 29. BUT there -is-a call to it on line > 29 of system/helpMacros.wmt - so it looks like it is the incorrect > filename being reported. eww, yuck. That sucks. I'll fix it as I'm the one that likely brought the bug to life in the first place. :( eric > > #include as macro "system/helpMacros.wmt" > #include "includes/header.wmt" > > #if (!$ignitionHelp.Module) > #set $mod = "default module" > #else > #set $mod = "module $ignitionHelp.Module" > #end > <h1>Ignition Help for $mod</h1> > > <p> > You can view help from the other modules: > #foreach $moduleName in $ignitionHelp.ModuleNames > #if ($moduleName != $ignitionHelp.Module) > #set $action = $Ignition.newAction("ignitionHelp") > #set $action.Module = $moduleName > #set $modMenuName = $moduleName > #if ($moduleName == "") > #set $modMenuName = "DEFAULT" > #end > <a href="$Ignition.execute([$action])">$modMenuName</a> > #end > #end > </p> > > <h2>Help Sections</h2> > <a href="_actions">Actions</a><br> > <a href="_helpers">Helpers</a><br> > ***** LINE 29 ****** <a href="_plugins">Plugins</a><br> > > <a name="_actions"> > #macro dumpActionInfo($title, $infoVar) > > <h2>$title</h2> > > <ul> > #foreach $action in $infoVar.Actions > <li><a href="#action_$action.Name">$action.Name</a> > #end > </ul> > > #if ($List.size($infoVar.Actions) > 0) > > <p> > Below is a list of the actions available from templates in > the $mod. To call these actions > you can insert the following into your templates: > #text > <pre> > #set $action = $Ignition.newAction( "actionNameHere") > #set $action.ParamNameHere = "ParamValueHere" > <a href="$Ignition.execute([$action])">Link to > action</a> > </pre> > #end > </p> > > #foreach $action in $infoVar.Actions > > <a name="action_$action.Name"> > > #dumpPluginInfo($action, true) > > <div class="helpActionVarsDiv"> > > <h3>Variables placed into templates:</h3> > > #dumpHelpVariables($action.Variables) > </div> > > #end ## Action loop > > #else > There are no actions available in this module. > #end ## count > 0 > #end ## Macro > > #dumpActionInfo( "Module Actions", $ignitionHelp.helpInfo) > > #if ($ignitionHelp.defaultHelpInfo != null) > #dumpActionInfo( "Default Actions", $ignitionHelp.defaultHelpInfo) > #end > > <a name="_helpers"> > <h2>Helpers</h2> > > #set $count = 0 > #foreach $helper in $ignitionHelp.helpInfo.Helpers > #set $count = $count + 1 > #end > > #if ($count > 0) > > <p> > The following helpers are available in your templates, for this > module. They can be accessed > like this: > #text > <pre> > <b>The value is:<b> $HelperNameHere.PropertyNameHere > $HelperNameHere.methodName("someParam") > </pre> > #end > </p> > > #foreach $action in $ignitionHelp.helpInfo.Helpers > <p> > $action.Name - > </p> > #end > > #else > There are no helpers in this module. > #end > > <a name="_plugins"> > <h2>Plugins</h2> > > <h3>Pre-request plugins</h3> > #dumpHelpPlugins( $ignitionHelper.helpInfo.PreRequestPlugins) > > <h3>Post-request plugins</h3> > #dumpHelpPlugins( $ignitionHelper.helpInfo.PostRequestPlugins) > > <h3>Pre-Action plugins</h3> > #dumpHelpPlugins( $ignitionHelper.helpInfo.PreActionPlugins) > > <h3>Post-Action plugins</h3> > #dumpHelpPlugins( $ignitionHelper.helpInfo.PostActionPlugins) > > #include "includes/footer.wmt" > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for > just $79/mo with 500 GB of bandwidth! No other company gives more > support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > Webmacro-devel mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-devel |