incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Karvanen <>
Subject JSPWiki clone Template with Variables
Date Thu, 28 May 2009 06:19:20 GMT
Hi All,

I have used JSPWiki 2.8 version for a while and I am not familiar with 
3.0 features and development status. I decided to check first with email 
before doing any further investigations.

I am not sure is it possible to do same thing other way in 3.0 version. 
I checked that the modified files still exist in 3.0, but I am not sure 
are those working same way.

Make end user easier to create consistent wiki pages with template page 
with variables.

I found the clone feature, but I did not find similar variable expansion 
as for example in TWiki.

After modifcation with a couple of lines of extra code, I can call 
Edit.jsp with variables expanded in new clone page.

So I can create this kind of links in my pages:
[{InsertPage page='Notes Db View times'},default=
'Auto-generated page. Add description and comments to page <a 
href="Edit.jsp?page=Notes Db View 
times&clone=DefaultNote&expand=true&backpage=Db View times"\>Notes Db 
View times</a>'}]

Content of page file Defaultnote.txt:

Modified files FCK.jsp and plain.jsp:

  String clone = request.getParameter( "clone" );
  if( clone != null )
    WikiPage p = engine.getPage( clone );
    if( p != null )
        AuthorizationManager mgr = engine.getAuthorizationManager();
        PagePermission pp = new PagePermission( p, 
PagePermission.VIEW_ACTION );

          if( mgr.checkPermission( context.getWikiSession(), pp ) )
            usertext = engine.getPureText( p );
        catch( Exception e ) {  /*log.error( "Accessing clone page 
"+clone, e );*/ }
        //Adding parameter expand to url with clone variables like 
{$pagename},... are expanded
        //Note variables are plain {$name} without []-characters
        //by Jukka Karvanen
        String expand = request.getParameter( "expand" );
        if( expand != null )


What you think is this feasible also for 3.0 version?


View raw message