CSC 241 Lab 1 (Due September 12th 1997)
HTML & Applets
Theme ...
This lab is designed to get you set up for the web and running applets.
In the process, you will learn to operate effectively in a SUN workstation
environment. You may already have a webpage, or you may not. Either way,
you need to make one for this course. Some of your programming assignments
and labs will have applet front-ends and you will make them accessible
through this webpage. This should help me find your applets quickly when
evaluating them or when helping you find your bugs. My
241 page will be linked to
yours once you complete this lab. Your web page for this course will consist
of a header, title, a little text, and some links. Feel free to add things
to it, but, please don't clutter it with graphics and things that don't relate
to the course.
You will first copy some important files, create some directories, and set
the needed protections to get things started. Once you get into OpenWindows
(openwin), you will make some modifications to your environment. The
next step is to fire up netscape and bring up this page. There are
several links in this
page that are only meaningful in a web browser. For example, part of the way
into this lab, you will bring up a webpage that you will copy from and paste
into an emacs window which you will also have open at the time,
effectively,
creating your webpage with a few key strokes. I could have just given you
the template to copy at the start, but, this is a good practice for handling
multiple windows. This lab ends with you copying an applet and making it
accessible from your page. Once you have completed all tasks, you will have
a web page like 241.html.
Don't forget to email me the correct URL for your page once you finish.
Follow these steps in order:
Copy dot-files:
- Login on a workstation
- cp .cshrc old-dot-cshrc
- cp .login old-dot-login
- cp .emacs old-dot-emacs--(don't worry if says `no such file')
- cp .Xdefaults old-dot-Xdefaults--(don't worry if says `no such file')
- cp /csclass/mohammad/sample-dot-cshrc .cshrc
- cp /csclass/mohammad/sample-dot-login .login
- cp /csclass/mohammad/sample-dot-Xdefaults .Xdefaults
- cp /csclass/mohammad/dot-emacs.summer96 .emacs
- Then logout and login again. Optionally, later edit any of these files
to include anything in your old versions, or in the various default
versions in /src/etc.
Creating necessary directories
You need to be in your home directory.
- mkdir public-html
- mkdir public-html/classes
- mkdir public-html/classes/csc241
Setting permissions
- chmod og+rx .--don't forget the dot
- chmod og+rx public-html
- chmod og+rx public-html/classes
- chmod og+rx public-html/classes/csc241
Set up your openwin environment:
- type openwin.
- get rid of default file manager and help tutorial by
Quiting them (not just Closeing). The Quit option is in
the File pull-down menu. The following steps will save the
current workspace settings and file manager and help tutorials won't load
automatically each time you start openwin.
- Click the right mouse button with your mouse pointer,
preferably, in the middle of your desktop. You will see the
Workspace menu.
- The second item in the menu is Utilities. Point/Click
that option, again use the right mouse button. You should now
see the save Workspace option.
- Choose the save Workspace.
- Adjusting Properties. especially the Set active Window
to move pointer in the Miscellaneous page. With this
switch, just moving your pointer into a window will make it active and
you won't have to click the mouse in the header of the window.
- Bring up Workspace menu again.
- Choose Properties. At the top of that window, you will
notice the word Category. Adjacent to that there is a menu
button with the word Color to its right.
- Click on the menu button.
- Choose Miscellaneous.
- Click on move pointer button.
- Click on the Apply button at the bottom of the window.
Netscape
- In the CMD tool window type: netscape &. The "&" is important here
as it starts netscape up as a separate subprocess leaving CMD tool
operating.
- Click Accept when Netscape starts up. Of course, if you have started
netscape on a workstation before, you won't have such a button to click.
- Bring up this lab by typing the following URL in the Location text
area:http://www.cs.oswego.edu/~mohammad/241/labs/lab1.html
- Use the scroll-bar on the right of the window to get to this portion of
the document. You shouldn't need the hard copy version from here on.
- For a few quick tips on HTML tags, you can follow the link to
Basic HTML Tags, but return to this page to continue
the lab.
Create 241.html
- get into your public-html directory.
- In the CMD tool window, type cd to make sure you are in
your main directory.
- cd public-html
- start emacs by typing emacs -fn 10x20 241.html &
- We have set up emacs to work in html-helper mode which starts
you with a template of an html file. For the purpose of this lab, you
can delete the template that appears. Ctrl-K deletes one line at
a time.
- In Your netscape window:
- Follow the link to sample.html.
- Starting from the line that has <html>,
highlight the content of that page. You highlight the same as you
do on a PC or a mac.
- From the Edit pull-down menu, pick copy.
- Now, move your pointer into your emacs window and press the Paste
button on your KEYBOARD.
- The only thing that you need to change is all occurrences of jdoe
with your account name.M-x replace-string could come in handy
here.
- Once your page is completed, save it(cntrl-x, s).
Make your page accessible to others
The following will take place in your CMD tool window:
- ls--(you should see "241.html" listed)
- chmod og+rx 241.html
Note: any subsequent files added to public-html or its subdirectories
must also have the permissions changed by using the chmod
command, if you want them to become accessible through the Web.
However, do not change permission on your .java files, if
they are intended for this course.
Testing your page
Type the URL http://www.oswego.edu/~your user name/241.html in the
Location text area of your netscape window. Your page should
load up in all its glory! Return to the lab1 page.
Note: You may come across pages on the Web that have features that you
like. If you want to see how they are implemented, you can use the
Document Source option in the Netscape's View pull-down menu.
This will show the html code generating the page. You can also save a web
page in your account via the Save As ... option available in the
File pull-down menu.
Make an Applet
I am assuming that you are in your public-html directory in your
CMD Tool window. pwd is the unix command that tells you where you are.
Type each of the following commands:
- cp /csclass/mohammad/public-html/hello1.java . -- don't forget the dot
- cp /csclass/mohammad/public-html/hello1.html . -- don't forget the dot
- javac hello1.java to compile hello1.
- chmod og+rx hello1.html to make the html file accessible.
- chmod og+rx hello1.class to make the .class file accessible.
Simply, go back to your 241 page and click on the hello1
link there. The Applet should load up.
Hand in
email the URL for you 241 page to
mohammad@oswego.edu, it should be
something like this: http://www.oswego.edu/~your_user_name/241.html