SRFiCalendar Class Reference
[SemanticResultFormats]

Printer class for creating iCalendar exports. More...

Inherits SMWResultPrinter.

List of all members.

Public Member Functions

 getMimeType ($res)
 Some printers do not mainly produce embeddable HTML or Wikitext, but produce stand-alone files.
 getFileName ($res)
 Some printers can produce not only embeddable HTML or Wikitext, but can also produce stand-alone files.
 getQueryMode ($context)
 This function determines the query mode that is to be used for this printer in various contexts.
 getName ()
 Get a human readable label for this printer.
 getParameters ()
 A function to describe the allowed parameters of a query using any specific format - most query printers should override this function.

Protected Member Functions

 handleParameters (array $params, $outputmode)
 Read an array of parameter values given as key-value-pairs and initialise internal member fields accordingly.
 getResultText (SMWQueryResult $res, $outputmode)
 Return serialised results in specified format.
 getIcal (SMWQueryResult $res)
 Returns the query result in iCal.
 getIcalLink (SMWQueryResult $res, $outputmode)
 Returns html for a link to a query that returns the iCal.
 getIcalForItem (array $row)
 Returns the iCal for a single item.

Protected Attributes

 $m_title
 $m_description

Static Private Member Functions

static parsedate (SMWTimeValue $dv, $isend=false)
 Extract a date string formatted for iCalendar from a SMWTimeValue object.


Detailed Description

Printer class for creating iCalendar exports.

Author:
Markus Krötzsch

Denny Vrandecic

Jeroen De Dauw

Definition at line 17 of file SRF_iCalendar.php.


Member Function Documentation

SRFiCalendar::handleParameters ( array $  params,
outputmode 
) [protected]

Read an array of parameter values given as key-value-pairs and initialise internal member fields accordingly.

Possibly overwritten (extended) by subclasses.

Since:
1.6
Parameters:
array $params
$outputmode 

Reimplemented from SMWResultPrinter.

Definition at line 22 of file SRF_iCalendar.php.

SRFiCalendar::getMimeType ( res  ) 

Some printers do not mainly produce embeddable HTML or Wikitext, but produce stand-alone files.

An example is RSS or iCalendar. This function returns the mimetype string that this file would have, or FALSE if no standalone files are produced.

If this function returns something other than FALSE, then the printer will not be regarded as a printer that displays in-line results. This is used to determine if a file output should be generated in Special:Ask.

Reimplemented from SMWResultPrinter.

Definition at line 29 of file SRF_iCalendar.php.

SRFiCalendar::getFileName ( res  ) 

Some printers can produce not only embeddable HTML or Wikitext, but can also produce stand-alone files.

An example is RSS or iCalendar. This function returns a filename that is to be sent to the caller in such a case (the default filename is created by browsers from the URL, and it is often not pretty).

See also SMWResultPrinter::getMimeType()

Reimplemented from SMWResultPrinter.

Definition at line 33 of file SRF_iCalendar.php.

SRFiCalendar::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).

Reimplemented from SMWResultPrinter.

Definition at line 41 of file SRF_iCalendar.php.

References SMWQuery::MODE_INSTANCES, SMWQuery::MODE_NONE, and SMWQueryProcessor::SPECIAL_PAGE.

SRFiCalendar::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.

Returns:
string

Reimplemented from SMWResultPrinter.

Definition at line 45 of file SRF_iCalendar.php.

SRFiCalendar::getResultText ( SMWQueryResult res,
outputmode 
) [protected]

Return serialised results in specified format.

Implemented by subclasses.

Reimplemented from SMWResultPrinter.

Definition at line 49 of file SRF_iCalendar.php.

References getIcal(), and getIcalLink().

SRFiCalendar::getIcal ( SMWQueryResult res  )  [protected]

Returns the query result in iCal.

Since:
1.5.2
Parameters:
SMWQueryResult $res
Returns:
string

Definition at line 62 of file SRF_iCalendar.php.

References getIcalForItem(), and SMWQueryResult::getNext().

Referenced by getResultText().

SRFiCalendar::getIcalLink ( SMWQueryResult res,
outputmode 
) [protected]

Returns html for a link to a query that returns the iCal.

Since:
1.5.2
Parameters:
SMWQueryResult $res
$outputmode 
Returns:
string

Definition at line 107 of file SRF_iCalendar.php.

References SMWQueryResult::getQueryLink(), and SMWResultPrinter::getSearchLabel().

Referenced by getResultText().

SRFiCalendar::getIcalForItem ( array $  row  )  [protected]

Returns the iCal for a single item.

Since:
1.5.2
Parameters:
array $row
Returns:
string

Definition at line 145 of file SRF_iCalendar.php.

References SMWResultPrinter::$params, SMWDataValueFactory::newDataItemValue(), and parsedate().

Referenced by getIcal().

static SRFiCalendar::parsedate ( SMWTimeValue dv,
isend = false 
) [static, private]

Extract a date string formatted for iCalendar from a SMWTimeValue object.

Definition at line 205 of file SRF_iCalendar.php.

References SMWTimeValue::getDay(), SMWTimeValue::getMonth(), and SMWTimeValue::getYear().

Referenced by getIcalForItem().

SRFiCalendar::getParameters (  ) 

A function to describe the allowed parameters of a query using any specific format - most query printers should override this function.

TODO: refactor non-printer params up to the query processor and do all param handling there.

Since:
1.5
Returns:
array of Parameter

Reimplemented from SMWResultPrinter.

Definition at line 229 of file SRF_iCalendar.php.

References SMWResultPrinter::$params, and SMWResultPrinter::exportFormatParameters().


Member Data Documentation

SRFiCalendar::$m_title [protected]

Definition at line 19 of file SRF_iCalendar.php.

SRFiCalendar::$m_description [protected]

Definition at line 20 of file SRF_iCalendar.php.


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

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