Add new attachment

Only authorized users are allowed to upload new attachments.

This page (revision-10) was last changed on 27-Jan-2010 20:18 by 164.67.235.79  

This page was created on 09-Apr-2003 15:22 by 129.69.13.219

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 1 added one line
When invoked, a JSPWiki plugin may be given an arbitrary number of "parameters" in the form of key-value pairs.
At line 4 added 46 lines
The showParameters plugin examines its parameter table and lists all parameters that were given in the plugin invocation.
!!Compilation
Save the source code shown at the bottom of this page into a file called {{showParameters.java}}. Then invoke the Java compiler as follows
{{{
javac showParameters.java
}}}
(or similar - depending on the development environment you are using)
\\You may need to include JSPWiki.jar in your classpath, example:
{{{javac -classpath JSPWiki.jar showParameters.java}}}
!!Installation
Create a JAR archive containing the Java class file for the plugin. You may use the command
{{{
jar cvf showParameters.jar showParameters.class
}}}
for that purpose.
Then move that file into any directory within your wiki's class path - preferrably into the {{WEB-INF/lib/}} folder within your web server's ''web application directory'' for the JSPWiki.
Finally restart the Wiki for the plugin to be recognized.
!!Usage
Within wiki markup, invoke the plugin as follows
{{{
[{showParameters literal=singleWord, anotherLiteral='multiple words', number=1234, boolean=true}]
}}}
As the class resides in the default directory, there is no need neither to prefix the plugin name with a package path nor to modify the plugin search path within the JSPWiki configuration file.
You may also add any other parameters you like - the only restriction is given by the syntactic constraints imposed by JSPWiki.
The final wiki output should then contain a section like
!showParameters - lists the given plugin parameters
;literal (java.lang.String):"singleWord"
;anotherLiteral (java.lang.String):"multiple words"
;number (java.lang.String):"1234 "
;boolean (java.lang.String):"true"
__Nota bene:__ while you may omit the commas (used to separate individual name-value pairs) you should __never use double quotes (") instead of single ones (')!__ Otherwise, JSPWiki may omit some parameters or mix names and values.
At line 17 changed one line
if (ParameterMap == null) {
if (ParameterMap == null || ParameterMap.isEmpty()) {
At line 19 changed one line
};
}
At line 23 removed 5 lines
Iterator ParameterInterator = ParameterMap.keySet().iterator();
if (!ParameterInterator.hasNext()) { // this looks probable
return Result + "(no parameters given)";
};
At line 29 changed 2 lines
while (ParameterInterator.hasNext()) {
Object Key = ParameterInterator.next();
for (Iterator ParameterInterator = ParameterMap.entrySet().iterator(); ParameterInterator.hasNext(); ) {
Map.Entry Entry = (Map.Entry)ParameterInterator.next();
Object Key = Entry.getKey();
At line 33 changed one line
Object Value = (Key == null ? null : ParameterMap.get(Key));
Object Value = Entry.getValue();
At line 91 added 2 lines
[Andreas Rozek|http://www.Andreas-Rozek.de] (EMail: [Andreas.Rozek@GMX.De|mailto:Andreas.Rozek@GMX.De])
Version Date Modified Size Author Changes ... Change note
10 27-Jan-2010 20:18 3.613 kB 164.67.235.79 to previous
9 15-Apr-2004 19:57 3.705 kB 68.123.120.155 to previous | to last
8 15-Apr-2004 19:56 3.68 kB 68.123.120.155 to previous | to last
7 09-Apr-2003 16:42 3.578 kB 129.69.13.219 to previous | to last
6 09-Apr-2003 16:27 3.517 kB 129.69.13.219 to previous | to last
5 09-Apr-2003 16:21 3.34 kB 129.69.13.219 to previous | to last
4 09-Apr-2003 16:18 3.334 kB 129.69.13.219 to previous | to last
3 09-Apr-2003 15:55 2.568 kB 129.69.13.219 to previous | to last
2 09-Apr-2003 15:51 1.606 kB 129.69.13.219 to previous | to last
1 09-Apr-2003 15:22 1.501 kB 129.69.13.219 to last
« This page (revision-10) was last changed on 27-Jan-2010 20:18 by 164.67.235.79