The two types of WikiVariables are defined below.!! Page Variables
Starting with JSPWiki 2.2, you can use the "SET" directive to define a variable that exists only in the page.
You can access this value anywhere on your page by using the shorthand "[{$foo}]".
_
Accessing Page WikiVariables "[{$test}]" before it is set:
test = No such variable: No variable test defined.
Then setting 'foo' to 'bar' For example:
[{SET foo='bar'}]creates you a variable called "foo", which has the value of "bar".
Accessing "[{$foo}]" After it is set:
foo = bar
Variable | Description | Value | Code |
---|---|---|---|
applicationname | This is the name of this Wiki. It has been set by the administrator in "jspwiki.properties". | LDAPWiki | [{$applicationname}] |
baseurl | The base URL address for this wiki | /wiki | [{$baseurl}] |
encoding | Describes the character encoding used in this Wiki. An encoding of "UTF-8" means that the Wiki accepts any character, including Chinese, Japanese, etc. Encoding "ISO-8859-1" means that only western languages are supported. | UTF-8' | [{$encoding}] |
inlinedimages | Lets you know which image types are able to be inlined | *.png | [{$inlinedimages}] |
interwikilinks | Writes HTML code for supported InterWiki links | TWiki --> http://twiki.org/cgi-bin/view/TWiki/%s, WikiWikiWeb --> http://c2.com/cgi/wiki?%s, Reader --> Wiki.jsp?page=%s&skin=reader, Wikipedia --> http://www.wikipedia.com/wiki/%s, Raw --> Wiki.jsp?page=%s&skin=raw, Doc --> http://jspwiki-wiki.apache.org/Wiki.jsp?page=%s, Google --> http://www.google.com/search?q=%s, JIRA --> https://issues.apache.org/jira/browse/JSPWIKI-%s, RSS --> rss.jsp?page=%s&mode=wiki, Group --> Group.jsp?group=%s, Edit --> Edit.jsp?page=%s, Location --> https://maps.google.com/maps?q=%s, MeatballWiki --> http://usemod.com/cgi-bin/mb.pl?%s, JSPWiki --> http://jspwiki-wiki.apache.org/Wiki.jsp?page=%s | [{$interwikilinks}] |
jspwikiversion | Inserts the version number of the JSPWiki engine. | 2.11.3 | [{$jspwikiversion}] |
loginstatus | Shows the status of the current logged-in user | anonymous | [{$loginstatus}] |
uptime | Inserts the amount of time since this Wiki has been last restarted | 230d, 14h 41m 20s | [{$uptime}] |
pagename | Inserts the current page name. | WikiVariables | [{$pagename}] |
pageprovider | The current PageProvider | org.apache.wiki.providers.CachingProvider | [{$pageprovider}] |
pageproviderdescription | A verbose, HTML description about the currently used page provider | Real provider: org.apache.wiki.providers.VersioningFileProvider. Page cache hits: 140717085949. Page cache misses: 0. History cache hits: 2685930. History cache misses: 16105 | [{$pageproviderdescription}] |
requestcontext | The current RequestContext | view | [{$requestcontext}] |
totalpages | The total number of pages available in this Wiki | 16125 | [{$totalpages}] |
username | Inserts the current user name | 10.244.1.1, 10.224.0.4 | [{$username}] |
inlinedimages | Inlined images on LDAPWiki | *.png | [{$inlinedimages}] |
pagefilters | Installed PageFilters | [{$pagefilters}] |
You can also access some of the JSPWiki properties (that have been defined by the site maintainer) by using their property names directly. See SystemInfo for an example. Note that some properties might not be accessible due to security reasons.
You can also obtain some data from the JSPWiki Plugins.
Needs more info on how to set global variables in jspwiki.properties. I cannot find how anywhere..