thank you very much, this already allows me to retrieve the “raw” csv data into the page. Is there a way to parse the data (in velocity ) into a xwiki table? I looked through the docs but could not find anything like this.
Or should I use groovy for this?
I think it would be simpler indeed if you used groovy, python or ruby for the parsing. We don’t offer any specific API for CSV parsing that you could use from velocity.
Hi,
so I made some progress.
I created a macro page (CsvMacro) with a groovy macro based on MacroClass and a parameter (csvUrl).
If I execute the macro from another page with a hardcoded url as parameter everything is fine.
But how can I “call” the macro with a “dynamic parameter”, e.g. csvUrl=$rootUrl/$filename?
Another option is to add support for Velocity code in the URL parameter, i.e. to parse the value of the URL macro parameter assuming that it contains Velocity. I prefer the first option though because it allows you to use any scripting language you want.
I use option one and it works great. Thanks. Using #set instead of #$set makes all the difference.
Still trying to get the hang of this “Velocity-stuff”…