From: Markus Krötzsch <markus@se...> - 2011-10-29 22:00:45
In the cause of adding the new display features for subobjects, I have
also done some modifications to the display methods for SMWWikiPageValue
that affects how page names are presented to the user. You may want to
update some code to get the desired display with the new version. Below
are the details.
== getShort*Text and getLong*Text ==
The "Short" methods used to return the page name with full namespace
prefix by default if no other caption was given. The "Long" versions, in
contrast, used to abbreviate labels if a link was given anyway (so one
could get a link to "User:Foo" that was simply labelled with "Foo"; the
rationale was that the information is in the link anyway). So the
"Short*" methods returned the longer text versions than the "Long*" ones.
Now this has been fixed. The default for Short is to abbreviate labels
in links while the default for Long is to show all details even in link
labels. There was extra code to use the opposite method in case of wiki
pages, e.g., in SMWQueryResult. This is all simplified now. As usual,
only Short* methods use the caption (if set).
So it should be pretty obvious what to call if you want longer or
shorter texts. Code that expects the old behaviour will still work, but
will display more/less namespace prefixes than desired.
Note that only linked displays are affected. Unlinked versions will
always include prefixes.
== Image: values ==
Some changes were made to the display of images:
* [[property::Image:Foo|some|image|settings]] will now display like
[[Image:Foo|some|image|settings]] as one would expect
* images in query results will *only* show the image, no additional line
breaks or links
== Wiki value ==
The wiki value never includes an initial ":", not even for values like
"Category:Foo". So if you use getWikiValue() somewhere to put it into
[[...]], you may want to add an initial ":" to escape this (or maybe you
want to use get*WikiText() instead).
== Fragments/Subobjects ==
Fragments are usually displayed by all functions since they are
important to distinguish different objects. They appear as post-fixes
"#fragment" after the title. Only if a fragment starts with "_" it will
not be displayed in links since this is used to refer to internal
subobject identifiers that make no sense to humans. But getWikiValue()
and all non-linked displays always include the fragment.
Get latest updates about Open Source Projects, Conferences and News.