r4 - 12 Oct 2010 - 15:36 - AdminUser | r3 - 12 Oct 2010 - 15:36 - AdminUser | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
RenderPlugin |
RenderPlugin |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Render WikiApplications asynchronously |
Render WikiApplications asynchronously |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description |
Description |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This plugin implements three simple REST handlers to get content from Foswiki. For example, these can be used to easily replace a server-side INCLUDE with a functional equivalent using an ajax call to one of these REST handlers. |
This plugin implements three simple REST handlers to get content from Foswiki. For example, these can be used to easily replace a server-side INCLUDE with a functional equivalent using an ajax call to one of these REST handlers. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This comes in handy to asynchronously load content in a tabbed interface, loading subsequent content for a treeview, a menu widget, or tooltips. |
This comes in handy to asynchronously load content in a tabbed interface, loading subsequent content for a treeview, a menu widget, or tooltips. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You may also use it to just render a snippet of TopicMarkup on the server and return a HTML preview back to the browser. |
You may also use it to just render a snippet of TopicMarkup on the server and return a HTML preview back to the browser. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The REST handlers of this plugin have been designed to be rather generic. So, besides some very basic parameter checking, most error handling is up to the callback analysing the return value of the REST handler. The main purpose is best described as being an intermediate transport device. |
The REST handlers of this plugin have been designed to be rather generic. So, besides some very basic parameter checking, most error handling is up to the callback analysing the return value of the REST handler. The main purpose is best described as being an intermediate transport device. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Compare this to other plugins that implement more specific REST handlers. As such, they are rather tailored to one specific service and thus will be dealing with error cases on the server side in much more detail. |
Compare this to other plugins that implement more specific REST handlers. As such, they are rather tailored to one specific service and thus will be dealing with error cases on the server side in much more detail. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The advantage of using this plugin's REST handler is that you don't have to implement service backends using perl. Instead, you can write TopicFunctions that contain the WikiApplication to be executed when it is called by an appropriate ajax request. This basically is the client side equivalent of a parametrized |
The advantage of using this plugin's REST handler is that you don't have to implement service backends using perl. Instead, you can write TopicFunctions that contain the WikiApplication to be executed when it is called by an appropriate ajax request. This basically is the client side equivalent of a parametrized |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Syntax |
Syntax |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The available REST handlers are: |
The available REST handlers are: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Usage |
Usage |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The REST handlers are called like this: |
The REST handlers are called like this: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%SCRIPTURLPATH{"rest"}/RenderPlugin/render?text=%ENCODE{"This is _very_ cool."}% |
%SCRIPTURLPATH{"rest"}/RenderPlugin/render?text=%ENCODE{"This is _very_ cool."}% |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%SCRIPTURLPATH{"rest"}/RenderPlugin/tag?name=INCLUDE;param=Applications.RenderWebTagCloud;search=screenshot |
%SCRIPTURLPATH{"rest"}/RenderPlugin/tag?name=INCLUDE;param=Applications.RenderWebTagCloud;search=screenshot |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(equivalent to a |
(equivalent to a |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This can be schedule using jQuery like this: |
This can be schedule using jQuery like this: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Examples |
Examples |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fetching a message |
Fetching a message |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%STARTSECTION{"message"}% *Hello World!* :) %ENDSECTION{"message"}% |
%STARTSECTION{"message"}% *Hello World!* :) %ENDSECTION{"message"}% |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Previewing TML |
Previewing TML |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Okay, your turn to create an example calling SEARCH. |
Okay, your turn to create an example calling SEARCH. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Installation Instructions |
Installation Instructions |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server. |
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install". |
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install". |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If you have any problems, or if the extension isn't available in |
If you have any problems, or if the extension isn't available in |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Plugin Info |
Plugin Info |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
r4 - 12 Oct 2010 - 15:36 - AdminUser | r3 - 12 Oct 2010 - 15:36 - AdminUser | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||