|
Using the SimpleWiki componentIntroduction SimpleWiki is a component that allows you to add a
wiki-style section to your BIF based website. If you don't know
what a wiki is, I recommend you reading
this explanation
(http://c2.com/cgi/wiki), you won't regret it as wiki are a
wonderful tool to create collaborative websites.
The short explanation is: SimpleWiki enable your users to
collaborate with contents on any section of your website, by
showing them a simple editing and viewing interface on the same
web browser.
Setting up SimpleWikiYou have to do almost the same task for every component you
add to your BIF website, first you should define an instance of
the SimpleWiki class on the mapping.txt file,
like this:
wiki:SimpleWiki(wiki/;IndexPage;600;172800) |
As you should know, the first word, wiki,
is the SimpleWiki instance's name, the constructor takes 4
arguments: first the path to the content directory, this directory
should have the right permissions to let the webserver write the
necessary files. Second, the name of the index wiki page and it
should be in WikiWord format, it defaults to 'IndexPage'. Third,
the page locking timeout in seconds; it's used to protect a wiki
page and prevent a user to edit it while other user is editing it
too. Last argument, the time a wiki page modification is
considered to be new, in seconds too.
Once you save the mapping.txt file with
the new entry, you should add the instance to some part of your
website, this can be done by editing a .bif file like this:
<bifroot>
<bifinclude src="component://wiki" />
</bifroot> |
Then, you can include and render this file using some PHP
code like this one:
<?php
include_once('bifConfig.inc');
$root =& render_file('wiki.bif');
echo $root->draw();
?> |
That should do the trick. SimpleWiki will create a default
index wiki page so you can start working with it.
Additional software requirementsSimpleWiki needs RCS to be installed on your system so it
can make versions of any changes you make to your wiki pages. RCS
should be installed by default on most GNU/Linux distributions, so
I suppose this is not a problem, but I think is important to make
this note.
Using SimpleWikiThe user interface of SimpleWiki is very... simple :)... if
you know how to use a wiki. If you don't know, please refer to the
link on the top of this tutorial.
Basically, the UI is divided in 3 parts, the upper part is the
action bar, the middle part is the content space and the lower part is
the status bar. On the top the component shows different actions
depending on the mode the wiki is: content view, content edition,
pages list or diff view.
The content view mode is the normal reading mode of
SimpleWiki, the content of the actual wiki page is showed after
being properly rendered by the component. Here you can click on
WikiWords that will lead you to other wiki pages. Also you
can edit the page to add or modify content at will. The "Site Map"
link will show a list of all the existing wiki pages, with the
newer ones listed on top so you can check if there was new
modifications easily. The "View Diffs" link will show you all the
modifications that the actual wiki page had suffered, you can you
this mode to revert the state of the wiki page to some previous
version, if you feel that someone made a mistake or delete
something useful.
The content editing mode is the way the user has to modify
or add new content to the wiki page. When you enter on this mode,
the wiki page is locked by the componente, generating a locking
code that only you have, so no one can edit that wiki page until
you release the lock or the lock timeout expires. SimpleWiki uses
a basic (subset) syntax based on TWiki's syntax, so you can learn how to
use it reading from TWiki's website.
How do you create new wiki pages? You have two ways, one by
writing it on an existing wiki web, so that the component will
give you the option to create it by showing a question mark (?)
next to the WikiWord. After you put some content on that new wiki
page, the WikiWord will show itself as a link. The second way to
create a new wiki page is to write the WikiWord on the "Go:" text
field, si that the component will give you the opportunity to
create it.
Additional commentsSimpleWiki is not meant to be a complete wiki
implementation, it doesn't have user authentication, nor page
templates, etc...so you will have to live with that or write a
ComplexWiki component yourself ;-). Nevertheless it has the
essential features to make it useful, and it's so easy to add to
your existing BIF site that I think you should at least test it a
little.
This component was built to show the developers that with
components, BIF provides an excellent platform to develop mini
applications that can be embedded in a few minutes to your site
without effort. It is important to note also that the first
working implementation of this component took me about 16 hours of
coding...I think that's pretty fast! ;-).
If you have any comments you can contact me via
email(lucas_at_lunix.com.ar).
|