SMWTypesValue Class Reference
[SMWDataValues]

This datavalue implements special processing suitable for defining types of properties. More...

Inherits SMWDataValue.

List of all members.

Public Member Functions

 getShortWikiText ($linker=null)
 Returns a short textual representation for this data value.
 getShortHTMLText ($linker=null)
 Returns a short textual representation for this data value.
 getLongWikiText ($linker=null)
 Return the long textual description of the value, as printed for example in the factbox.
 getLongHTMLText ($linker=null)
 Return the long textual description of the value, as printed for example in the factbox.
 getWikiValue ()
 Return the plain wiki version of the value, or FALSE if no such version is available.
 getHash ()
 Return a string that identifies the value of the object, and that can be used to compare different value objects.
 getDBkey ()
 This class uses type ids as DB keys.
 isBuiltIn ()
 Is this a built-in datatype shipped with SMW (or an extension of SMW)? (Alternatively it would be a user-defined derived datatype.
 isAlias ()
 Is this an alias for another datatype in SMW? This information is used to explain entries in Special:Types that are found since they have pages.

Static Public Member Functions

static newFromTypeId ($typeId)
static getTypeUriFromTypeId ($typeId)

Protected Member Functions

 parseUserValue ($value)
 Initialise the datavalue from the given value string.
 loadDataItem (SMWDataItem $dataItem)
 getSpecialPageTitleText ()
 Gets the title text for the types special page.

Protected Attributes

 $m_isAlias
 $m_realLabel
 $m_givenLabel
 $m_typeId


Detailed Description

This datavalue implements special processing suitable for defining types of properties.

Types behave largely like values of type SMWWikiPageValue with three main differences. First, they actively check if a value is an alias for another type, modifying the internal representation accordingly. Second, they have a modified display for emphasizing if some type is defined in SMW (built-in). Third, they use type ids for storing data (DB keys) instead of using page titles.

Author:
Markus Krötzsch

Definition at line 19 of file SMW_DV_Types.php.


Member Function Documentation

static SMWTypesValue::newFromTypeId ( typeId  )  [static]

static SMWTypesValue::getTypeUriFromTypeId ( typeId  )  [static]

Definition at line 36 of file SMW_DV_Types.php.

Referenced by SMWCompatibilityHelpers::dataItemFromDBKeys().

SMWTypesValue::parseUserValue ( value  )  [protected]

Initialise the datavalue from the given value string.

The format of this strings might be any acceptable user input and especially includes the output of getWikiValue().

Parameters:
string $value

Reimplemented from SMWDataValue.

Definition at line 40 of file SMW_DV_Types.php.

References SMWDataValue::addError(), SMWDataValueFactory::findTypeID(), SMWDataValueFactory::findTypeLabel(), and smwfNormalTitleText().

SMWTypesValue::loadDataItem ( SMWDataItem dataItem  )  [protected]

See also:
SMWDataValue::loadDataItem()
Parameters:
$dataitem SMWDataItem
Returns:
boolean

Reimplemented from SMWDataValue.

Definition at line 80 of file SMW_DV_Types.php.

References SMWDataValueFactory::findTypeLabel().

SMWTypesValue::getShortWikiText ( linked = null  ) 

Returns a short textual representation for this data value.

If the value was initialised from a user supplied string, then this original string should be reflected in this short version (i.e. no normalisation should normally happen). There might, however, be additional parts such as code for generating tooltips. The output is in wiki text.

The parameter $linked controls linking of values such as titles and should be non-NULL and non-false if this is desired.

Reimplemented from SMWDataValue.

Definition at line 95 of file SMW_DV_Types.php.

References getSpecialPageTitleText().

SMWTypesValue::getShortHTMLText ( linker = null  ) 

Returns a short textual representation for this data value.

If the value was initialised from a user supplied string, then this original string should be reflected in this short version (i.e. no normalisation should normally happen). There might, however, be additional parts such as code for generating tooltips. The output is in HTML text.

The parameter $linker controls linking of values such as titles and should be some Linker object (or NULL for no linking).

Reimplemented from SMWDataValue.

Definition at line 106 of file SMW_DV_Types.php.

References getSpecialPageTitleText().

SMWTypesValue::getLongWikiText ( linked = null  ) 

Return the long textual description of the value, as printed for example in the factbox.

If errors occurred, return the error message The result always is a wiki-source string.

The parameter $linked controls linking of values such as titles and should be non-NULL and non-false if this is desired.

Reimplemented from SMWDataValue.

Definition at line 115 of file SMW_DV_Types.php.

References getSpecialPageTitleText().

SMWTypesValue::getLongHTMLText ( linker = null  ) 

Return the long textual description of the value, as printed for example in the factbox.

If errors occurred, return the error message The result always is an HTML string.

The parameter $linker controls linking of values such as titles and should be some Linker object (or NULL for no linking).

Reimplemented from SMWDataValue.

Definition at line 126 of file SMW_DV_Types.php.

References getSpecialPageTitleText().

SMWTypesValue::getSpecialPageTitleText (  )  [protected]

Gets the title text for the types special page.

Takes care of compatibility changes in MW 1.17 and 1.18. 1.17 introduces SpecialPageFactory 1.18 deprecates SpecialPage::getLocalNameFor

Since:
1.6
Returns:
string

Definition at line 145 of file SMW_DV_Types.php.

Referenced by getLongHTMLText(), getLongWikiText(), getShortHTMLText(), and getShortWikiText().

SMWTypesValue::getWikiValue (  ) 

Return the plain wiki version of the value, or FALSE if no such version is available.

The returned string suffices to reobtain the same DataValue when passing it as an input string to setUserValue().

Reimplemented from SMWDataValue.

Definition at line 151 of file SMW_DV_Types.php.

SMWTypesValue::getHash (  ) 

Return a string that identifies the value of the object, and that can be used to compare different value objects.

Possibly overwritten by subclasses (e.g. to ensure that returned value is normalized first)

Returns:
string

Reimplemented from SMWDataValue.

Definition at line 155 of file SMW_DV_Types.php.

SMWTypesValue::getDBkey (  ) 

This class uses type ids as DB keys.

Returns:
string

Definition at line 164 of file SMW_DV_Types.php.

References SMWDataValueFactory::findTypeID(), and SMWDataValue::isValid().

SMWTypesValue::isBuiltIn (  ) 

Is this a built-in datatype shipped with SMW (or an extension of SMW)? (Alternatively it would be a user-defined derived datatype.

)

Deprecated:
As of SMW 1.6, there are no more user-defined datatypes, making this method useless. Will vanish in SMW 1.6.

Definition at line 174 of file SMW_DV_Types.php.

SMWTypesValue::isAlias (  ) 

Is this an alias for another datatype in SMW? This information is used to explain entries in Special:Types that are found since they have pages.

Returns:
boolean

Definition at line 184 of file SMW_DV_Types.php.


Member Data Documentation

SMWTypesValue::$m_isAlias [protected]

Definition at line 20 of file SMW_DV_Types.php.

SMWTypesValue::$m_realLabel [protected]

Definition at line 21 of file SMW_DV_Types.php.

SMWTypesValue::$m_givenLabel [protected]

Definition at line 22 of file SMW_DV_Types.php.

SMWTypesValue::$m_typeId [protected]

Definition at line 23 of file SMW_DV_Types.php.


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

Generated on Thu Feb 9 07:15:43 2012 for Semantic MediaWiki by  doxygen 1.5.6