) }
retrieve_node_and_checksum
my ($content, $cksum) = $wiki->retrieve_node_and_checksum($node);
Works just like retrieve_node, but also gives you a checksum that
you must send back when you want to commit changes, so you can check
that no other changes have been committed while you were editing.
Currently it's just the md5sum of the node content.
format
my $html = $wiki->format($submitted_content);
Escapes any tags which weren't specified as allowed on creation,
then interpolates any macros, then calls Text::WikiFormat::format
(with the config set up when new was called) to translate the raw
Wiki language supplied into HTML.
write_node
my $written = $wiki->write_node($node, $content, $checksum);
if ($written) {
display_node($node);
} else {
handle_conflict();
}
Writes the specified content into the specified node in the backend
storage, and indexes/reindexes the node in the search indexes, if a
search is set up. Note that you can blank out a node without
deleting it by passing the empty string as $content, if you want to.
If you expect the node to already exist, you must supply a checksum,
and the node is write-locked until either your checksum has been
proved old, or your checksum has been accepted and your change
committed. If no checksum is supplied, and the node is found to
already exist and be nonempty, a conflict will be raised.
All parameters are mandatory. Returns 1 on success, 0 on conflict,
croaks on error.
Methods provided by storage backend
See the docs for your chosen storage backend to see how these work.
* delete_node (also calls the delete_node method in the search
backend, if any)
* list_all_nodes
* retrieve_node
* verify_checksum
Methods provided by search backend
See the docs for your chosen search backend to see how these work.
* search_nodes
SEE ALSO
CGI::Wiki::Store::MySQL
CGI::Wiki::Store::Pg
CGI::Wiki::Store::Database
CGI::Wiki::Search::DBIxFTS
Text::WikiFormat
Other ways to implement Wikis in Perl include:
* CGI::pWiki
* AxKit::XSP::Wiki
* UseModWiki
AUTHORS
Kake Pugh (kake@earth.li).
FEEDBACK
Please send me mail and tell me what you think of this. It's my
first CPAN module, so stuff probably sucks. Tell me what sucks, send
me patches, send me tests. Or if it doesn't suck, tell me that too.
I love getting mail, even if all it says is "I used your thing and I
like it", or "I didn't use your thing because of X".
I will buy beer or cider (one pint, litre, or similarly-sized bottle
of, not exchangeable for lager or other girly drinks, will probably
need to be claimed in person in whichever city I'm in at the time)
for the first three people to send me such mail.
CREDITS
Various London.pm types helped out with code review, encouragement,
JFDI, style advice, code snippets, module recommendations, and so
on; far too many to name individually, but particularly Richard
Clamp, Tony Fisher, Mark Fowler, and Chris Ball.
And never forget to say thanks to those who wrote the stuff that
your module depends on. Come claim beer or home-made cakes[0] at the
next YAPC, people.
[0] cakes require pre-booking
GRATUITOUS PLUG
I'm only obsessed with Wikis because of the Open-Source Guide to
London -- http://grault.net/grubstreet/