incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Paige" <bobpa...@gmail.com>
Subject Re: create a new page from a template?
Date Thu, 10 Jul 2008 13:05:49 GMT
Found the answer myself: http://www.jspwiki.org/wiki/NewPageHandler

Jann (strongly) suggests we use the VariableManager.expandVariables() call,
which is just what I was looking for.

-- 
Bobman

On Thu, Jul 10, 2008 at 8:23 AM, Bob Paige <bobpaige@gmail.com> wrote:

> Dirk,
>
> This is just what I was looking for.
>
> Related question: I'm doing some other work with page variables, but it
> appears the page variables are not evaluated when you clone a page. I see
> how page cloning is implemented in the plain.jsp page; is there a simple
> call I can make into the wiki engine to have it evaluate page variables on
> the raw page?
>
> --
> Bobman
>
>
> On Thu, Jul 10, 2008 at 4:02 AM, Dirk Frederickx <
> dirk.frederickx@gmail.com> wrote:
>
>> Cloning is just build in the plain.jsp, it is not a plugin.
>> It was added with the inclusing of the BrushedTemplate.
>> (ref. http://www.jspwiki.org/wiki/BrushedTemplateClonePage)
>>
>>
>>
>> dirk
>>
>> On Thu, Jul 10, 2008 at 3:01 AM, Bob Paige <bobpaige@gmail.com> wrote:
>> > Is cloning a new feature in JSPWiki, or a plugin? I'm using 2.6.3.
>> >
>> > --
>> > Bobman
>> >
>> > On Wed, Jul 9, 2008 at 2:43 PM, Dirk Frederickx <
>> dirk.frederickx@gmail.com>
>> > wrote:
>> >
>> >> > As far as security, I can imagine someone might try to view a page
>> they
>> >> > otherwise don't have access to by creating a 'clone' of it (as Dirk
>> >> > suggests; I like that terminology, BTW). But isn't it possible to
>> check
>> >> the
>> >> > permissions for the original page within the plugin? I think I've
>> seen
>> >> that
>> >> > in the code I've been looking at so far.
>> >>
>> >> Good point! I need to add e permission check around the cloning
>> >> functionality (next commit)
>> >> Here is how you can do it yourself :
>> >>
>> >>
>> >>  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 );
>> >>
>> >>        try
>> >>        {
>> >>          if( mgr.checkPermission( context.getWikiSession(), pp ) )
>> >>          {
>> >>            usertext = engine.getPureText( p );
>> >>          }
>> >>        }
>> >>        catch( Exception e ) {  /*log.error( "Accessing clone page
>> >> "+clone, e );*/ }
>> >>    }
>> >>  }
>> >>
>> >> dirk
>> >>
>> >
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message