NAME
PurpleWiki::Transclusion - Transclusion object.
SYNOPSIS
use PurpleWiki::Config;
use PurpleWiki::Transclusion;
my $config = PurpleWiki::Config->new('/var/www/wikidb');
my $transclusion = PurpleWiki::Transclusion->new(
config => $config,
url => 'http://purplewiki.blueoxen.net/cgi-bin/wiki.pl?HomePage',
ouput_type => 'plaintext');
$transclusion->get('2H1'); # retrieves content of NID 2H1
DESCRIPTION
A first stab at transclusions in PurpleWiki. This is an extremely rudimentary prototype. It is not meant to be good by any stretch of the imagination. It is simply to demonstrate the possibilities that these features allow.
METHODS
new(%params)
Creates a new Transclusion object. See get() for more.
There are three parameters:
config -- PurpleWiki::Config object
url -- The URL requesting the transclusion
outputType -- plaintext, xhtml or undef (defaults to xhtml)
get($nid)
Takes $nid, looks it up using PurpleWiki::Sequence and then uses HTTP to retrieve the page on which that NID is found. The retrieved page is parsed to gather the content associated with the NID. A string containing the content or an error message if it could not be obtained is returned.
If the PurpleWiki::Config has defined httpUser and httpPass, that information will be passed along with the HTTP request to authenticate.
getURL($nid)
Returns the URL associated with the NID. This can be useful for displaying the URL.
AUTHORS
Chris Dent, <cdent@blueoxen.org>
Eugene Eric Kim, <eekim@blueoxen.org>