On Samstag, 19. Januar 2008, Petr Andreyev wrote: > Hi! > > I would like to add a new tab based on semantic properties of the page (I > am doing this from my own extension). The question is what's the best way > to do it? > The problem gets more complicated for an older revision of a page. > > As I can see from the SemanticMediawiki database structure only the > properties of the last revision are stored in the DB. > > What are other ways to access properties? > > The Factbox class does the scan of all properties for the currently > displayed page (any revision), so in principle this could be done by means > of some hacking. > But may be there are some decent ways to do it? > > So once again, I want to do something (display or not display an extra tab) > on the page for older revision of articles based on semantic properties of > that older revision. > How can I access those properties for the older revision from my extension > (from a hook function)? > > Any hint will be greatly appreciated!
During parsing, SMW will store all semantic data contained in an articles text (whether revision or current) within the SMWFactbox::$semdata which is an object of class SMWSemanticData. You could access that object *after parsing* to extract data directly. I do not see another way of solving that. Some problems may still occur, since SMW depends on non-local data (e.g. datatypes of properties) that will influence parsing, but that is not versioned. I think MW has some similar issues with old revisions using current versions of templates. Regards, Markus > > Thanks! > Petr -- Markus Krötzsch Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe phone +49 (0)721 608 7362 fax +49 (0)721 608 5998 [EMAIL PROTECTED] www http://korrekt.org
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ Semediawiki-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
