Semantic MediaWiki and related extensions
|
Public Member Functions | |
getResult (QueryResult $results, array $fullParams, $outputMode) | |
getQueryMode ( $context) | |
getName () | |
setShowErrors ( $show) | |
getParamDefinitions (array $definitions) | |
isExportFormat () | |
SMW\Query\ResultPrinter::getName | ( | ) |
Get a human readable label for this printer. The default is to return just the format identifier. Concrete implementations may refer to messages here. The format name is normally not used in wiki text but only in forms etc. hence the user language should be used when retrieving messages.
Implemented in SMW\Query\ResultPrinters\ResultPrinter, Maps\Map\SemanticFormat\MapPrinter, Maps\SemanticMW\KmlPrinter, SRF\Filtered\Filtered, SMW\Query\ResultPrinters\CategoryResultPrinter, ModernTimeline\ModernTimelinePrinter, SRF\BibTex\BibTexFileExportPrinter, SMW\Query\ResultPrinters\FeedExportPrinter, SMW\Query\ResultPrinters\TableResultPrinter, SMW\Query\ResultPrinters\EmbeddedResultPrinter, SMW\Query\ResultPrinters\ListResultPrinter, SMW\Query\ResultPrinters\TemplateFileExportPrinter, SMW\Query\ResultPrinters\JsonResultPrinter, SMW\Query\ResultPrinters\CsvFileExportPrinter, SMW\Query\ResultPrinters\RdfResultPrinter, SMW\Query\ResultPrinters\DsvResultPrinter, SRFListWidget, SMW\Query\ResultPrinters\NullResultPrinter, and SRFPageWidget.
SMW\Query\ResultPrinter::getParamDefinitions | ( | array | $definitions | ) |
Takes a list of parameter definitions and adds those supported by this result printer. Most result printers should override this method.
ParamDefinition[] | $definitions |
Implemented in SMW\Query\ResultPrinters\ResultPrinter, SRF\Filtered\Filtered, SMW\Query\ResultPrinters\ListResultPrinter, SMW\Query\ResultPrinters\FeedExportPrinter, SRFListWidget, Maps\SemanticMW\KmlPrinter, SRF\BibTex\BibTexFileExportPrinter, SRFPageWidget, SMW\Query\ResultPrinters\CategoryResultPrinter, SMW\Query\ResultPrinters\TemplateFileExportPrinter, SMW\Query\ResultPrinters\JsonResultPrinter, SMW\Query\ResultPrinters\DsvResultPrinter, SMW\Query\ResultPrinters\RdfResultPrinter, SMW\Query\ResultPrinters\CsvFileExportPrinter, SMW\Query\ResultPrinters\TableResultPrinter, SMW\Query\ResultPrinters\EmbeddedResultPrinter, ModernTimeline\ModernTimelinePrinter, and SMW\Query\ResultPrinters\AggregatablePrinter.
SMW\Query\ResultPrinter::getQueryMode | ( | $context | ) |
This function determines the query mode that is to be used for this printer in various contexts. The query mode influences how queries to that printer should be processed to obtain a result. Possible values are SMWQuery::MODE_INSTANCES (retrieve instances), SMWQuery::MODE_NONE (do nothing), SMWQuery::MODE_COUNT (get number of results), SMWQuery::MODE_DEBUG (return debugging text). Possible values for context are SMWQueryProcessor::SPECIAL_PAGE, SMWQueryProcessor::INLINE_QUERY, SMWQueryProcessor::CONCEPT_DESC.
The default implementation always returns SMWQuery::MODE_INSTANCES. File exports like RSS will use MODE_INSTANCES on special pages (so that instances are retrieved for the export) and MODE_NONE otherwise (displaying just a download link).
$context |
Implemented in SMW\Query\ResultPrinters\ResultPrinter, SMW\Query\ResultPrinters\FeedExportPrinter, ModernTimeline\ModernTimelinePrinter, and SMW\Query\ResultPrinters\FileExportPrinter.
|
final |
Main entry point: takes an QueryResult and parameters given as key-value-pairs in an array, and returns the serialised version of the results, formatted as HTML or Wiki or whatever is specified. Normally this is not overwritten by subclasses.
If the outputmode is SMW_OUTPUT_WIKI, then the function will return something that is suitable for being used in a MediaWiki parser function, i.e. a wikitext strong or an array with flags and the string as entry 0. See Parser::setFunctionHook() for documentation on this. In all other cases, the function returns just a string.
For outputs SMW_OUTPUT_WIKI and SMW_OUTPUT_HTML, error messages or standard "further results" links are directly generated and appended. For SMW_OUTPUT_FILE, only the plain generated text is returned.
$results | QueryResult |
$fullParams | array |
$outputMode | integer |
$results | QueryResult |
$fullParams | array |
$outputMode | integer |
SMW\Query\ResultPrinter::isExportFormat | ( | ) |
Returns if the format is an export format.
Implemented in SMW\Query\ResultPrinters\ResultPrinter, ModernTimeline\ModernTimelinePrinter, SMW\Query\ResultPrinters\FeedExportPrinter, and SMW\Query\ResultPrinters\FileExportPrinter.
SMW\Query\ResultPrinter::setShowErrors | ( | $show | ) |
Set whether errors should be shown. By default they are.
boolean | $show |
Implemented in SMW\Query\ResultPrinters\ResultPrinter, and ModernTimeline\ModernTimelinePrinter.