SMWPrintRequest Class Reference
[SMWQuery]

Container class for request for printout, as used in queries to obtain additional information for the retrieved results. More...

List of all members.

Public Member Functions

 __construct ($mode, $label, $data=null, $outputformat=false, $params=null)
 Create a print request.
 getMode ()
 getLabel ()
 getHTMLText ($linker=null)
 Obtain an HTML-formatted representation of the label.
 getWikiText ($linked=false)
 Obtain a Wiki-formatted representation of the label.
 getText ($outputmode, $linker=null)
 Convenience method for accessing the text in either HTML or Wiki format.
 getData ()
 Return additional data related to the print request.
 getOutputFormat ()
 getTypeID ()
 If this print request refers to some property, return the type id of this property.
 getHash ()
 Return a hash string that is used to eliminate duplicate print requests.
 getSerialisation ($showparams=false)
 Serialise this object like print requests given in #ask.
 getParameter ($key)
 Returns the value of a named parameter.
 getParameters ()
 Returns the array of parameters, where a string is mapped to a string.
 setParameter ($key, $value)
 Sets a print request parameter.

Public Attributes

const PRINT_CATS = 0
 Query mode to print all direct categories of the current element.
const PRINT_PROP = 1
 Query mode to print all property values of a certain attribute of the current element.
const PRINT_THIS = 2
 Query mode to print the current element (page in result set).
const PRINT_CCAT = 3
 Query mode to print whether current element is in given category (Boolean printout).

Protected Attributes

 $m_mode
 $m_label
 $m_data
 $m_typeid = false
 $m_outputformat
 $m_hash = false
 $m_params = array()


Detailed Description

Container class for request for printout, as used in queries to obtain additional information for the retrieved results.

Definition at line 18 of file SMW_PrintRequest.php.


Constructor & Destructor Documentation

SMWPrintRequest::__construct ( mode,
label,
data = null,
outputformat = false,
params = null 
)

Create a print request.

Parameters:
$mode a constant defining what to printout
$label the string label to describe this printout
$data optional data for specifying some request, might be a property object, title, or something else; interpretation depends on $mode
$outputformat optional string for specifying an output format, e.g. an output unit
$params optional array of further, named parameters for the print request

Definition at line 45 of file SMW_PrintRequest.php.


Member Function Documentation

SMWPrintRequest::getMode (  ) 

Definition at line 72 of file SMW_PrintRequest.php.

SMWPrintRequest::getLabel (  ) 

Definition at line 76 of file SMW_PrintRequest.php.

SMWPrintRequest::getHTMLText ( linker = null  ) 

Obtain an HTML-formatted representation of the label.

The $linker is a Linker object used for generating hyperlinks. If it is NULL, no links will be created.

Definition at line 85 of file SMW_PrintRequest.php.

Referenced by getText(), and SMQueryHandler::handleResultProperty().

SMWPrintRequest::getWikiText ( linked = false  ) 

Obtain a Wiki-formatted representation of the label.

Definition at line 104 of file SMW_PrintRequest.php.

Referenced by getText().

SMWPrintRequest::getText ( outputmode,
linker = null 
)

Convenience method for accessing the text in either HTML or Wiki format.

Definition at line 124 of file SMW_PrintRequest.php.

References getHTMLText(), and getWikiText().

Referenced by SRFTimeline::handlePropertyValue().

SMWPrintRequest::getData (  ) 

Return additional data related to the print request.

The result might be an object of class SMWPropertyValue or Title, or simply NULL if no data is required for the given type of printout.

Definition at line 136 of file SMW_PrintRequest.php.

SMWPrintRequest::getOutputFormat (  ) 

Definition at line 140 of file SMW_PrintRequest.php.

SMWPrintRequest::getTypeID (  ) 

If this print request refers to some property, return the type id of this property.

Otherwise return '_wpg' since all other types of print request return wiki pages.

Returns:
string

Definition at line 150 of file SMW_PrintRequest.php.

SMWPrintRequest::getHash (  ) 

Return a hash string that is used to eliminate duplicate print requests.

The hash also includes the chosen label, so it is possible to print the same date with different labels.

Returns:
string

Definition at line 170 of file SMW_PrintRequest.php.

SMWPrintRequest::getSerialisation ( showparams = false  ) 

Serialise this object like print requests given in #ask.

Parameters:
$params boolean that sets if the serialization should include the extra print request parameters

Definition at line 191 of file SMW_PrintRequest.php.

SMWPrintRequest::getParameter ( key  ) 

Returns the value of a named parameter.

Parameters:
$key string the name of the parameter key
Returns:
string Value of the paramer, if set (else FALSE)

Definition at line 250 of file SMW_PrintRequest.php.

SMWPrintRequest::getParameters (  ) 

Returns the array of parameters, where a string is mapped to a string.

Returns:
array Map of parameter names to values.

Definition at line 259 of file SMW_PrintRequest.php.

SMWPrintRequest::setParameter ( key,
value 
)

Sets a print request parameter.

Parameters:
$key string Name of the parameter
$value string Value for the parameter

Definition at line 269 of file SMW_PrintRequest.php.


Member Data Documentation

Query mode to print all direct categories of the current element.

Definition at line 21 of file SMW_PrintRequest.php.

Referenced by SMWQueryUI::getPoSortFormBox(), SMWRDFResultPrinter::getResultText(), SMWResultArray::loadContent(), and SMWQueryProcessor::processFunctionParams().

Query mode to print whether current element is in given category (Boolean printout).

Definition at line 27 of file SMW_PrintRequest.php.

Referenced by SMWQueryUI::getPoSortFormBox(), SMWRDFResultPrinter::getResultText(), SMWResultArray::loadContent(), and SMWQueryProcessor::processFunctionParams().

SMWPrintRequest::$m_mode [protected]

Definition at line 29 of file SMW_PrintRequest.php.

SMWPrintRequest::$m_label [protected]

Definition at line 30 of file SMW_PrintRequest.php.

SMWPrintRequest::$m_data [protected]

Definition at line 31 of file SMW_PrintRequest.php.

SMWPrintRequest::$m_typeid = false [protected]

Definition at line 32 of file SMW_PrintRequest.php.

SMWPrintRequest::$m_outputformat [protected]

Definition at line 33 of file SMW_PrintRequest.php.

SMWPrintRequest::$m_hash = false [protected]

Definition at line 34 of file SMW_PrintRequest.php.

SMWPrintRequest::$m_params = array() [protected]

Definition at line 35 of file SMW_PrintRequest.php.


The documentation for this class was generated from the following file:

Generated on Sun Mar 18 07:15:43 2012 for Semantic MediaWiki by  doxygen 1.5.6