SPARK - Patch - Config/ReplaceVariables

9 views
Skip to first unread message

Benedikt Kämpgen

unread,
Aug 31, 2011, 2:04:33 PM8/31/11
to rdf-...@googlegroups.com, Jeroen De Dauw
Hello Jeroen,

See attached a patch I have created for Spark.

==What it does==
* It allows to have variables/templates etc in the data-spark-query. This is
useful, if the query shall depend on variables in the wiki page.
* It takes the data-spark-format and adds a module (simply the name of the
visualisation, prefixed with "ext.spark") to the page if defined in
Spark.settings.php or LocalSettings.php (e.g., ext.spark.datechart). This is
useful, if visualisations need additional java script files but those files
should only be loaded if the visualisation is used on a page.
* It adds some example modules to Spark.settings.php

Do you think it would be possible to upload those changes?

I can do it, also, if you give me the green light.

Best,

Benedikt


--
AIFB, Karlsruhe Institute of Technology (KIT)
Phone: +49 721 608-47946
Email: benedikt...@kit.edu
Web: http://www.aifb.kit.edu/web/Hauptseite/en

spark_patch_20110831.txt

Jeroen De Dauw

unread,
Aug 31, 2011, 2:29:28 PM8/31/11
to Benedikt Kämpgen, rdf-...@googlegroups.com
Hey,

Feel free to commit.

One remark on this code that I have is that you should not make a bunch of resource loader modules with some base files and then one special file. Put the base files in a base module and add that one as dependency for the others.

In general I think it's a bad idea to have to care about what JS files to load at this place though. If the MediaWiki extension goes associate formats with files, and the Spark lib changes, stuff will break. The Spark lib is the only thing that should care about what files should be loaded (on top of the entry point ofc), and the only place where associations between format and file should be made. This requires adding some JS loading mechanism to the Spark lib if it does not exist already.

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil.
--

Benedikt Kämpgen

unread,
Aug 31, 2011, 5:12:59 PM8/31/11
to Jeroen De Dauw, rdf-...@googlegroups.com
Hi Jeroen,

Thanks for your answer:

> Feel free to commit.
>
> One remark on this code that I have is that you should not make a bunch of
> resource loader modules with some base files and then one special file.
Put
> the base files in a base module and add that one as dependency for the
others.

This was not intended. Each module should be loading only what it needs and
dependencies should be considered.


> In general I think it's a bad idea to have to care about what JS files to
load
> at this place though. If the MediaWiki extension goes associate formats
with
> files, and the Spark lib changes, stuff will break. The Spark lib is the
only
> thing that should care about what files should be loaded (on top of the
entry
> point ofc), and the only place where associations between format and file
> should be made. This requires adding some JS loading mechanism to the
Spark
> lib if it does not exist already.

You are right. However, I haven't seen such a mechanism. Does anyone have a
better way to do this, for now?

Regards,

Benedikt


--
AIFB, Karlsruhe Institute of Technology (KIT)
Phone: +49 721 608-47946
Email: benedikt...@kit.edu
Web: http://www.aifb.kit.edu/web/Hauptseite/en

Reply all
Reply to author
Forward
0 new messages