WIKI USING ASP.NET

Preview:

Citation preview

WIKI USING ASP.NET

by

MOHAMED ASKAR KADER SHERIFUDEEN

B.E, Madurai Kamaraj University, India, 2003

A REPORT

submitted in partial fulfillment of the requirements for the degree

MASTER OF SCIENCE

DEPARTMENT OF COMPUTING AND INFORMATION SCIENCES

COLLEGE OF ENGINEERING

KANSAS STATE UNIVERSITY

Manhattan, Kansas

2005

Approved by:

Major Professor

Daniel Andresen, Ph.D.

ABSTRACT

A Wiki is a collaborative website whose content can be edited by anyone who has access

to it. It helps to keep the content of the webpage up-to-date. It provides one of the

powerful ways of collaborating on the web.

The objective of this report is to present a Wiki which was built using asp.net.

The main features of the project include the users can create new web pages and can edit

the existing pages, e-mail notification to the users when some topic is changed in the

web, adding images to the current web pages, uploading files from the browser and

creating links to an uploaded file, previous versions of the page can be retained, a change

log which helps to view the recent changes in the web, the text formatting rules used are

simple and easy to learn, and an advanced search feature.

i

TABLE OF CONTENTS

LIST OF FIGURES ......................................................................................................... iii

ACKNOWLEDGEMENTS ............................................................................................ iv

1. Introduction..................................................................................................................1

1.1 Wiki ................................................................................................................................ 1

1.2 Objective ........................................................................................................................ 1

1.3 Target Audience ............................................................................................................. 1

1.4 Literature Reviews ......................................................................................................... 2

2. Overall Description......................................................................................................3

2.1 System Architecture ....................................................................................................... 3

2.2 Database Design ............................................................................................................. 5

2.3 Functionalities ................................................................................................................ 6

2.4 Control Flow................................................................................................................... 9

2.5 Design........................................................................................................................... 10

3. Testing.........................................................................................................................16

3.1 Microsoft Application Center Test............................................................................... 16

3.2 ANTS Load Test .......................................................................................................... 18

3.3 Snap Shots .................................................................................................................... 21

3.4 Problems Faced ............................................................................................................ 26

3.5 Lessons Learnt.............................................................................................................. 26

4. Future Work...............................................................................................................27

5. Conclusion ..................................................................................................................28

5.1 User Manual ................................................................................................................. 29

ii

5.2 References .................................................................................................................... 31

iii

LIST OF FIGURES

Figure 1: System Architecture ............................................................................................ 3

Figure 2 : Database Design ................................................................................................. 5

Figure 3 : Control Flow....................................................................................................... 9

Figure 4 : Use Case Diagram ............................................................................................ 12

Figure 5 : Class Diagram .................................................................................................. 14

Figure 6: Sequence Diagram............................................................................................. 15

Figure 7: Microsoft Application Test Center Results ....................................................... 17

Figure 8 : (i) Ants Load Test Results ................................................................................ 19

Figure 9 : (ii) Ants Load Test Results............................................................................... 20

Figure 10 : Wiki View Page.............................................................................................. 21

Figure 11 : Wiki Edit Page................................................................................................ 22

Figure 12 : Wiki Recently Edited Topics Page................................................................. 23

Figure 13 : Wiki History Page .......................................................................................... 24

Figure 14:Wiki File Page .................................................................................................. 25

iv

ACKNOWLEDGEMENTS

I would like to thank Dr.Daniel Andresen for his valuable guidance in the development of

this project. I would also like to thank my committee members Dr.Bill Hankley and

Dr.Mitchell Neilsen for supporting me to work in this project.

1

1. Introduction

1.1 Wiki

A Wiki is a collaborative website whose content can be edited by anyone

who has access to it. It is a website where the pages can be changed and published

instantly using only a web browser. It automatically creates and links web pages together.

1.2 Objective

The objective of this report is to present a Wiki which was built using

asp.net. The main features of the project include creation of new web pages, editing the

content of existing pages, e-mail notification to users when some topic changes in the

existing web pages, adding images to the existing web pages, uploading files from the

browser and creating links to an uploaded file, retaining previous versions of the page, an

event log which helps view the recent changes to the web pages, an advanced search

feature and text formatting rules that are simple and easy to learn.

1.3 Target Audience

This web application will enable the employees of Kansas State Research

and Extension to share their ideas quickly and easily.

2

1.4 Literature Reviews

There have been many wiki websites created in asp.net. Below I discuss

two papers that describe the history of wiki and some of its previous implementations.

[9] discusses the history of wiki. Ward Cunningham founded the first wiki

on March 25 1995. “Wiki Wiki” is a Hawaiian term meaning quick. Hence wiki means

quick web site. Portland Pattern Repository was the first wiki web site. It has more than

26,000 topics that cover large areas of interest and most of them are related to software

development. It is also a great resource to learn about wiki websites in general. There is

an online encyclopedia that uses the wiki concept called wikipedia. It has over 1,75,000

topics.

[9] discusses an implementation of wiki. This version of wiki called the

“dotwiki” was implemented in vb.net and uses sql server as the database. Dotwiki

provides a full-text search which allows sophisticated text searches where one can find

variations of a word and rank the results. Sql Server provides a full text service which

helps perform this operation.

[10] provides an open implementation of wiki called the “Twiki”. This

project is a cgi script written in perl. It is installed on many websites, mainly behind

corporate firewalls. One can join the Twiki team and make contributions to the site. It

uses server side plug-in modules to enhance functionality. One can create Perl Plugins

using the Twiki Plugin API.

3

2. Overall Description

2.1 System Architecture

Figure 1: System Architecture

4

Technologies

a) Microsoft Visual Studio .NET

The .NET framework is the infrastructure for the new Microsoft .NET platform. It is a

common environment for building, deploying, and running web services and web

applications. It contains common class libraries, such as ADO.NET, ASP.NET and

Windows Forms, to provide advanced standard services that can be integrated into a

variety of computer systems.

It is language-neutral. Currently it supports C++, C#, Visual Basic, JScript, and COBOL.

Third-party languages, such as Eiffel, Perl, Python, Smalltalk, and others, will also be

available for building future .NET framework applications.

The new Visual Studio.NET is a common development environment for the new .NET

framework. It provides a feature-rich application execution environment, simplified

development, and easy integration between a number of different development languages.

b) Oracle 10g

The database server is Oracle 10g. It is robust and web-enabled. It offers easier fine

tuning to serve the required purpose. It provides the most powerful database for secure,

reliable, high-capacity Internet applications, data warehouses, and e-commerce websites.

5

It is highly scalable. It scales to support the most demanding, high-throughput

applications. It reduces the complexity of administration. It can manage the multimedia

content directly. It provides complete data protection by means of Oracle Data Guard.

2.2 Database Design

Figure 2 : Database Design

The wiki_topic table contains all the information about the topics. The wiki_topic_id is

the primary key. The wiki_file table is used to store the images and files. The file_id is

6

the primary key. The wiki_Mail table is used to store the mail addresses of the users.

The mail_id is the primary key.

2.3 Functionalities

The main features of the project are

1) Creation of new pages:

The user can add new topic himself. To create a page he has to create a

new link from the index page. Once he clicks the link, he is redirected to the edit

page where he can add the content for the page. Simple Editing tips are provided in

the Edit page to help him in the creation of the page.

2) Editing the existing topics:

The user can edit the content of the existing page. To edit a web page he

has to click the edit link which is present in the top of the page. Once he clicks the

edit link, he is redirected to the edit page where he can edit the content of the page.

3) E-mail notification to the user:

Once the user creates a new page or when he do a major revision for

the existing page an e-mail is sent to all the users notifying the change in the wiki.

The e-mail is sent to all the users using the Simple Mail Transfer Protocol.

7

4) Adding images to the web pages:

The user can add images to the page from the edit page. A list of

images which is present in the database is populated in the dropdown box. He can

add images at the desired position using the editing tips. He can also resize the image

and link an URL to the image using the editing tips.

5) Creating links to an uploaded file:

The user can create a link to an uploaded file from the edit page. A

list of uploaded files which is present in the database is populated in the dropdown

box. He can add links to the file in the page using the editing tips.

6) Revision Control:

When a user checks the revision box in the edit page, a new revision

is created for that page. The old revision is also stored in the database, while the

latest revision is shown in the page. He can also view the old revision of the pages by

clicking the History link.

7) Viewing Recent Changes:

The user can view the recent changes in the Wiki by clicking the

Recent link. The user can specify the number of days for which he wants to view the

changes. The author of the topic and the time on which the topic was changed is also

displayed.

8

8) Advanced Search Feature:

The user can enter the keyword, which he wants to search in the

search box. If the keyword is present in any of the topic, then the title of the topic

with the time when it was last updated is shown in the search results. He can also

view the topic which starts or ends like the title of the current topic by clicking the

Like link.

9) Simple Editing Tips:

The editing tips used are simple and easy to learn. For example if

he wants to create a new link, all he wants to do is to place an underscore in the title

of the topic from the edit page. The wiki automatically creates a new link in the view

page. The editing tips can also be easily changed according to the convenience of the

user. The user has to click the ‘Editing tips’ link to view the tips from the edit page.

10) File Manager:

The user can upload the files and images to the database from the

file manager. He can rename the file and also delete a file from the browser. The

date in which the file was uploaded and the size of the file can also be viewed. One

cannot have two files with the same name and cannot delete a file if it is used

currently by any topic. One can also view the file and the images by clicking the view

link in the file manager.

9

2.4 Control Flow

a.) User:

Figure 3 : Control Flow

The user must enter his username and password to access the site. If he types in the

incorrect data, he is again redirected to the same page. Once he enters the correct data, he

can add a new topic or edit an existing topic. He can also search the wiki site by

providing any specific keyword. He can log off once he is done with his activities.

10

2.5 Design

a) Use Case Diagram:

The use case diagram shows the functionality of the system in a horizontal

way. The primary elements are termed as “actors” and the processes are called as

“use cases”. The use case diagram shown in figure 4 shows how actors interact with

each use case.

Actors for Wiki:

• User – County Agent , Professors, employees

Use Cases for a Wiki:

• Create and Edit new pages – The user can create and edit new web pages

from the browser using the editing tips.

• View History and Recent Changes – The user can view the history of the

topics and he can view the recent changes that took place in the Wiki by

specifying the number of days.

• Upload files and images – The user can upload files and images from the file

manager. He can also rename and delete a file.

• Search Topic - The user can search for topics in the database by specifying

the keyword in the search box.

11

System Boundary:

The limits of the system are defined by the system boundary of a use case diagram. It is

shown as a rectangle containing all the use cases. Wiki is the system boundary for the use

case diagram shown in figure 4.i.e all the use cases are limited within this boundary.

12

Figure 4 : Use Case Diagram

13

b) Class Diagram:

The class diagram gives a pictorial representation of the system design. It

is a diagram showing the collection of classes and interfaces along with the

relationships among classes and interfaces. There are 7 aspx pages which form the

main classes in the class diagram shown in figure 5. The class wikiDb shown in the

figure is used for database access. The figure 5 shown below depicts the class

diagram for Wiki.

14

Figure 5 : Class Diagram

15

c) Sequence Diagram:

The sequence of actions that occur in a system is depicted by a sequence diagram.

The sequence diagram captures the invocation of methods in each object, and the

order in which the invocation occurs. The sequence diagram easily represents the

dynamic behavior of the system. The sequence diagram in figure 6 shows a scenario

in which the user edits a topic. It also shows how the user views the history of the

topic and searches the database.

Figure 6: Sequence Diagram

16

3. Testing

3.1 Microsoft Application Center Test

The application center test helps to gather some performance information on the web

applications. Tests were created to simulate several users’ simultaneously requesting

pages from the web application. These simulations helped to determine the stability,

speed, and responsiveness of the application.

Discussion of Results:

Figure 7 shows a list of results generated after the test. Two hundred users were simulated

during this test. The duration of the test was 5 seconds.

The test result showed that even when the number of users increased, the application was

stable. It also proved that there was no HTTP, DNS, or socket errors. Socket errors are

caused when the Simple Mail Transfer Protocol fails to deliver a mail. There were no

connection or timeout errors.

The average time to first byte is little bit higher because of the time it needed to connect

to the database. There were 6 unique request made to the database during this test. For

each request a separate connection is made to the database.

The number of bytes received is higher than the number of bytes sent. This is due to the

fact that images and files were requested from the database while generating scripts for

the test. Hence the average rate of received bytes is higher than the average rate of sent

bytes.

17

Figure 7: Microsoft Application Test Center Results

18

3.2 ANTS Load Test

ANTS Load is a tool which helps to perform load testing on the web application. It

works on all .NET applications. It can generate the scripts automatically. It has the

ability to test XML web services. It finds out the fastest and the slowest objects in the

web application. This helped to eliminate the slowest unnecessary objects in the web

application. It also finds the fastest and the slowest pages in the web application. This

helped to make the slowest page a little bit faster.

Discussion of Results:

Figure 8 gives a detailed list for all the objects in the page about the time to connect, time

to first byte, time to last byte, and the bytes received. The “getimage.aspx” takes large

amount of time since the bytes received for an image in this page is higher. Hence the

time to first byte and the time to last byte are higher for this page compared with other

pages in the application.

Figure 9 shows a graph describing the time to connect for all the web pages in the

application. The graph shows that most of the pages require less than 50 milliseconds to

connect. Some small proportions of pages require 50 to 100 milliseconds to connect. This

shows that the application is faster.

19

Figure 8 : (i) Ants Load Test Results

20

Figure 9 : (ii) Ants Load Test Results

21

3.3 Snap Shots

Figure 10 shows the picture of wiki view page where the user views the current topic. The

view page contains link for all the other pages in the site. It contains the search box where

the user can search for a specific keyword. The title of the topic is displayed in the view

page.

Figure 10 : Wiki View Page

22

Figure 11 shows the picture of the wiki edit page where the user edits the content of the

topic. The user can change the author name from the edit page. There are two dropdown

boxes to view the images and files present in the database. One can also click the revision

box to create new revision.

Figure 11 : Wiki Edit Page

23

Figure 12 shows the picture of the wiki recent page where the user can view the recently

edited topics. One can change the number of days for which he want to view the results.

The link to the topic with the author and the last updated time is displayed in the results.

Figure 12 : Wiki Recently Edited Topics Page

24

Figure 13 shows the picture of the history page where the user views the history of the

topic. The link to the previous revisions of the topic with the author and the last updated

time is displayed in the results.

Figure 13 : Wiki History Page

25

Figure 14 shows the picture of file manager page where the user can upload and delete a

file. One can also rename a file and view the file by clicking the name of the file. The

date when the file was uploaded and the size of the file is displayed in the search results.

Figure 14:Wiki File Page

26

3.4 Problems Faced

I was building this application with a fast internet connection. Therefore, I was unable to

know how this application will work in the County Extension Office where the internet

access is through a dial-up connection.

I was using java script to open and close the window for showing the Editing tips. The

size of the window varied according to the settings in the individual computers.

3.5 Lessons Learnt

I have learnt how to convert the plain text into an html output. I used the .Net Regular

Expression Class to perform this operation. Each editing tag requires one regular

expression. I used the MSDN guide to build the regular expressions.

I have learnt how to store and retrieve images and files from the database. The images

and files are stored in the ‘blob’ field in the database. Before storing the image it is

converted into a byte stream.

I have learnt how to send mass e-mails using the Simple Mail Transfer Protocol. .Net

provides a ‘mail’ class which helps to perform this operation.

I have learnt how to do performance testing and load testing on the .Net applications. One

can learn about these tools from [7] and [8].

27

4. Future Work

Since any one can edit any page, the wiki site could create a security risk. The users could

delete text or change the meaning of the sentence. Even though the previous versions of

the page can be retained, we need some powerful way to keep the contents of the page

secure.

One possible solution is by defining groups and imposing read and writes access

restrictions based on the groups and users.

28

5. Conclusion

Wiki web sites help to promote collaboration. If we consider the web logs the

information goes one way whereas a wiki provide a two-way communication channel in

which everyone is an author and a reader. The user just needs a browser and an internet

connection to visit a wiki site and contribute. He does not need a text editor or software

to use a wiki.

Wiki was built using Asp.net that provides a good user interface. It helps to build faster

web application by reducing the amount of code required to build large applications. It

makes development simpler and easier to maintain.

The motivation for building the wiki site came by looking at the Wikipedia. It is an

online encyclopedia that uses the wiki concept. It contains over 1,75,000 topics in its site.

Hence, I hope that this wiki site will be helpful for all the employees of Kansas State

Research and Extension in providing a flexible, powerful, and easy to use collaboration

platform.

29

5.1 User Manual

These are the steps one has to follow to set up a wiki website in their own web server and

database.

• Run the Script files in the Oracle to create the necessary tables, triggers,

sequences, procedures and packages. The script files are placed in the scripts

folder.

• Create a project space in the server and place the “wiki” folder in the server.

• Change the database server name in the web.config file to that of your database

server name.

• Change the ID and Password in the web.config file to that of your database id and

password.

• Change the default topic name in the web.config file. This topic will become the

welcome page of the wiki.

• Set the start page of the project as default.aspx.

• Build the project in the .Net environment and run the project.

• Now the wiki is set up in your server and anyone can access it from the web

browser.

• To add new topics create a link from the edit page. Then follow the link to add

contents to the topic using the editing tips.

• The editing tips can be viewed from the edit page. Once the content is added click

the save button. Now the topic can be viewed from the view page.

30

• To edit a topic follow the edit link. For a new revision just click the revision box.

A new revision for the current topic is created. If the revision box is not checked

then the changes are saved in the current revision itself. The old revision can also

be viewed from the history link. List of uploaded files and images can also be seen

from the dropdown box.

• To view the recent changes in the wiki follow the recent link. Then specify the

number of days to view the recent changes and click submit. All the changes in

the wiki are displayed.

• To view the previous versions of a topic follow the history link. All the versions

of the current topic are displayed.

• To perform topic search follow the like link. All the topics which starts like and

ends like the current topic are displayed with the author name and time when it

was last updated.

• To perform file operation follow the file link. Use the browse button to locate a

file and upload button to add the file to the database. To view the uploaded files

click the name of the file. To rename the file click the rename button. Checks are

done to make sure that two files cannot have the same name. To delete a file click

the delete button. Files and images cannot be deleted if it is currently used by a

topic.

• To search for a keyword use the search box present in the view page. All the

topics which contain the keyword are displayed.

31

5.2 References

[1] Nikhil Kothari & Vandana Datya ,“ASP.NET Server Controls and Components”,

2002.

[2] Mandar Chitnis, Pravin Tiwari, Lakshmi Ananthamurthy. “Creating Use case

Diagrams “, developer.com, http://www.developer.com/design/article.php/2109801

[3] Mandar Chitnis, Pravin Tiwari, Lakshmi Ananthamurthy. “The UML Class

Diagram”, developer.com, http://www.developer.com/design/article.php/22067915.

[4] Mandar Chitnis, Pravin Tiwari, Lakshmi Ananthamurthy. “Sequence Diagram in

UML“, developer.com, http://www.developer.com/design/article.php/3080941.

[5] W3Schools, ”Introduction to Microsoft Visual Studio .Net” ,

http://www.w3schools.com/ngws/ngws_intro.asp.

[6] Jonathan Hodgson, “Using a Wiki For Knowledge sharing and sql server

documentation “, http://www.codeproject.com/asp/wiki.asp

[7] Microsoft , ”Regular Expression Language Elements” ,

http://msdn.microsoft.com/

[8] Red-gate, ”Load Testing For .Net Developers and Testers” ,

http://www.red-gate.com/dotnet/load_testing.htm

[9] Hector J Correa, “ Building Wiki Websites with Asp.net and Sql Server”,

http://www.code-magazine.com/Article.aspx?quickid=0403081

[10] Peter Theony, “ What is Twiki”, http://twiki.org