Static Public Member Functions | |
| static | stripMagicWords (&$text, Parser $parser) |
| Remove relevant SMW magic words from the given text and return an array of the names of all discovered magic words. | |
| static | getSMWdata ($parser) |
| This function retrieves the SMW data from a given parser, and creates a new empty container if it is not initiated yet. | |
| static | clearStorage (Parser $parser) |
| Clear all stored data for a given parser. | |
| static | addProperty ($propertyName, $value, $caption, Parser $parser, $storeAnnotation=true) |
| This method adds a new property with the given value to the storage. | |
| static | storeData ($parseroutput, Title $title, $makejobs=true) |
| This function takes care of storing the collected semantic data and takes care of clearing out any outdated entries for the processed page. | |
| static | equalDatavalues ($dv1, $dv2) |
| Helper function that compares two arrays of data values to check whether they contain the same content. | |
| static | onParserAfterTidy (&$parser, &$text) |
| Hook function fetches category information and other final settings from parser output, so that they are also replicated in SMW for more efficient querying. | |
| static | onNewRevisionFromEditComplete ($article, Revision $rev, $baseID, User $user) |
| Fetch additional information that is related to the saving that has just happened, e.g. | |
| static | onLinksUpdateConstructed ($links_update) |
| Hook where the storage of data is triggered. | |
| static | onArticleDelete (&$article, &$user, &$reason) |
| This method will be called whenever an article is deleted so that semantic properties are cleared appropriately. | |
| static | onTitleMoveComplete (&$old_title, &$new_title, &$user, $pageid, $redirid) |
| This method will be called whenever an article is moved so that semantic properties are moved accordingly. | |
Static Protected Member Functions | |
| static | getDataItemFromMWTimestamp ($timestamp) |
| Create an SMWDITime object from a MediaWiki timestamp. | |
All methods in this class are stateless: data is stored persistently only in a given parser output.
Definition at line 21 of file SMW_ParseData.php.
| static SMWParseData::stripMagicWords | ( | &$ | text, | |
| Parser $ | parser | |||
| ) | [static] |
Remove relevant SMW magic words from the given text and return an array of the names of all discovered magic words.
Moreover, store this array in the current parser output, using the variable mSMWMagicWords.
Definition at line 29 of file SMW_ParseData.php.
Referenced by SMWParserExtensions::onInternalParseBeforeLinks().
| static SMWParseData::getSMWdata | ( | $ | parser | ) | [static] |
This function retrieves the SMW data from a given parser, and creates a new empty container if it is not initiated yet.
Definition at line 55 of file SMW_ParseData.php.
Referenced by SMWConcept::render().
| static SMWParseData::clearStorage | ( | Parser $ | parser | ) | [static] |
Clear all stored data for a given parser.
| Parser | $parser |
Definition at line 77 of file SMW_ParseData.php.
| static SMWParseData::addProperty | ( | $ | propertyName, | |
| $ | value, | |||
| $ | caption, | |||
| Parser $ | parser, | |||
| $ | storeAnnotation = true | |||
| ) | [static] |
This method adds a new property with the given value to the storage.
It is intended to be used on user input, and property and value are sepcified by strings as they might be found in a wiki. The function returns a datavalue object that contains the result of the operation.
| string | $propertyName | |
| string | $value | |
| mixed | $caption string or false | |
| Parser | $parser | |
| boolean | $storeAnnotation |
Definition at line 102 of file SMW_ParseData.php.
References SMWPropertyValue::makeUserProperty(), and SMWDataValueFactory::newPropertyObjectValue().
Referenced by SMWParserExtensions::parsePropertiesCallback(), SMWSetRecurringEvent::render(), SMWSet::render(), and SMWDeclare::render().
| static SMWParseData::storeData | ( | $ | parseroutput, | |
| Title $ | title, | |||
| $ | makejobs = true | |||
| ) | [static] |
This function takes care of storing the collected semantic data and takes care of clearing out any outdated entries for the processed page.
It assume that parsing has happened and that all relevant data is contained in the provided parser output.
Optionally, this function also takes care of triggering indirect updates that might be needed for overall database consistency. If the saved page describes a property or data type, the method checks whether the property type, the data type, the allowed values, or the conversion factors have changed. If so, it triggers SMWUpdateJobs for the relevant articles, which then asynchronously update the semantic data in the database.
| $parseroutput | ParserOutput object that contains the results of parsing which will be stored. | |
| $title | Title object specifying the page that should be saved. | |
| $makejobs | Bool stating whether jobs should be created to trigger further updates if this appears to be necessary after this update. |
FIXME: this will kill large wikis! Use incremental updates!
NOTE: this only happens if $smwgEnableUpdateJobs was true above
Definition at line 167 of file SMW_ParseData.php.
References $smwgDeclarationProperties, $smwgEnableUpdateJobs, $smwgPageSpecialProperties, $store, SMWDIWikiPage::newFromTitle(), SMWDataValueFactory::newTypeIdValue(), smwfGetStore(), and smwfIsSemanticsProcessed().
Referenced by SMWUpdateJob::run().
| static SMWParseData::equalDatavalues | ( | $ | dv1, | |
| $ | dv2 | |||
| ) | [static] |
Helper function that compares two arrays of data values to check whether they contain the same content.
Returns true if the two arrays contain the same data values (irrespective of their order), false otherwise.
Definition at line 342 of file SMW_ParseData.php.
| static SMWParseData::onParserAfterTidy | ( | &$ | parser, | |
| &$ | text | |||
| ) | [static] |
Hook function fetches category information and other final settings from parser output, so that they are also replicated in SMW for more efficient querying.
Definition at line 370 of file SMW_ParseData.php.
References $smwgCategoriesAsInstances, and $smwgUseCategoryHierarchy.
| static SMWParseData::onNewRevisionFromEditComplete | ( | $ | article, | |
| Revision $ | rev, | |||
| $ | baseID, | |||
| User $ | user | |||
| ) | [static] |
Fetch additional information that is related to the saving that has just happened, e.g.
regarding the last edit date. In runs where this hook is not triggered, the last DB entry (of MW) will be used to fill such properties.
| WikiPage|Article | $article WikiPage on 1.19 and later | |
| Revision | $rev | |
| integer | $baseID | |
| User | $user |
Definition at line 424 of file SMW_ParseData.php.
References $smwgPageSpecialProperties, and SMWDIWikiPage::newFromTitle().
| static SMWParseData::onLinksUpdateConstructed | ( | $ | links_update | ) | [static] |
Hook where the storage of data is triggered.
This happens when saving an article but possibly also when running update jobs.
Definition at line 474 of file SMW_ParseData.php.
| static SMWParseData::onArticleDelete | ( | &$ | article, | |
| &$ | user, | |||
| &$ | reason | |||
| ) | [static] |
This method will be called whenever an article is deleted so that semantic properties are cleared appropriately.
Definition at line 483 of file SMW_ParseData.php.
References smwfGetStore().
| static SMWParseData::onTitleMoveComplete | ( | &$ | old_title, | |
| &$ | new_title, | |||
| &$ | user, | |||
| $ | pageid, | |||
| $ | redirid | |||
| ) | [static] |
This method will be called whenever an article is moved so that semantic properties are moved accordingly.
Definition at line 492 of file SMW_ParseData.php.
References smwfGetStore().
| static SMWParseData::getDataItemFromMWTimestamp | ( | $ | timestamp | ) | [static, protected] |
Create an SMWDITime object from a MediaWiki timestamp.
A timestamp is a 14 character string YYYYMMDDhhmmss.
| $timestamp | string MediaWiki timestamp |
Definition at line 504 of file SMW_ParseData.php.
References SMWDITime::CM_GREGORIAN.
1.5.6