Loading a new Schedule-of-Classes
onto www.physics.ucsb.edu
Load schedule-of-classes one month before quarter starts and send the Head TA a message when it's done so they
can add assignments.
Requirements
- Access to a STAR01 account on Complete. The Undergraduate Assistant will
have this if you don't.
- Ability to run a tn3270 application that allows screen logging to a file.
(x3270 on Linux works).
- Xwin32 installed & In X-Util go into Options | Xhosts and Add elvis.physics.ucsb.edu
- A shell account on www.physics.ucsb.edu that has the ability to update the
physics postgres database. (PCS: su to postgres and run createuser)
- Create the directory on MCP ~username/web/schedule-of-classes. Copy over
the star_data.awk script and change permissions to make executable.
- Map user directory to H:
- Configure SecureCRT to use elvis & www.
- Edit .cshrc file, add the following line, but use the user's IP number:
- set DISPLAY 128.111.17.46:0
Use screen scrapper to get data from STAR01
Open SecureCRT, Xwin32, login to Elvis and Complete. Scroll through classes.
- Open Secure CRT application and log into elvis.
- Start-Applications-SecureCRT or double click "elvis" shortcut on desktop.
- Enter username & password if it isn't saved.
- At prompt type: cd web/schedule-of-classes
- note: cd is change directories
- Open Xwin32
- Go back to Elvis
- Type: x3270 &
- An Xwin32 window should pop up.
- Go to Xwin32
- Choose File, Save Screen(s) in File
- Note: Sometimes you need to use the middle mouse button to select.
- In the pop-up box, use the backspace key to delete what's in there.
- Enter a filename such as "f01" for Fall 2001
- Click on "Continuously".
- Everything that shows up on the screen will be recorded and saved
into a file.
- Choose "Connect" then "Other".
- Type in "ccnh.ucsb.edu"
- Click "Connect".
- Log into COMPLETE
- Type "COMPLETE" at the ===> prompt and then log in with username
& password.
- Type "nat22"
- <enter> to pass through screen
- Type STAR01.
- <enter> to pass through screen
- Request Schedule of Classes for Physics & Astro, scroll through classes so that they will get saved to the file
- Type C for Schedule of Classes.
- Enter the Quarter & Year using the following format: Fyy, Wyy, Syy
or Myy
- Enter Course: PHYS
- Press <Enter> and keep hitting <Enter> until you have scrolled
through all of the PHYS and PHYS CS courses.
- Enter F2 to go back to the previous menu.
- Enter Course: ASTRO making sure to use spaces to wipe out anything left
over from the PHYS query.
- Press <Enter>, and keep hitting <Enter> until you have scrolled through all of the ASTRO courses (ASTRO 1 and ASTRO 1H).
- Log off Complete
- Enter F2 and keep backing out until you log off COMPLETE.
- At FIN___ hit <Enter>
- On bottom line type: ULOG OFF
- Go to Xwin32 and save work
- Choose File, Save Screen(s) in File.
- It's not apparent here that anything happens, but you'll see in the f01 file how it looks.
- Quit Xwin32.
- Change the file to Dos format.
- Go back to the Elvis window
- Type: ls
- Check if the f01 file is there.
- Type: unix2dos filename
- If successful, you will see:
- unix2dos... converting file f01 to DOS format
Clean data for processing
- Open file with Notepad and edit.
- Browse to find the F01 file in H:\\web\schedule-of-classes\
- Right click on file and select Open With > Notepad.
- Clean up the data.
- Delete all lines from the begining of the file to the start of classes.
- Delete all lines at the end of the classes to the end of the file.
- Delete any classes that do not belong.
- Remove phantom H's, L's and 1's.
- Look for 1H- instead of 1 - or 1H
- Look for "6BL-" instead of "6BL -" or "6BL -"
- Look for "110" instead of " 10"
- Look for "PHYS CS 599" instead of "PHYS 599"
- Save the document and exit.
IMPORTANT: You must keep the following lines for each of the screens
in addition to the data records:
================================================================================
QTR: W00 *** UCSB STUDENT ACCESS *** SAXCP002
01/06/00 SCHEDULE OF CLASSES
PHYS 1 - BASIC PHYSICS
ENRL R APPR CLS
CODE S DAYS TIME INSTRUCTOR R LOCATION CAP MAX CODE REG AVL FLG
Produce SQL input file, upload it to webserver
- Revert the document back to unix format.
- Go to Elvis
- Check what directory your in. Type: pwd
- If you're not already in web/schedule of classes, go there.
- Type: cd web/schedule-of-classes
- Type: ls and look for f01
- Type: dos2unix f01
- This takes you to the directory where the file and the awk script are located.
- Type: awk -f star_data.awk f01 > f01.sql
- This command runs the start_data.awk script and uses the input from
the f01 file to create a new file called f01.sql. This new file has
sql commands that will update the database with the f01 data.
- Use secure copy (scp) to copy the file over to the webserver (gabriel).
- Type: scp f01.sql username@gabriel:f01.sql
- If scp does not work, use ftp.
- Type: ftp www.physics.ucsb.edu
- Type: username
- Type: password
- Type: put f01.sql
- If successful you will see "Transfer Complete".
- Type: quit
Login to webserver, load SQL file into database
- Log into Gabriel using SecureCRT:
- Select File - New Window, click on Gabriel
- OR, type: ssh username@gabriel
- Verify the file is there.
- Type: ls
- Look for the f01 file.
- Load the data to the "physics" database by typing:
- Go to the schedule of classes
page and check the updates.
Send the Head TA a message when the Schedule-of-Classes
is ready.
Troubleshooting
In order for a class to be listed in the Schedule-of-classes, it needs to
be added to the database with course description information. Do this for all new classes.
- Go to the Web Alass, class_code: (e.g. PHYS115B)
and select "Change classes and class codes".
- Go the the General Announcements section and verify that the missing course
does not already exist in the pull down menu for "Modify Class".
- If the course is not listed there, then you will need to enter a class code where it says, "New Class,
class_code: (e.g. PHYS115B)". The value that you enter into that field
must be the same value that is automatically generated by the star_data.awk
script.
- Examples for each department are:
- PHYS 115B will be "PHYS115B"
- PHYS CS 15A will be "PHYSCS15A"
- ASTRO 1H will be "ASTRO1H"
- NAT S 1A will be "NATSC1A"
- For PHYS CS courses, if you choose dept "College of Creative Studies",
then they will be listed as CCS and sort before all the Physics courses,
if you choose dept "Physics College of Creative Studies" then they will
be listed as PHYS CS and sort after all of the Physics courses.
- Click on "Change Record" to update the database.
-----
If you make a mistake and accidently do the command psql physics < F00.sql
twice, then the database will have two instances of each course. PCS can
fix this by cleaning the physics database in postgres. See clean_physics_db_txt.
-----
Scenario: You know a class was copied from STAR (Phys21), but it does not show up on the Schedule-of-Classes web page.
1) Check database:
physics=# select * from classes where quarter='W' and xyear=2002 and class_code='PHYS21';
2) Ask the Undergrad Assistant if this is a new class.
3) In this case it was a new class, so I followed the instructions above and added the class code at: http://www.physics.ucsb.edu/Administration/classes_modify_choose.php3 where it says: New Class, class_code: (e.g. PHYS115B) under General Announcements.
-----
Scenario: A class was cancelled
Remove it from the database:
physics=# DELETE from classes where quarter='W' and xyear=2002 and class_code='PHYS
131';
-----
Find a class in the database:
physics=# select * from classes where quarter='W' and xyear=2002 and class_code='PHYS21';
-----
Physics Database: psql physics
List tables: \d
List attributes for table: \d table
The class_codes table has the course decriptions.
The classes table has the times, location, instructor for the quarter.
-----
Notes from Elise:
I have currently made them all CCS. The number for the above examples
would be 115, 15, 1 and 1. The number_ext would be B, A, H, and A in the
above examples respectively. If you want to modify the course description
after you have created them, you will need to reload the "Modify Classes" page
in order for the "Modify Class" pull down menu to be updated.
I have created the class_code and entered the dept, number and number_ext for
all of the courses except PHYS CS 15A, 15B and 15C because there was a problem
with the program when I tried to add those courses. Chun, you will need
to go back in and update the rest of the information.
Lisa Preble webmaster@physics.ucsb.edu
Last Modified: 05, Dec 2001