jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Fischer <fr...@jcpsim.org>
Subject Re: Viewer for generated pages - Lucene refresh
Date Fri, 29 Aug 2008 15:36:06 GMT
Juergen Weber schrieb:
> Thanks very much so far.
> 
> The code you gave would need to run in a plugin with a servlet, would it?
> 
> So, I'll have a look at
> http://www.jspwiki.org/wiki/PluginCookbook#section-PluginCookbook-WritingAServletForAWikiPlugin

This is a good stating point.
http://www.jspwiki.org/wiki/PDFPlugin and its
attached source code is a good example.



> I saw that Janne wrote a DAV paper:
> http://meta.wikimedia.org/wiki/Transwiki:Wikimania05/Paper-JJ1
> 
> but this only allows attachment-uploads, does it?
> 

I have no idea if this works at all.

Frank

> 
> 
> Frank Fischer-2 wrote:
>> 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
>> com.ecyrd.jspwiki.WikiEngine:
>>
>> -----snip--------------------------------------------------
>>
>> 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());
>>    newContext.setPage(page);
>>    page.setAuthor(author);
>>    engine.saveText(newContext, text);
>> } catch(WikiException e) {
>> }
>>
>> -----snip--------------------------------------------------
>>
>> 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?
>> Yes.
>>
>> Frank
>>
>>
> 


Mime
View raw message