![]() |
Web Development »
Applications & Tools »
Applications
Intermediate
OpenCollective -- The Requirements Management WikiBy Tyler JensenAn article on building a project oriented wiki for software development requirements management |
C#, Windows, .NET 1.1, ASP.NET, VS.NET2003, Dev
|
|
Advanced Search |
|
|
|
||||||||||||||||

A requirements management free source wiki for software development teams that takes advantage of the IHttpModule interface to support the .wiki file extension for each document in the wiki.
I wrote this application for use in the software development teams in which I participate because I was tired of the static nature of Word documents being passed around via email with no way to review and account for revisions and no way to understand the relationships of any given document with others in the project. The first incarnation used a standard plain text wiki editor and syntax for documents but it became clear that general users would not adopt this interface rapidly, so I switched to a free DHTML editor, eliminating all wiki-like editing syntax except the double [[ ]] brackets used for defining links.
The code was written using Visual Studio .NET 2003 in C#. It is organized into several projects within the solution. It relies on Windows authentication, so no user management is included except the management of a user's email address to which changes notices are sent. In addition to the source code, you will need to download and install the Data Access Application Block for.NET from Microsoft and the FreeTextBox control by John Dyer.
The code is written to rely on SQL Server 2000 (the SQL scripts for DB create and stored procedures and views are included), but you could certainly run it on MSDE 2000 or any other database. The OpenCollective.Data project would require modifications should you wish to use another database server.
The search feature will not work unless the index in the database is populated. There is a console application in the solution called OpenCollectiveIndexer which must be configured either via the app.config and then compile it (or via the OpenCollectiveIndexer.exe.config file directly). You must configure the connection string to your database.
On my installs, I just set a database job to run the OpenCollectiveIndexer.exe file once a day or once every few hours. The OpenCollectiveIndexer will then build your index and your search will then work properly.
Implementing an HttpModule is not difficult. In this case, I rewrite the path to the wiki.aspx page which handles all of the web page functionality of this wiki. The original URL is attached as a query string parameter in order to carry the project and document name in the request.
//
// Primary code for the HttpModule
//
private void context_BeginRequest(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
//OpenCollective.web/wiki/Software Docs/wiki.aspx?url=
//%2fOpenCollective.web%2fwiki%2fSoftware%20Docs
//%2fHome%2520Page.wiki%3ffiles
string url = app.Request.Url.PathAndQuery;
//?url=%2fOpenCollective.web%2fwiki%2fSoftware
//Docs%2fHome%2520Page.wiki%3ffiles
string qry = app.Request.Url.Query;
//OpenCollective.web/wiki/Software Docs/wiki.aspx
string page = app.Request.Url.AbsolutePath.ToLower();
//OpenCollective.web
string appPath = app.Request.ApplicationPath.ToLower();
if( url.ToLower().IndexOf( Config.ContentExtension ) > -1
&& url.ToLower().IndexOf( "/wiki/" ) > -1 )
{
if(qry.StartsWith("?url="))
app.Context.RewritePath(appPath + "/wiki.aspx" + qry);
else
app.Context.RewritePath(appPath + "/wiki.aspx?url=" +
app.Context.Server.UrlEncode(url));
}
}
The tricky part is in keeping the non-existant .wiki page in the address bar of the browser. The page is rendered by wiki.aspx and would normally post back to the wiki.aspx page. That would ruin the illusion of having a real .wiki page living on the server. The only way that I have been able to figure that out is to have javascript rewrite the action attribute of the form element in the page.
So the body tag is set to run on the server side in which I set the onload attribute as follows:
//
// Change the page to which ASP.NET form will post - code behind
//
string origPage = appUrlPath + "/wiki/" + wikiName +
"/" + topicName + ".wiki" + origQry;
//remap the action tag to the original qry
//string to preserve navigation
pgBody.Attributes["onload"] = "SetAction('" + reqUrl + "');";
And then a simple JavaScript called SetAction rewrites the URL to which the form will post.
//
// client side javascript
//
function SetAction(url)
{
document.forms[0].action = url;
}
While I have written other wikis, this is the first that has taken on so much. I plan to continue to upgrade the code and will post revisions here.
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 9 Nov 2004 Editor: Nishant Sivakumar |
Copyright 2004 by Tyler Jensen Everything else Copyright © CodeProject, 1999-2009 Web16 | Advertise on the Code Project |