Info
Status: | effective |
Progress: | 100% |
English
This document contains details about event handlers (also known as Hooks) provided by Semantic MediaWiki to enable users to extent and integrate custom specific solutions.
Available hooks
Implementing a hook should be made in consideration of the expected performance impact for the front-end (additional DB read/write transactions etc.) and/or the back-end (prolonged job backlog etc.) process.
Setup and registry
SMW::DataType::initTypes
to add additional DataType supportSMW::Property::initProperties
to add additional predefined propertiesSMW::Constraint::initConstraints
to add custom constraintsSMW::GetPreferences
to add extra preferences that are ordered on the Semantic MediaWiki user preference tabSMW::Setup::AfterInitializationComplete
to modify global configuration after initialization of Semantic MediaWiki is completedSMW::Settings::BeforeInitializationComplete
to modify the Semantic MediaWiki configuration before the initialization is completedSMW::GroupPermissions::BeforeInitializationComplete
to modify the Semantic MediaWiki permissions before the initialization is completedSMW::Event::RegisterEventListeners
to register additional event listenersSMW::Listener::ChangeListener::RegisterPropertyChangeListeners
allows to register and listen to individual property changesSMW::Schema::RegisterSchemaTypes
allows to register additional schema types
Store
SMW::SQLStore::BeforeDeleteSubjectComplete
is called before the deletion of a subject is completedSMW::SQLStore::AfterDeleteSubjectComplete
is called after the deletion of a subject is completedSMW::SQLStore::BeforeChangeTitleComplete
is called before change to a subject is completedSMW::SQLStore::BeforeDataRebuildJobInserts
to add update jobs while running the rebuild processSMW::SQLStore::BeforeDataUpdateComplete
to extend theSemanticData
object before the update is completedSMW::SQLStore::AfterDataUpdateComplete
to process information after an update has been completedSMW::Store::BeforeDataUpdateComplete
to extend theSemanticData
object before the update is completedSMW::Store::AfterDataUpdateComplete
to process information after an update has been completed
Property tables
SMW::SQLStore::AddCustomFixedPropertyTables
to add fixed property table definitionsSMW::SQLStore::updatePropertyTableDefinitions
to add additional table definitions during initializationSMW::SQLStore::EntityReferenceCleanUpComplete
to process information about an entity where the clean-up has been finalized
Installer
SMW::SQLStore::Installer::BeforeCreateTablesComplete
to add additional table indicesSMW::SQLStore::Installer::AfterCreateTablesComplete
to add extra tables after the creation process as been finalizedSMW::SQLStore::Installer::AfterDropTablesComplete
to remove extra tables after the drop process as been finalized
Query
SMW::Store::BeforeQueryResultLookupComplete
to return aQueryResult
object before the standard selection process is started and allows to suppress the standard selection process completely by returningfalse
SMW::Store::AfterQueryResultLookupComplete
to manipulate aQueryResult
after the selection process
Parser, annotations, and revision
SMW::Parser::BeforeMagicWordsFinder
to extend the magic words list that theInTextAnnotationParser
should inspect on a given text sectionSMW::Parser::AfterLinksProcessingComplete
to add additional annotation parsing afterInTextAnnotationParser
has finished the processing of standard annotation links (e.g.[[...::...]]
)SMW::Parser::ParserAfterTidyPropertyAnnotationComplete
allows to add additionalPropertyAnnotator
as part of theParserAfterTidy
after default annotators have been executedSMW::FileUpload::BeforeUpdate
to add extra annotations on aFileUpload
event before theStore
update is triggeredSMW::RevisionGuard::ChangeRevision
to forcibly change a revision used during content parsingSMW::RevisionGuard::ChangeRevisionID
to forcibly change the revision ID as in case of theFactbox
when building the content.SMW::RevisionGuard::IsApprovedRevision
to define whether a revision is approved or needs to be suppressed.SMW::RevisionGuard::ChangeFile
to forcibly change the file version used
Miscellaneous
SMW::Factbox::BeforeContentGeneration
to replace or amend text elements shown in a FactboxSMW::Browse::AfterIncomingPropertiesLookupComplete
to extend the incoming properties display forSpecial:Browse
SMW::Browse::BeforeIncomingPropertyValuesFurtherLinkCreate
to replace the standardSearchByProperty
with a custom link inSpecial:Browse
to an extended list of results (returnfalse
to replace the link)SMW::Browse::AfterDataLookupComplete
to extend the HTML with data displayed onSpecial:Browse
SMW::Admin::RegisterTaskHandlers
to extend availableTaskHandler
used in theSpecial:SemanticMediaWiki
dashboardSMW::ResultFormat::OverrideDefaultFormat
to override the default result format handlingSMW::Job::AfterUpdateDispatcherJobComplete
to add additional update jobs for a property and related subjectsSMW::Exporter::Controller::AddExpData
to add additional RDF data for a selected subjectSMW::Maintenance::AfterUpdateEntityCollationComplete
runs after theupdateEntityCollection.php
script has finished processing the update of entity collation changes
Deprecated hooks
smwInitDatatypes
(since 1.9)smwInitProperties
(since 2.1)smwShowFactbox
(since 2.1)smwRefreshDataJobs
(since 2.3)smwUpdatePropertySubjects
(since 1.9)smwAddToRDFExport
(since 3.0)SMWSQLStore3::updateDataBefore
(since 3.1)SMWSQLStore3::updateDataAfter
(since 2.3)SMWStore::updateDataBefore
(since 3.1)SMWStore::updateDataAfter
(since 3.1)SMWResultFormat
(since 3.1)
See also[edit]
|
|