web server (pws) case study: pluggable
TRANSCRIPT
![Page 1: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/1.jpg)
Case Study: PluggableWeb Server (PWS)
Squeak: Object-orienteddesign with multimediaapplications
![Page 2: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/2.jpg)
9/19/00 Copyright 2000, Mark Guzdial 2
Building Web Applicationsand Interfaces
❚ Grabbing information off the Network❙ Sockets and protocols
❙ HTML and GIF/JPEG images
❚ Putting information on the Web❙ Starting the Pluggable Webserver (PWS)
❚ Creating user interfaces for the Web❙ Forms, Post, and “Servlets” in PWS
❚ Case study: Swiki/CoWeb
![Page 3: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/3.jpg)
9/19/00 Copyright 2000, Mark Guzdial 3
Accessing the Network
❚ Squeak provides access to Sockets❙ Note: One place where platform incompatibilities arise
❘ (Macs are whimpier network machines than others)
❙ Socket initializeNetwork “To start”
❚ Sockets support connection between two TCP/IPaddresses
❙ Each side gets to treat the other basically (but notexactly) as a stream
❚ Many uses don’t require Socket-level programming
![Page 4: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/4.jpg)
9/19/00 Copyright 2000, Mark Guzdial 4
Using Sockets to Accessthe Network
❚ Subclass of Socket provide high-level access to otherprotocols
❙ SimpleClientSocket is a general mechanismfor building clients (more later…)
❙ POPSocket/SMTPSocket enable emailaccess
❙ FTPSocket allows you to store and retrievefrom FTP servers
❙ HTTPSocket allows you to store and retrievefrom Web servers
![Page 5: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/5.jpg)
9/19/00 Copyright 2000, Mark Guzdial 5
FTPSocket Example
ftp := ServerDirectory new.
ftp server: 'cleon.cc.gatech.edu'. "host"
ftp user: 'guzdial'.
ftp password: 'fredflintstone'.
ftp directory: '/net/faculty/guzdial'.
ftp openFTP.
ftp putFile: (FileStream fileNamed: 'myfile') named:'remotefile'.
ftp getFileNamed: 'remotefile' into:
(FileStream fileNamed: 'myfile-downloaded') open.
ftp quit.
![Page 6: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/6.jpg)
9/19/00 Copyright 2000, Mark Guzdial 6
HTTPSocket Access
❚ To get a page:❙ (HTTPSocket httpGet:
‘www.cc.gatech.edu/index.html’) contents❘ httpGet: returns a RWBinaryStream
❘ contents returns the text
❚ To get an image:❙ (HTTPSocket httpGif:
'www.cc.gatech.edu/newhome_images/CoC_logo.gif') display “Returns a Form”
❙ HTTPSocket httpJpeg: ‘blah.jpg’
![Page 7: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/7.jpg)
9/19/00 Copyright 2000, Mark Guzdial 7
How Web Servers Work
❚ Client sends a request toa server as URL❙ URL specifies a server and
a protocol for access
❚ Server finds the file basedon the path in the URL
❚ Server returns the filespecified❙ HTML, GIF, whatever
http://www.cc.gatech.edu/index.html
Computer: www.cc.gatech.edu
index.html
server directory
![Page 8: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/8.jpg)
9/19/00 Copyright 2000, Mark Guzdial 8
Hyperlinks, Images areSame
❚ Embedded images, links, etc. inside theHTML page generate new serverreferences❙ <image src=“images/home.gif”>
❙ Means, “Now ask the (same) server for thehome.gif file under the images directory underthe server directory”
❙ Works the same way to references to otherservers
![Page 9: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/9.jpg)
9/19/00 Copyright 2000, Mark Guzdial 9
MIME Types
❚ How does the client (browser) figure outwhat’s in this stream of bits coming in?
❚ MIME Types: Standardized text string thatidentifies the type of the multimediamaterial❙ text/html is good ole HTML
❙ image/gif is GIF
❙ Check out your browser’s “Helpers” to seeother examples
![Page 10: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/10.jpg)
9/19/00 Copyright 2000, Mark Guzdial 10
Interface (CGI): A DifferentApproach
❚ Same basic structure, but instead of just sending the fileback, execute the file and send the result (HTML, GIF,whatever)
❚ How does the server know when to execute vs. send thefile?
❙ Typically, the server has a certain directory identified(e.g., in a configuration file) as a CGI directory
❙ For example,http://www.mycompany.com/cgi-bin/fred.pl
❚ How input gets to file, how file gets executed, howoutput gets collected is all platform dependent
![Page 11: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/11.jpg)
9/19/00 Copyright 2000, Mark Guzdial 11
Servlets: “Internal CGIs”
❚ A servlet is a piece of executable codethat lives inside the server (e.g., a module)
❚ Reference via URL is server-specific❙ Can be completely invisible to client if
response is from file or servlet
❚ Works the same as a CGI❙ Servlet returns some element back to the
client
![Page 12: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/12.jpg)
9/19/00 Copyright 2000, Mark Guzdial 12
Setting up the Squeak PWS
❚ For any server, tell it where the server directoryis❙ ServerAction class message serverDirectory
❙ Simply return the path
❚ Specific to PWS: Tell it to serve normal files❙ "Make the default server action be serving a file."
❙ PWS link: 'default' to: ServerAction new.
❙ "Start serving"
❙ PWS serveOnPort: 8080 loggingTo: 'log.txt'.
❙ “Stop it with PWS stopServer”
![Page 13: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/13.jpg)
9/19/00 Copyright 2000, Mark Guzdial 13
Ports, URLs, and Names
❚ That 8080 is a port❙ Typically, Web servers run on port 80
❙ On Windows and UNIX, Squeak users can’t typicallycreate a server at port 80, so do it elsewhere
❚ Finding out your machine’s name❙ NetNameResolver nameForAddress:
(NetNameResolver localHostAddress) timeout: 30).
❚ End URL❙ http://mymachinename:8080/whatever.html
![Page 14: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/14.jpg)
9/19/00 Copyright 2000, Mark Guzdial 14
PWS URL Parsing
❚ PWS keeps an actions table❙ Dictionary object with string keys and action object values
❚ When a URL enters the server, first word in path is usedas lookup in the table
❙ If the word is found, then the request is sent to theaction object as argument to process: message
❙ If word is not found, request is sent to action at‘default’ key
❚ The request is an instance of PWS❙ It contains the URL, the socket, and other information about the
request
![Page 15: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/15.jpg)
9/19/00 Copyright 2000, Mark Guzdial 15
PWS Serving Files
“ServerAction” process: request
| pieces |
self checkAuthorization: request.
pieces := self parse: request.
self log: pieces to: request.
self replyTo: pieces from: request.
![Page 16: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/16.jpg)
9/19/00 Copyright 2000, Mark Guzdial 16
Actual File Serving
“ServerAction” replyTo: pieces from: request
(StandardFileStream isAFileNamed: pieces)
ifTrue: [ “Return HTTP Protocol pieces first”
request reply: PWS success;
reply: PWS contentHTML, PWS crlf.
request reply:
(FileStream fileNamed: pieces)
contentsOfEntireFile]
ifFalse: [
request error: PWS notFound].
![Page 17: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/17.jpg)
9/19/00 Copyright 2000, Mark Guzdial 17
HTTP Protocol ResponseFormat
❚ First: Success, redirect, or error❙ PWS success, redirectTo:, notFound
❚ Second: MIME type❙ PWS contentHTML, content:
❙ MIMEDocument guessTypeFromName:,guessTypeFromExtension:
❚ Third slot, but typically, just CR-LF❙ PWS crlf
❚ Finally, content
![Page 18: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/18.jpg)
9/19/00 Copyright 2000, Mark Guzdial 18
PWS “Servlets”
❚ The action object doesn’t have to reference a file!
❙ Action can subclass ServerAction, but as long as itimplements process: doesn’t matter
“SillyAction” process: requestrequest reply: PWS success; reply: PWS contentHTML; reply:
PWS crlf.
request reply: ‘<html><head><title>Silly Page</title></head><body><p>This is a silly page!</body></html>‘
❚ PWS link: 'silly' to: SillyAction new.
❚ http://mymachine:8080/silly
![Page 19: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/19.jpg)
9/19/00 Copyright 2000, Mark Guzdial 19
Creating User Interfaceson the Web
❚ HTML defines a set of tags for forms and for userinterface elements within those forms
❚ A form references an “action” URL❙ Typically, a CGI script or servlet
❙ Something that can do something with the UI input
❚ When the form is submitted, the information from the UIelements are packed into the request to the webserver
❚ The input is made available to the script/servlet❙ How available is platform/language dependent
![Page 20: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/20.jpg)
9/19/00 Copyright 2000, Mark Guzdial 20
The Challenge of Web UI
❚ There is no state!❙ Server doesn’t “remember” you
❙ Everything carried from page-to-page must beembedded in the page, or recorded somewhere onthe server
❚ You can’t do dynamic updates (without usingapplets or JavaScript)❙ Server sends a page, user responds with a form
❙ User selections can’t immediately change the page
![Page 21: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/21.jpg)
9/19/00 Copyright 2000, Mark Guzdial 21
Specifying Forms in HTML
❚ <form></form> to define input form
❚ <input> to define an input field
❚ <select></select> to define a selection list
❚ <option> to define a list item
❚ <textarea></textarea> to define a textinput field
![Page 22: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/22.jpg)
9/19/00 Copyright 2000, Mark Guzdial 22
Sample Form
<html>
<head><title>Sample Input Form</title></head>
<body>
<h1>Sample Input</h1>
<form method=post action="http://mymachine/input.pl">
<p>Input examples:
<p>10-character text input:<input name="firstinput" type=textsize="10">
<p>Number:<input name="secondinput" type=int>
<p>Check it off:<input name="thirdinput" type=checkbox>
![Page 23: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/23.jpg)
9/19/00 Copyright 2000, Mark Guzdial 23
Sample Form, Part 2
<p>Select from:
<select name="fourthinput">
<option>Us
<option>Them
</select>
<p>Write comments:
<textarea name="fifthinput">
</textarea>
<p><input type=submit><input type=reset>
</form>
</body>
</html>
![Page 24: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/24.jpg)
9/19/00 Copyright 2000, Mark Guzdial 24
Result of Sample Form
![Page 25: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/25.jpg)
9/19/00 Copyright 2000, Mark Guzdial 25
Can also Select ScrollingList
<selectname="fourthinput"multiple=true>
<option>Us
<option>Them
</select>
![Page 26: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/26.jpg)
9/19/00 Copyright 2000, Mark Guzdial 26
Other Important Variations
❚ Can provide a name on the Submit buttonwhich appears on the button label❙ Default is “Submit Query”
❚ Can make hidden input fields❙ Can use these hidden input fields to carry
state (e.g., decisions/input from past pages)
![Page 27: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/27.jpg)
9/19/00 Copyright 2000, Mark Guzdial 27
How to Deal with the Fields inPWS
❚ The parsing of the HTTP request is donein PWS❙ In other languages, like Perl, this can be left to
the CGI/servlet
❚ The PWS request carries a fieldsDictionary❙ Key is name from form, value is input
❙ request fields at: ‘firstinput’
❙ Value is a string
![Page 28: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/28.jpg)
9/19/00 Copyright 2000, Mark Guzdial 28
Typical Input-Handling ActionProcess
❚ Figure out whatever you need from theinput forms❙ via request fields
❚ Compose HTML (or GIF or whatever)❙ Can compose raw strings, or use methods in
HTMLformatter
❚ Compose the HTTP response fields
❚ Return the composed content
![Page 29: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/29.jpg)
9/19/00 Copyright 2000, Mark Guzdial 29
...But There’s An Alternative inPWS
❚ EmbeddedServerAction is just like ServerActionin terms of serving files
❚ But if the served HTML contains Squeak insideof special tags, the Squeak gets evaluated andthe result is returned in the tag’s place
❙ <? ‘abc’, ‘def’ ?>
❚ PWS link: ‘embedded’ to:EmbeddedServerAction new❙ Now, HTML files in embedded directory under
serverDirectory has its tags evaluated
![Page 30: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/30.jpg)
9/19/00 Copyright 2000, Mark Guzdial 30
Example of Embedded Squeak
<html>
<title>Sample Embedded Page</title>
<body>
<h2>Welcome</h2>
<p>Today is <?Date today printString?>
<p>Now is <?Time now printString?>
</body> </html>
![Page 31: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/31.jpg)
9/19/00 Copyright 2000, Mark Guzdial 31
Single File CGI using PWS
<html><title>Factorial Calculator</title>
<body>
<form method="POST" action="factorial.html">
<p><b>Number to compute:</b><input type=text name="number"
value="<?request fields notNil
ifTrue: [request fields at: 'number' ifAbsent: ['0']]
ifFalse: ['0']?>" size=10 maxlength=10>
<p><input type=submit name="action" value="Compute Factorial">
<hr><p><b>Factorial</b>
<p> <?request fields notNil
ifTrue: [(request fields at: 'number' ifAbsent: ['0']) asNumber factorial]
ifFalse: ['nothing yet']?>
</form> </body> </html>
![Page 32: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/32.jpg)
9/19/00 Copyright 2000, Mark Guzdial 32
MVC on the Web
❚ Web interfaces can easily be structured like MVC❙ Controllers go away: That role is played by browsers and HTTP
❙ View objects can be responsible for formatting data for the Web andinterpreting user input
❙ Models are still the same
❚ But views predominate the interaction, and dependencies are lessimportant
❙ Who cares if a Model signals a change, if the View is handingthe Model the data and formatting the result?
❚ Then why do MVC? Separating the Model and the Viewis good engineering
![Page 33: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/33.jpg)
9/19/00 Copyright 2000, Mark Guzdial 33
Case study: Swiki/CoWeb
❚ Original WikiWikiWeb by WardCunningham❙ Also invented CRC Cards & Extreme Programming
❙ http://c2.com/cgi/wiki?WelcomeVisitors
❙ WikiWiki is Hawaiian Creole for “Quick”
❘ WikiWiki tour bus around Honolulu Airport
❘ Q: What’s the quickest way to make a website?
❘ A: Invite everyone on the Web to edit your pagesand create new ones
![Page 34: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/34.jpg)
9/19/00 Copyright 2000, Mark Guzdial 34
What is a Swiki?
❚ (Also called “CoWeb” for Collaborative Website, to avoid the 10minute story about Hawaiian creole…)
❚ A normal website, except that every page has an edit button❙ Click it, and you get a textarea containing the source of the page. Save
it to update the page with changes
❙ *AnyPageName* creates a link to a page of that title, creating the pageif it doesn’t already exist
❚ Other features: Recent Changes, attachments
❚ Recent enhancements in Comanche Swiki (not PWS-based)❙ History, more non-HTML enhancements, easier HTML entry, admin
tools
![Page 35: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/35.jpg)
9/19/00 Copyright 2000, Mark Guzdial 35
History of Swiki
❚ PWS was created as a tool for exploring collaborativespaces (by Mark Guzdial)❙ Based on a Squeak Webserver by Georg Gollman
❚ Swiki was created as an example application for PWS❙ Tried the original Wiki, but it disallows HTML and it’s in Perl,
which disappointed many of our potential users
❙ In use by almost 1000 Georgia Tech students in the very firstterm
❚ Swiki and PWS became part of the Squeak release inearly ‘98❙ Since then, an Open Source effort with use and fixes from all
over the world
![Page 36: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/36.jpg)
9/19/00 Copyright 2000, Mark Guzdial 36
Setting up a Swiki
❚ Download the Server files❙ http://guzdial.cc.gatech.edu/st/Server.tar
❚ Point PWS to the new serverDirectory
❚ PWS initializeAll “Installs everything”
❚ For each Swiki❙ Create a directory for the Swiki you want to create
❙ SwikiAction setUp: ‘NewSwikiName’.
❚ At startup time❙ SwikiAction new restore: ‘NewSwikiName’.
❙ PWS serveOnPort: 8080 loggingTo: ‘log.txt’
![Page 37: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/37.jpg)
9/19/00 Copyright 2000, Mark Guzdial 37
Swiki Class Structure
SwikiPage
nameaddressfiledatetimecoreIDusereditReqDateeditReqTimepageStatus
texttext:
URLmap
linkFor:from:storingTo:recentsearchFor:newpage:from:
1
formatter111 formatter111
HTMLformatter
specialCharacter
swikify:linkhandler:
SwikiAction
namesourceformatters
process:browse:from:edit:from:inputFrom:log:pageUrl:
urlmap
111
action
1
urlmap
111
map1
pages1..*1..*1..* pages1..*1..*1..*
![Page 38: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/38.jpg)
9/19/00 Copyright 2000, Mark Guzdial 38
Class Responsibilities:SwikiAction
❚ Handles the incoming request❙ Basically, URL structure defines the request
❙ SwikiName.[PageRef].[edit|versions]
❙ SwikiName.[searchResult|recent]
❚ Provides the HTMLformatter and thetemplate formatters (more later)
❚ Knows its directory where pages arestored
![Page 39: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/39.jpg)
9/19/00 Copyright 2000, Mark Guzdial 39
Class Responsibilities:URLmap
❚ Provides functionality over the set ofpages❙ Searching
❙ Recent Changes
❙ Creating new pages
❙ Finding all the links on a page
![Page 40: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/40.jpg)
9/19/00 Copyright 2000, Mark Guzdial 40
Class Responsibilities:SwikiPage
❚ Knows how to read and write self fromdisk❙ Via the text/text: accessors
❚ Knows all the information about aSwikiPage❙ time, date, name, IP address of last poster,
edit times to avoid conflicts, status of page
![Page 41: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/41.jpg)
9/19/00 Copyright 2000, Mark Guzdial 41
Class Responsibilities:HTMLformatter
❚ Handles the translation of Swiki-format into HTML❙ Including getting/creating new pages (via URLmap)formatter swikify: pageRef text
linkhandler: [:link | urlmap
linkFor: link
from: request peerName
storingTo: OrderedCollection new
page: formattedPage]
❚ Also handles intepreting Squeak in embedded HTMLpages which is how pages are formatted and served
![Page 42: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/42.jpg)
9/19/00 Copyright 2000, Mark Guzdial 42
How Pages are ActuallyServed
❚ There are templates in the Server/swikifolder
❚ Templates define look and feel of Swikipages
❚ Templates contain references to “request”(which in this case is the SwikiPage) forcreating URLs, filling in text, etc.
![Page 43: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/43.jpg)
9/19/00 Copyright 2000, Mark Guzdial 43
page.html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
<HTML>
<HEAD><TITLE><?request name?></TITLE></HEAD>
<BODY>
<font size=-1>
<a href="<?request url,'.edit'?>">Edit this Page</a> __________________
<a href="<?request map action name,'.1'?>">Back to the Top</a>
</font>
<HR><p>
<h2><a href="<?request url,'.searchresult'?>"><?request name?></a></h2>
<p><HR>
<?request formatted?><hr>
![Page 44: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/44.jpg)
9/19/00 Copyright 2000, Mark Guzdial 44
page.html Part 2
<font size=-1>
<a href="<?request url,'.edit'?>">Edit this Page</a>
<br><a href="<?request url,'.searchresult'?>">Search for References to thisPage</a>.
<FORM ACTION="<?request map action name,'.'?>searchresult"METHOD=POST>
Search for text in all pages:
<INPUT TYPE="text" NAME="searchFor">
<INPUT TYPE="submit" VALUE="Start Search">
</FORM>
<a href="<?request url,'.all'?>">Display this Page and all its References</a>
</font>
</BODY>
</HTML>
![Page 45: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/45.jpg)
9/19/00 Copyright 2000, Mark Guzdial 45
Critiquing Swiki’s Design
❚ Too much in class methods❙ PWS, HTMLformatter
❚ Wrong placement of some responsibilities❙ URLmap creates SwikiPages!
❙ Has made it hard to do variations of SwikiPages: protected,caching, rendering, etc.
❚ Not very flexible formatting
❚ Too much in-image❙ Only bad for our audience: Lots of non-Squeakers doing Swiki!
❚ Comanche Swiki fixes many of these
![Page 46: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/46.jpg)
9/19/00 Copyright 2000, Mark Guzdial 46
Evaluating Swiki in Actual Use
❚ In general, usability good❙ On several questionnaires across many
departments, people claim that they can usewithin five minutes
❚ Breadth of usability is so-so❙ Spring 2000: A ChemEng and Arch class
started using CoWebs
❙ Week 10: Arch had 1500 student-createdpages. ChemEng had zero.
![Page 47: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/47.jpg)
9/19/00 Copyright 2000, Mark Guzdial 47
Why people don’t Swiki
❚ Interviews help us understand why users mightnot use it
❚ Is the teacher there? If not, little benefit
❚ Why use it? Need activities that are worthwhileand encourage use
❚ Finally and Most Common: “Oh? It’s editable?”❙ If the activities (user task) doesn’t require editing,
users won’t learn the feature.
![Page 48: Web Server (PWS) Case Study: Pluggable](https://reader031.vdocument.in/reader031/viewer/2022021305/620736f849d709492c2f175c/html5/thumbnails/48.jpg)
9/19/00 Copyright 2000, Mark Guzdial 48
Summary
❚ Socket and its subclasses in Squeak allow for access tothe network across several protocols
❚ PWS allows pages to be served from Squeak
❚ Web user interfaces require use of <form> tags anddealing with the stateless client-server model of HTTP❙ But MVC is still useful as a paradigm here
❚ Swiki is a case-study of using Squeak for Web UI❙ Useful pieces: Actions, templates, HTMLformatter
❙ Usability is good (by questionnaire), but goals for softwareinteract with users’ tasks (discovered by interview)