incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Murray Altheim <murra...@altheim.com>
Subject Re: embedding wiki in app
Date Mon, 02 Mar 2009 20:50:08 GMT
Louis.Masters@log-net.com wrote:
> Is there an easy way to embed JSPWiki in our current J2EE 
> application? Or a subset of the functionality?

I've been using a combination of Jetty and JSPWiki embedded in a
standalone Java application for many years now. Once I have Jetty
up and running the wiki starts up with no problems.

The trick is to use JSPWiki's cascading properties feature. If you
open WEB-INF/jspwiki.properties, read its values, then write a file
named "WEB-INF/jspwiki.properties.0" containing modified values as
needed by your application, the WikiEngine will overwrite the
original values with the cascading properties file. This allows you
to modify things like boolean settings, paths, packages and search
paths, etc.  I've found it sufficient to permit me to embed the
WikiEngine. You just need to be sure you write your cascading file
prior to the wiki engine starting up.

Another thing I'm doing is creating a WikiEngine whose sole purpose
is to parse wiki text content and fire events. For this I ended up
needing to disable the AAA features by implementing a WebAuthorizer
that simply passes true values for all methods (permitting anyone
to do anything, since there's never actually anybody except the
application itself). This needed a few default wiki pages and uses
the raw template. There is no UI.

None of this was particularly difficult.

See the javadocs on the PropertyReader:

     https://svn.apache.org/repos/asf/incubator/jspwiki/trunk/src/java/org/apache/wiki/PropertyReader.java

for details on the cascading properties feature.

Murray

...........................................................................
Murray Altheim <murray09 at altheim dot com>                       ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

       Boundless wind and moon - the eye within eyes,
       Inexhaustible heaven and earth - the light beyond light,
       The willow dark, the flower bright - ten thousand houses,
       Knock at any door - there's one who will respond.
                                       -- The Blue Cliff Record

Mime
View raw message