I would like to create some URLs in normal pages
(accessed with page=) using some extra fields i have 
added in user preferences. For example, i want the url 
to point to the build name they set in their preferences. 
As we have many builds i can't hard code it.

I don't quite see how to do this. Jsp i've added to
pages isn't interpreted. And i want to use the normal
~ViewTemplate, but i want the contents to undergo
some sort of macro expansion.

It there a way to do this?

--Anonymous

Yes, either by making a custom WikiPlugin, or by using WikiVariables.  For example, anything you set in {{jspwiki.properties}} that starts with "jspwiki." is accessible with the variable mechanism.

In 2.2, it is in addition possible to define page-specific variables using the SET directive.

It is also possible to enable HTML, then apply Javascript.

If you just need URL references, then the "specialPage" -mechanism might help you: it allows you to point to a page (like ~CompilerSettings) by setting something like
{{{
jspwiki.specialPage.CompilerSettings = http://url.to.your.compiler.settings
}}}

After this, any reference to page ~CompilerSettings will take you to that url.

In 2.2, it is also possible to do the redirection directly from a page =).

As you can see, there are plenty of options.  Hope some of them work for you :-).

-- JanneJalkanen

I didn't think of javascript. I could get the cookies that way.

The WikiVariables wouldn't be appropriate really because the 
attributes are in the user prefs and not in the properties file.
Or do you mean use context.getEngine().getWikiProperties() and
load all the user prefs into it with something like jspwiki.username.myvarname?

Or i could add another option to the variable substitution to use
cookie. which would look into the current cookie.

It isn't clear how i could do it with the wiki plugin mechanism. I'd like
to use wiki to maintain the page content. With a plugin i would have to
do something funky like include the entire text as an argument to
the plugin?