This is version . It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]

The insert page plugin allows you to insert the contents of one page into another.

This short plugin started as a way to simplify a complicated page. Our home wiki has a schedule at the top, my links in the middle and my girlfriend's across the bottom. Each section is a table and between the tables we have some animated gifs. Needless to say, this made the page confusing to edit. With this plugin I can now do something like this:

[{INSERT com.hurlbert.jspwiki.plugin.InsertPagePlugin pageToInsert=HomeSchedule}]
[ValDay/fishswimming.gif][ValDay/ake.gif]
[{INSERT com.hurlbert.jspwiki.plugin.InsertPagePlugin pageToInsert=HisLinks}] \\ \\
[{INSERT com.hurlbert.jspwiki.plugin.InsertPagePlugin pageToInsert=HerLinks}] \\

Enjoy - Scott Hurlbert

Very good. I will rewrite the syntax a bit, but expect to see something like this in the next release.

-- JanneJalkanen

Hey great! As for the syntax, I'm relatively new to java and this is my first public offering to the JSPWiki so I look forward to seeing the changes. I'm still at that stage where I'm learning everyday. Thanks

-- ScottHurlbert

There's now a InsertPagePlugin in 2.1.37. Thanks, Scott (and AlainRavet, who also suggested the same thing). You can see an example of it running at my weblog.

What is the basic syntax ?? -- OlivierVit

[{INSERT InsertPagePlugin pageToInsert=EditUserHelp}] this doesn't work, how can I use it? -- SebastianPetzelberger


I'm having problems with the 2.1.37 plugin and getting it to include some pages. I can't get it to include my Main or About pages or my FosterSchucker page. It seems to have something to do with including a plugin. Has anyone else seen this? -- FosterSchucker

package com.hurlbert.jspwiki.plugin;

import com.ecyrd.jspwiki.*;
import com.ecyrd.jspwiki.plugin.*;

import java.util.*;

/**
 *  Inserts a WikiPage into another WikiPage.
 *  <P>
 *  <B>Parameters </B>
 *  <UL>
 *    <LI>pageToInsert - The page to be inserted.
 *  </UL>
 */

public class InsertPagePlugin implements WikiPlug[http://www.yourgoogle.com]
[http://www.yourgoogle.com/google-list/google-list.htm ]
[http://www.yourgoogle.com/webdesign/webdesign-1.htm]
[http://googlesz.freewebpage.org]
[http://www.tlup.com]
[http://www.tlup.com]
[http://swellong.freewebpage.org]
[http://www.flowerwish.com]
[http://www.flowerwish.com]
[http://www.flowerwish.com/ups]
[http://www.blueattain.com]
[http://www.szsuun.com]
[http://kvmkvm.freewebpage.org]
[http://www.flowerwish.com/qygl]
[http://www.flowerwish.com/qygl]
[http://www.ktyu.com]
[http://www.edmcocn.com]
[http://www.yourgoogle.com/company-card-index/companyindex.htm]
[http://flowerwish.freewebpage.org]
[http://www.glpx.com]
[http://www.glpx.com]
[http://www.glpx.com]
[http://www.flowerwish.com/zhuce]
[http://www.xingfuquan.com]
[http://www.xingfuquan.com]
[http://www.huaqiplas.com]
[http://www.flowerwish.com/byq]
[http://www.inflatables-china.com]
[http://www.inflatables-china.com]
[http://www.jlcggs.com/chanpin/chanpin2.htm]
[http://kvm.bizhat.com]
[http://logistics.freewebpage.org]
[www.yourgoogle.com/company-card-index/companyindex.htm]
[www.yourgoogle.com/company-card-index/companyindex.htm]
[http://www.51gl.cn]
[http://www.yourgoogle.com/default.asp]
[http://glassbead.freewebpage.org]
[http://www.sfcomm.com]
[http://www.yourgoogle.com/default.asp]
[http://www.yourgoogle.com/paobuji/]
[http://www.flowerwish.com/cdq/]
[http://www.jlcggs.com/chanpin/fanghu/anzuobao/anzuobao.htm]
[http://www.jlcggs.com/chanpin/chelei/dulun/dulunche.htm]
[http://www.creator-cg.com/crcs/]
[http://www.flowerwish.com/huanbao/]
[http://www.szsuun.com]
[http://www.yourgoogle.com/ghdprinting/]
[http://www.yourgoogle.com/ghdprinting/]
[http://www.pinghengji.com/cp2.asp]
[http://www.huaqiplas.com]
[http://www.yourgoogle.com/duijiangji]
[http://www.sfcomm.com]
[http://magnesia.freewebpage.org]
[http://magnesia.freewebpage.org]
[http://magnesia.freewebpage.org]
[http://magnesia.freewebpage.org]
[http://magnesia.freewebpage.org]
[http://magnesia.freewebpage.org]
[http://magnesia.freewebpage.org]
[http://www.flowerwish.com/kvm/]
[http://www.0755shopping.com]
[http://tingchechang.freewebpage.org]
[http://wlsxj.freewebpage.org]
[http://wlsxj.freewebpage.org]
[http://netphoto.freewebpage.org]
[http://www.flowerwish.com/edm/]
[http://www.flowerwish.com/diaokeji/]
[http://www.flowerwish.com/touyingji]
[http://pyrethum.freewebpage.org]
[http://pyrethum.freewebpage.org]
[http://pyrethum.freewebpage.org]
[http://pyrethum.freewebpage.org]
[http://pyrethum.freewebpage.org]
[http://pyrethum.freewebpage.org]
[http://pyrethum.freewebpage.org]
[http://pyrethum.freewebpage.org]
 ######in
{
	public static final String PARAM_NAME_OF_PAGE_TO_INSERT = "pageToInsert";

	public String execute( WikiContext context, Map params )
	throws PluginException
	{
		WikiEngine engine = context.getEngine();
		//
		//  Parse parameters.
		String nameOfPageToInsert = "";
		
		if( (nameOfPageToInsert = (String)params.get(PARAM_NAME_OF_PAGE_TO_INSERT)) == null )
		    return "no page found";
		//
		// We should now have a page to insert.
		 WikiPage wpage = engine.getPage(nameOfPageToInsert);
		//
		// Lets make sure we got a page
		if( wpage == null )
			return "'" + nameOfPageToInsert + "' page not found";
		else
			return engine.getHTML( context, wpage );
    }
}

Add new attachment

Only authorized users are allowed to upload new attachments.
« This particular version was published on 03-Nov-2004 20:34 by 202.105.113.90.