INF 123 Software Architecture, Distributed Systems & Interoperability

Assignment 3

Due date: Sunday, 4/25 by midnight

Your mission:

Improve the Wifi web application. Extra mission: contribute your code back to the open source project.

Even though you will be downloading the entire source code of OpenSim, this assignment does not involve changing the OpenSim simulator itself; just one of the addons, Wifi, a normal Web application.

This assignment can be done individually or in teams of 2 students.

Form of submission:

One zip file containing one text file with the answer to part 1 and your code for part 2. Name the zip file ID.zip, where ID is your student ID. If in a team, use one of your IDs, but make sure that the other student's ID is clearly stated somewhere inside -- for example in the text file with answers. Use EEE for submission.

Goal:

Necessary software components:

Additional components for Windows:

Linux/Mac users:

You can do this homework in Mac/Linux using the mono framework (instead of .NET) and MonoDevelop (instead of Visual Studio). However, I strongly recommend that you get a VM and run Windows for doing the homeworks in this course. You will have a lot less problems.

Additional component for Extra Credit:

Note to all students:

There are a few Windows computers the ICS computer lab that have SecondLife version 1.23, Visual Studio and Git already installed; they are the systems with the green markings on the following map of the CS 364 . This may save you some time, but you will learn less.

Part 1. (30 points)

Goal: understand HTTP in detail.

Resources that you may find useful:

In this part, you are going to have a direct conversation with an HTTP server. The HTTP server in question is the one serving the Wifi app in http://ucigrid03.nacs.uci.edu:9004/wifi, the application where you created an account for the Avalon virtual world in the previous homework.

Open a telnet connection to ucigrid03.nacs.uci.edu port 9004. Then issue HTTP requests that accomplish the following:

a) Get the main page

b) Login with your user name and password.

c) Get the form to edit your account

d) Change your email address

e) Logout

Deliverable: your part of the conversation with the Wifi application -- in a text file, included in the zip file. Please hide your password in this text using xxx instead.

Part 2. (70 points)

Goal: understand distributed hypermedia and REST style in detail.

Preliminaries:

1. Get the OpenSim+Wifi source.

Get the OpenSim Diva distribution from Github. You can get it in two ways: (a) if you don't plan to do the extra credit simply download the source as a zip file and unzip it somewhere; (b) if you plan to do the extra credit, clone the github repository on your own machine: git clone git://github.com/diva/diva-distribution.git

2. Build the project.

Note for those installing git in Windows: you must do this step in a native shell, Git Bash won't work.

In a terminal window, change to the diva-distribution directory and type:
$ runprebuild.bat (or runprebuild.sh, if in Mac/Linux))
This will produce an OpenSim.sln file, the "solution" file for Visual Studio/MonoDevelop.

Open OpenSim.sln with Visual Studio/MonoDevelop. You should see the entire source code of the OpenSim framework plus the diva distro addons, which start with "Diva." (see picture below). To build the project, right-click on the very top "Solution OpenSim" and choose "Build".

3. Get Wifi up and running.

Get the configuration file Inf123.ini and save it under diva-distribution/bin. Make sure it's readable, i.e. that it's has read persmissions.

In a terminal window, change to the bin directory under diva-distribution, and type:
$ OpenSim.Server.exe -inifile=Inf123.ini
You should see the initialization debug messages, with no errors.

To test your server, pull up your Web browser on the same machine and point it to http://localhost:8080/wifi. You should see the Wifi main page; interactions with it should work, starting with the installation step. Create the administrator account, and then create a normal account. Login/logout under both to understand the features available.

4. Study the architecture of Wifi.

Wifi uses the REST style of distributed applications; communications are done via GET and POST requests, where the path represents the resource to be accessed. For more information, please see this. Take time to explore the code, comparing it to what you see when you access the application with a Web browser.

Your work:

In this part you are going to implement one of the missing features. Once you familiarize yourself with the code, implement one feature among the list below. Choose one feature only, not all.

One of the main architectural decisions of Wifi itself, as a Web application framework, is this: "No code in html files and no html in the code". Your solution should follow exactly the software architecture of Wifi, that is: write your own handlers for the feature you chose, add whatever additional html files you need under WifiPages, and use WifiScript to pull data into them. Your C# code should not generate html.

Deliverable:

If you are not doing the extra credit, simply include the addon-modules and the WifiPages directories in your zip file. If you are doing the extra credit, read on.

Extra credit 1. (20 points)

Goal: understand how to operate in a large open source project.

To get the extra credit, simply submit your solution as a git patch file included in your zip file. We will then try to apply it. If there are no errors, and your contribution shows up clearly identified, you will receive the entire extra credit, even if you get penalties for the work itself (i.e. if you didn't complete the feature, or it has bugs, etc.)

Extra credit 2. (additional 30 points)

Goal: participate in a large open source project.

If you want, you can submit your patch for inclusion into the official diva-distribution project. For that, include a license file (LICENSE.txt) in your zip. Your license must be compatible with the BSD license of the project, so I recommend you use the BSD license itself.

Note that your willingness to do this is no guarantee that I will include your code in the project. Your code needs to work, and to be good and clean in order to be taken in. You will receive 10 points for trying and an additional 20 points if your code gets accepted.