Forge: Wiki

By

November 27, 2008

Thanks to the inclusion of the {EncodeWiki} formatter, the ability to use Wiki syntax, similar to that of Wikipedia is available for any type of configuration, so to start out - we have built a complete wiki application with all the standard bells and whistles.

 

Wiki Overview Video
Review the information provided within this Wiki article by watching the "Wiki Overview" video.


Click here to learn how to Build the Wiki from Scratch

How it was made

The WIKI module began with a few basic known principles, which provide the essential quideline for what defines a Wiki, and how it is supposed to be used within a Social Network. We began with the following requirements:

Initial Requirements

Topic

Each content piece is based on a specific Topic, meaning that the Topic itself will act as the primary key for retrieving the content.

Link

Using the Wiki Syntax for "Links", each topic will be replaced when the content is updated, with a Url that provides simple navigation from one topic to another.

Version History

Whenever a topic is added, or updated, a record should be maintained that keeps track of each of the previous versions. The history will ultimately be used for a roll back purpose. In this initial release, however, no administrative or moderator screens are provided for this aspect. The version *IS* recorded, but is simply not administered.

Comments

All Wiki providers appear to support commenting on the topics. The Comments on most systems are not real-time - meaning that a postback is required for the comment to be displayed, and to see new comments a refresh must be requests. Taking direction from the Chat Project, the Wiki comments should be realtime and simple to review. Additionally, they need to be optionally displayed.

Ratings

Because it is difficult to know at times whether a particular topic is meeting the needs of the users, the users must have the ability to provide a rating (1 through 5). The rating should be instantly handled and the aggregated rating should always be displayed.

Database Structure

The database structure provided for the Wiki, includes a set of tables for the storage and runtime, as well as a procedure, specifically  for handling the comment list interaction, that script is provided as follows:

CREATE TABLE [OWS_Wiki_Comments](
	[WikiCommentID] [int] IDENTITY(1,1) NOT NULL,
	[WikiID] [int] NULL,
	[Comment] [nvarchar](1000) NULL,
	[Name] [nvarchar](100) NULL,
	[Email] [nvarchar](100) NULL,
	[Ip] [varchar](16) NULL,
	[CommentDate] [datetime] NULL
) ON [PRIMARY]

CREATE TABLE [OWS_Wiki_Rating](
	[WikiRatingID] [int] IDENTITY(1,1) NOT NULL,
	[WikiID] [int] NULL,
	[Rating] [int] NULL,
	[RatingDate] [datetime] NULL
) ON [PRIMARY]

CREATE TABLE [OWS_Wiki](
	[WikiID] [int] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](255) NULL,
	[Topic] [nvarchar](50) NULL,
	[Content] [ntext] NULL,
	[Cache] [ntext] NULL,
	[Rating] [int] NULL,
	[AllowRating] [bit] NULL,
	[AllowComments] [bit] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

CREATE TABLE [OWS_Wiki_History](
	[WikiHistoryID] [int] IDENTITY(1,1) NOT NULL,
	[WikiID] [int] NULL,
	[Title] [nvarchar](255) NULL,
	[Topic] [nvarchar](50) NULL,
	[Status] [varchar](10) NULL,
	[Content] [ntext] NULL,
	[Cache] [ntext] NULL,
	[Rating] [int] NULL,
	[AllowRating] [bit] NULL,
	[AllowComments] [bit] NULL,
	[UpdatedBy] [nvarchar](100) NULL,
	[UpdatedDate] [datetime] NULL,
	[UpdatedUserID] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

Create procedure [OWS_Wiki_List](@WikiID int, @LastPostID int)
AS

	if isnull(@LastPostID,0) <= 0
	--TOP 10
		Select top 10 
		WikiCommentID,
		CommentDate,
		replace(
			replace(
				replace(
				Comment,'\','\\'),
			char(10),'\n'),
		char(13),'') Comment,
		Name,
		Email,
		Ip 
		from 
			ows_wiki_comments
		where WikiID=@WikiID
		order by WikiCommentID desc
	else
		--SINCE LAST REQUEST
		Select 	
		WikiCommentID,
		CommentDate,
		replace(
			replace(
				replace(
				Comment,'\','\\'),
			char(10),'\n'),
		char(13),'') Comment,
		Name,
		Email,
		Ip 
		from 
			ows_wiki_comments
		where WikiID=@WikiID and WikiCommentID > @LastPostID
		order by WikiCommentID desc
GO

Configuration

The OWS Wiki is made up of three separate modules -

Wiki

This controls the complete look and feel of the wiki, and includes the interaction for Add / Edit and Rating.

Wiki Settings

This interface provides the ability to assign a default Topic to the Wiki module. This was a new feature, as discussed later in the article.

Wiki Comments

The commenting functionality of the Wiki is featured as an Add On to the page, so it is not required. The full interaction and binding of the comments to a wiki topic is controlled with this configuration.

New Features

The initial requirements were of course extended over time to fullfill other needs within the Open Web Studio site, and the current version now includes these additional behaviours:

Page Topics

When a Wiki module is placed on a web page, a setting should be provided to allow for a default topic. These default topics will be automatically replaced within the Wiki Syntax, so that a topic link will either be a relative link, or a fixed link to a page.

This added an additional table, called OWS_Wiki_Tab which associates a Tab with a Wiki topic:

 CREATE TABLE OWS_WIKI_TAB(WikiID int, TabID int) 

Layout

The formatter provides the ability to override the standard layouts, and therefore these should be extended to allow for a more robust theme - extending the sidebars, and general handling.

How To Wiki

To provide a better overview of how the Wiki module works, take a look at the definition of the content tokens available in this wiki:How to Wiki?

Average (0 Ratings):
 
Want to help out?
 
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • info@openwebstudio.com

Bookmark & Share Bookmark and Share