incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Fischer <>
Subject Re: Viewer for generated pages - Lucene refresh
Date Fri, 29 Aug 2008 12:17:58 GMT
weberjn schrieb:
> We'd like to export some information from UML models into Wiki pages and use
> JSPWiki as read-only viewer for it. The result should be similar to Javadoc
> (but it is not about Java).
> It seems to be easier to generate wiki pages than to generate static HTML
> pages, does it?
> I see two problems here:
> o How does JSPWiki know that there are new or changed pages in the
> file-system and especially, how do you make Lucene see the changes? Is there
> an API (e.g. a servlet) that you can call to make JSPWiki reload its page
> cache?

You should not write directly to the file system, but use
the saveText( WikiContext context, String text ) method in


Wiki Context context;   // you need a WikiContext object
String       pageName;  // the wiki name of the page
String       author;    // the author of the page
String       text;      // the wiki markup you want to store

try {
   WikiEngine engine = context.getEngine();
   WikiPage   page   = engine.getPage(pageName);
   if (page == null) page = new WikiPage(engine, pageName);
   WikiContext newContext = (WikiContext)(context.clone());
   engine.saveText(newContext, text);
} catch(WikiException e) {


This should store a new version of the page and present
the text to Lucene.

> o How do you make the pages read-only? Generate ALLOW tags into the pages?



View raw message