Index: trunk/extensions/SemanticMediaWiki/RELEASE-NOTES |
— | — | @@ -23,6 +23,7 @@ |
24 | 24 | for the selected format's parameters, and to use Ajax where possible |
25 | 25 | * To that end, each format's query printer now includes a getParameters() |
26 | 26 | function that supplies the name and attributes of each the format's parameters |
| 27 | +* "before" and "after" hooks for updateData and deleteSubject were added. |
27 | 28 | |
28 | 29 | == SMW 1.4.3 == |
29 | 30 | |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -585,6 +585,7 @@ |
586 | 586 | |
587 | 587 | public function deleteSubject(Title $subject) { |
588 | 588 | wfProfileIn('SMWSQLStore2::deleteSubject (SMW)'); |
| 589 | + wfRunHooks( 'SMWSQLStore2::deleteSubjectBefore', array( $this, $subject ) ); |
589 | 590 | $this->deleteSemanticData(SMWWikiPageValue::makePageFromTitle($subject)); |
590 | 591 | $this->updateRedirects($subject->getDBkey(), $subject->getNamespace()); // also delete redirects, may trigger update jobs! |
591 | 592 | if ($subject->getNamespace() == SMW_NS_CONCEPT) { // make sure to clear caches |
— | — | @@ -597,11 +598,13 @@ |
598 | 599 | ///TODO: who is responsible for these updates? Some update jobs are currently created in SMW_Hooks, some internally in the store |
599 | 600 | ///TODO: Possibly delete ID here (at least for non-properties/categories, if not used in any place in rels2) |
600 | 601 | ///FIXME: clean internal caches here |
| 602 | + wfRunHooks( 'SMWSQLStore2::deleteSubjectAfter', array( $this, $subject ) ); |
601 | 603 | wfProfileOut('SMWSQLStore2::deleteSubject (SMW)'); |
602 | 604 | } |
603 | 605 | |
604 | 606 | public function updateData(SMWSemanticData $data) { |
605 | 607 | wfProfileIn("SMWSQLStore2::updateData (SMW)"); |
| 608 | + wfRunHooks( 'SMWSQLStore2::updateDataBefore', array( $this, $data ) ); |
606 | 609 | $subject = $data->getSubject(); |
607 | 610 | $this->deleteSemanticData($subject); |
608 | 611 | $redirects = $data->getPropertyValues(SMWPropertyValue::makeProperty('_REDI')); |
— | — | @@ -662,6 +665,7 @@ |
663 | 666 | // Finally update caches (may be important if jobs are directly following this call) |
664 | 667 | $this->m_semdata[$sid] = clone $data; |
665 | 668 | $this->m_sdstate[$sid] = array_keys(SMWSQLStore2::getPropertyTables()); // everything that one can know |
| 669 | + wfRunHooks( 'SMWSQLStore2::updateDataAfter', array( $this, $data ) ); |
666 | 670 | wfProfileOut("SMWSQLStore2::updateData (SMW)"); |
667 | 671 | } |
668 | 672 | |
Index: trunk/extensions/SemanticMediaWiki/README |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | * Code has been contributed by (in no particular order) Kai Hüner, Fernando Correia, |
49 | 49 | Yaron Koren, Nick Grandy, Jörg Heizmann, Daniel Herzig, Nikolas Iwan, Tobias Matzner, |
50 | 50 | Thomas Bleher, Felix Kratzer, Frank Dengler, Nathan R. Yergler, Daniel Friesen, |
51 | | - Fabian Howahl, Jie Bao, Marcel Gsteiger |
| 51 | + Fabian Howahl, Jie Bao, Marcel Gsteiger, Roi Avinoam |
52 | 52 | |
53 | 53 | * The new logo and related artwork for Semantic MediaWiki (see semanticweb.org) |
54 | 54 | has been designed and realised by Rozana Vrandecic. |