rehamaltamimi / gwtwiki

Automatically exported from code.google.com/p/gwtwiki
0 stars 0 forks source link

Template Convert #107

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Using your Dump2HTMLCreatorExample class I converted a part of the XML dump 
in bz2 format (enwiki-latest-pages-articles1.xml-p000000010p000010000.bz2)
2.Most of the convertions are good but fails converting this kind of wiki 
format  template {{convert|4810|m|ft|abbr=on|0}} 

What is the expected output? What do you see instead?
The expected output is 4,810 m (15,781 ft). Instead I see {{convert}}

What version of the product are you using? On what operating system?
3.0.18 on Ubuntu 12.04

Please provide any additional information below.
An example is in the Alps wikipedia page (http://en.wikipedia.org/wiki/Alps), 
in the table "The 22 Alpine four-thousanders with at least 500 metres of 
topographic prominence".
Table code in wikipedia format:
{| class="wikitable" style="margin: 1em auto 1em auto;"
|+ The 22 Alpine four-thousanders with at least 500 metres of topographic 
prominence
! align=left | Name
! align=left | Height
! align=left | Range
! align=left | Name
! align=left | Height
! align=left | Range
|-
| [[Mont Blanc]] 
| {{convert|4810|m|ft|abbr=on|0}} 
| [[Graian Alps]]
| [[Dent d'Hérens]] 
| {{convert|4171|m|ft|abbr=on|0}} 
| [[Pennine Alps]]
|-
| [[Monte Rosa]] 
| {{convert|4634|m|ft|abbr=on|0}} 
| [[Pennine Alps]]
| [[Jungfrau]] 
| {{convert|4158|m|ft|abbr=on|0}} 
| [[Bernese Alps]]
|-
| [[Dom (Mischabel)|Dom]] 
| {{convert|4545|m|ft|abbr=on|0}} 
| [[Pennine Alps]]
| [[Aiguille Verte]] 
| {{convert|4122|m|ft|abbr=on|0}} 
| [[Graian Alps]]
|-
| [[Weisshorn]] 
| {{convert|4506|m|ft|abbr=on|0}} 
| [[Pennine Alps]]
| [[Mönch]] 
| {{convert|4107|m|ft|abbr=on|0}} 
| [[Bernese Alps]]
|-
| [[Matterhorn]] 
| {{convert|4478|m|ft|abbr=on|0}} 
| [[Pennine Alps]]
| [[Barre des Écrins]] 
| {{convert|4102|m|ft|abbr=on|0}} 
| [[Dauphiné Alps]]
|-
| [[Dent Blanche]] 
| {{convert|4357|m|ft|abbr=on|0}} 
| [[Pennine Alps]]
| [[Schreckhorn]] 
| {{convert|4078|m|ft|abbr=on|0}} 
| [[Bernese Alps]]
|-
| [[Grand Combin]] 
| {{convert|4314|m|ft|abbr=on|0}} 
| [[Pennine Alps]]
| [[Ober Gabelhorn]] 
| {{convert|4063|m|ft|abbr=on|0}} 
| [[Pennine Alps]]
|-
| [[Finsteraarhorn]] 
| {{convert|4273|m|ft|abbr=on|0}} 
| [[Bernese Alps]]
| [[Gran Paradiso]] 
| {{convert|4061|m|ft|abbr=on|0}} 
| [[Graian Alps]]
|-
| [[Grandes Jorasses]] 
| {{convert|4208|m|ft|abbr=on|0}} 
| [[Graian Alps]]
| [[Piz Bernina]] 
| {{convert|4049|m|ft|abbr=on|0}} 
| [[Bernina Range]]
|-
| [[Rimpfischhorn]] 
| {{convert|4199|m|ft|abbr=on|0}} 
| [[Pennine Alps]]
| [[Weissmies]] 
| {{convert|4017|m|ft|abbr=on|0}} 
| [[Pennine Alps]]
|-
| [[Aletschhorn]] 
| {{convert|4193|m|ft|abbr=on|0}} 
| [[Bernese Alps]]
| [[Lagginhorn]] 
| {{convert|4010|m|ft|abbr=on|0}} 
| [[Pennine Alps]]
|}

Attached the HTML output file for Alps.

Original issue reported on code.google.com by emir.mu...@gmail.com on 24 Jul 2012 at 11:36

Attachments:

GoogleCodeExporter commented 8 years ago
The DumpWikiModel#getRawWikiContent() method probably could not find the 
"Template:Convert" in the Derby database?
Are you sure the Template:Convert is in the wiki database?
Did you skip the first pass in the Dump2HTMLCreatorExamplefor storing the 
templates in the Derby database?

Nethertheless the Convert template uses parser functions like formatnum, which 
are currently not completly implemented:
http://code.google.com/p/gwtwiki/source/browse/trunk/info.bliki.wiki/bliki-core/
src/main/java/info/bliki/wiki/template/Formatnum.java

See:
http://www.mediawiki.org/wiki/Help:Magic_words#Formatting

Original comment by axelclk@gmail.com on 25 Jul 2012 at 5:00

GoogleCodeExporter commented 8 years ago

Original comment by axelclk@gmail.com on 25 Jul 2012 at 5:00

GoogleCodeExporter commented 8 years ago
Hi,

In the transformation there were not error.
At the beginning I skip the first pass then I delete the database (folders), 
and I tried again without skip it (building the database again). So, I suppose 
all the templates was stored in the database.
I will check if overwriting that class I can solve my problem.

Thanks!

Original comment by emir.mu...@gmail.com on 25 Jul 2012 at 5:34

GoogleCodeExporter commented 8 years ago
r6059 improves the Formatnum.java but doesn't solve this issue.

Original comment by axelclk@gmail.com on 25 Jul 2012 at 7:02

GoogleCodeExporter commented 8 years ago
I just want to recover the original value, I don't mind the conversion. Which 
class handle that kind of convertions (i.e., the {{convertion}} template)?

Original comment by emir.mu...@gmail.com on 25 Jul 2012 at 8:27

GoogleCodeExporter commented 8 years ago
The AbstractWikiModel#substituteTemplateCall() method substitute the template 
name by the template content and given parameters.

Original comment by axelclk@gmail.com on 25 Jul 2012 at 9:15

GoogleCodeExporter commented 8 years ago
r6187 improves the #expr parser and avaluator for this issue

Original comment by axelclk@gmail.com on 27 Jul 2012 at 4:56

GoogleCodeExporter commented 8 years ago

Original comment by axelclk@gmail.com on 28 Jul 2012 at 8:24

GoogleCodeExporter commented 8 years ago
Committed r6252 improves the rendering of the convert template.

Original comment by axelclk@gmail.com on 2 Aug 2012 at 12:51

GoogleCodeExporter commented 8 years ago

Original comment by axelclk@gmail.com on 8 Aug 2012 at 1:01

GoogleCodeExporter commented 8 years ago
I marked this as Fixed. Please reopen if there are other issues with 
Template:Convert.

Original comment by axelclk@gmail.com on 8 Aug 2012 at 1:04

GoogleCodeExporter commented 8 years ago
Many thanks!. I will try the new version and see if it is working properly.

Original comment by emir.mu...@gmail.com on 8 Aug 2012 at 7:36