The alternative would be to just store the table back to the page and
pull it out and reparse it. That would probably be cleaner from the
MW pov. But the reason I built this is to be able to query the table
contents in a structured way, which I think is easier with the
external db, at least with my limited skills. This is sort of in the
spirit of semantic mediawiki, but without asking users to learn even
more markup. The external db is part of a larger plan to mine the
table content asynchronously with a separate tool I'm working on
now. The hope is to make MW into a tool where specific pages with
specific tables act as user interfaces for updating genome annotation
databases. I'm trying to force the unstructured text of a wiki into
a structured system without having to do natural language processing.
You are correct about the fraught with peril part... diving into
perilous waters is mostly based on lack of foresight on my part! I
just hadn't been thinking about the dump/reload issue because I
haven't done it much for my own wiki.
It probably would be good to reflect some of this discussion to the
mediawiki page, but there are also benefits to posting to the list if
others don't mind. Increases the chance that someone not thinking
about TableEdit (like you) will join the fray.
Jim
On Apr 12, 2007, at 9:29 AM, Dave Sigafoos wrote:
Jim,
Great hack. I just saw this and it is a very nice move towards
"inline
editing" of a page.
I am new to MW so please excuse me if this is a stupid question,
but why
are you storing data external to the page? It seems to me that this
would be fraught with peril.
We could discuss this on your discussion page if you would like.
THanks
DSig
David Tod Sigafoos | SANMAR Corporation
-----Original Message-----
From: mediawiki-l-bounces(a)lists.wikimedia.org
[mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Jim Hu
Sent: Wednesday, April 11, 2007 21:14
To: MediaWiki announcements and site admin list
Subject: Re: [Mediawiki-l] TableEdit version 0.2
As I get ready for version 0.3, I realized that there is a
potentially serious problem for users of my TableEdit extension (hey,
I did mark it as experimental!!). The problem is related to
exporting and importing dumps.
While tables will be preserved when importing a dump from a wiki that
uses TableEdit, when a user tries to click on the Edit link, bad
things are likely to happen. In the best case, the recipient wiki
will not have TableEdit installed and there will just be a 404
error. If TableEdit is installed, the most likely outcome is that
the box_id and pagename will not match what is stored in the database
and TableEdit will refuse to do the edit on the imported page.
This is because TableEdit stores box and row information in an
external database and marks the position of the table in each page
with comments <!--box id=N--> where N is the primary key in the box
table of the wikibox_db external database. The box table also stores
the page_title and namespace, and checks that the page sending the
edit request is the original home of the box. Hmm...on reflection
this means that moving the page will break it too. I think I can fix
that by following redirects and revising the database on the next
save. But the imported page problem has me stumped.
Suggestions for how to solve this are welcomed!
Jim
On Apr 6, 2007, at 4:29 PM, Jim Hu wrote:
Version 0.2 (still experimental!!) of my Table
Editing extension is
now available
http://www.mediawiki.org/wiki/Extension:TableEdit
For those who missed 0.1, TableEdit lets you put a tag in a wiki
page, which is saved as a "Create Table Here" link to a Special page,
where the user can use forms to build a table without worrying about
wiki markup. The tables that are put back in the wiki page have an
Edit link that allows you to load the table back into the Special
page for further editing.
Changes:
* Now uses $_SESSION for persistence prior to saving to the database
instead of cluttering the page itself with serialized data.
* Schema change to support edit conflict handling
* Rudimentary edit conflict handling
* Now allows you to rotate the table to switch headings to be either
on top or on the left.
* You can start with a table in either orientation by using
<newTableEdit/> for headings on top or <newVTableEdit/> for headings
on the side.
* Various bug fixes...more probably introduced in the process.
Works for me on MW 1.83 and MW 1.93 on MacOSX with the entropy (Marc
Liyanage) php5.1.2 and MySQL 4.026 or MySQL 5.0.24-standard.
Presumably works on other setups.
=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054