Version 7, changed by admin. 10/01/2006. Show version history
Introduction to JotLib
JotLib is the JotSpot's library that enable collaborative web apps in a JotSpot wiki. JotLib consists of functions like search, table, calendar, and include, control flow statements like if and loop, all bound together using XPath expressions.
Using JotLib and CSS, you can build themes, plugins or complete applications.
Expressions using XPath:
This expression entered on a page:
Hello ${req/user}, the current page is ${page/name} ${concat('and the full path is: ', req/path)}
displays the following when viewing the page:
Hello guest, the current page is DevIntroduction and the full path is: /WikiHome/DevIntroduction
JotScript uses an HTML-like tag syntax:
These tags:
<wiki:search forChildren="MyTasksApp" set="myResultSet" /> <wiki:table contents="myResultSet"/>
Display a table of all pages that are children of a page called MyTasksApp:
| Revision | User | Last Edited | |
|---|---|---|---|
| MyTaskPages.png | 1 | jotspot_scott | 04/08/2005 12:55PM |
| MyTasks.png | 1 | jotspot_scott | 04/06/2005 04:31PM |
| clip art, music, videos | 1 | guest | 07/26/2006 10:48AM |
| watchvideo_small.gif | 1 | jotspot_scott | 04/13/2005 11:55AM |
This snippet:
<wiki:if test="${page/revision > 10}">
<wiki:then>
*Wow, this page has more than 10 revisions.*
</wiki:then>
</wiki:if>
Displays the bold message Wow, this page has more than 10 revisions. if that particular page has been edited more than 10 times.
In wiki pages! Seriously, in JotSpot everything is wiki page, and pages are just XML. But don't worry about that yet. There's plenty of time to explain exactly how this simplifies your life later.
Basic understanding of the following is very helpful: