This question about Using an extension: Answered

Chart plugin with database plugin table

It seems like the chart plugin is not able to read data from tables created by the database plugin. It is only giving the error "ChartPlugin error: parameter table is not valid table; the specified table [XXX] does not exist." Where [XXX] is the table number.

I also tried

 
%TABLE{ name = "somename"}%
%DATABASE_SQL{[...] header="..."}%

and

 
%TABLE{ name = "somename"}%
|*Column1*|* [...] *|
%DATABASE_SQL{[...]}%

In this case the the chart plugin recognizes the table but the content produced by the database plugin is not selectable. The error is: "ChartPlugin error: chart error: name=[name] 10.2015: Error: Number of data points needs to be > 1"

This is very important for my compony to work so before I start to rewrite the code by myself I have to know if there is a simpler solution.

-- AlexanderHarnisch - 14 Oct 2015

I found the answer myself here: http://foswiki.org/Support/Question558 by googleing. This question was not displayed to me on the "Answered Questions" page. But it seems like I can not change the status of my question to answered.

-- AlexanderHarnisch - 14 Oct 2015

Background: both - ChartPlugin as well as DatabasePlugin do NOT register their macros to Foswiki's TML parser which would then expand macros properly (inside-out, left-to-right). Instead those two plugins parse the wiki text by themselves and top down as they are given a chance to do it. The natural order of those plugins is given by their name. So ChartPlugin is evaluated first and DatabasePlugin second. As a consequence ChartPlugin does not see the output of DatabasePlugin yet.

The ad-hoc solution is the one in Question558: manually change the plugin order so that DatabasePlugin comes first and ChartPlugin comes second. Note however that this is a global setting and defines a plugin order for all plugins in all of the wiki. There might be a case when you need one or the other plugin order to let plugins interact with each other properly ... and thus specifying a global plugin order is bound to fail.

As a rule of thumb: plugins that do NOT register macros properly are hard to combine in a wiki application.

Some plugins require context not provided by Foswiki's macro parser, such as %CALC needing the table contenxt it operates on.

Some plugins implement xml tags of their own such as <dot>...</dot> or <latex>...</latex> and the like. These can't be parsed with the help of the build in macro parser.

However as far as I see both - ChartPlugin and DatabasePlugin - may be implemented using registerTagHandler instead of using commonTagsHandler.

In case of DatabasePlugin you might want to try out SqlPlugin which does so. ChartPlugin simply needs to be modernized/fixed.

-- MichaelDaum - 14 Oct 2015
 

QuestionForm edit

Subject Using an extension
Extension ChartPlugin, DatabasePlugin
Version Foswiki 2.0.2
Status Answered
Related Topics
Topic revision: r2 - 14 Oct 2015, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy