Using SMWParseData::storeData at the end of my parserhook solves the problem with the data that I generate, but now any other semantic data contained in the rest of the article is discarded... I guess it's because of what the documentation for storeData says, that the parsing is assumed to be complete.
So this is not the fix for my problem :( Stefan > -----Original Message----- > From: zehetner [mailto:zehet...@molgen.mpg.de] > Sent: Monday, November 01, 2010 10:24 AM > To: Harwarth, Stefan (Bundeswehr) > Cc: semediawiki-devel@lists.sourceforge.net > Subject: Re: [SMW-devel] Problem with storing semantic > attributes in a parserhook > > I use > SMWParseData::addProperty( $property, $prop_val, false, > $wgParser, true ); > SMWParseData::storeData( $wgParser->getOutput(), $title, > false ); which seems to work so far ok to store properties > generated within an extension (although it might not be the > correct or official way to do it) $property is a string with > the property name, $prop_value the value of the property (in > case of multi-valued properties a string like e.g. > 'p1;p2;;p3') and $title a title object. > > Cheers, > Gu > > On Fri, 29 Oct 2010 16:21:03 +0200, "Harwarth, Stefan (Bundeswehr)" > <stefan.harwa...@cassidian.com> wrote: > > Hi, > > > > I'm working on an Mediawiki extension that uses the > > SMWData::addProperty function to store semantic data inside > a parser > > hook function, which is working perfectly when saving a > page. But when > > I use the ApprovedRevs extension to approve the revision of an > > article, my semantic data isn't stored, even though the call to > > addProperty is executed and a valid DataValue object is returned. > > > > For debugging reasons I added regular semantic markup, so > that my page > > looks like the following: > > [[Property1::Value1]] > > {{#set:Property2=Value2}} > > <mystuff>Some text</mystuff> > > The first two property values are stored when I approve a > revision of > > this article and my parserhook is called, only that the properties > > that I create via addProperty() don't appear in the factbox and in > > queries :( > > > > Do I need to call any other functions besides addProperty? I tried > > SMWOuputs::commitToParser, but that didn't help.. > > > > Regards, > > Stefan > ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel