Med College policies db

Entered on 09/19/2013 at 13:53:44 EDT (GMT-0400) by Melissa Long

I’ve been working with my dean to begin reorganizing our College of Medicine Student Handbook content from one comprehensive (cumbersome) pdf document into a searchable website very similar to the Animal Science Majors Student Handbook (http://asci.uvm.edu/current/handbook/). We absolutely LOVE the way the main campus Compliance Office has organized the University’s policy website (http://www.uvm.edu/policies/?Page=alphalist.php)and plan to link to it under the ‘Policy Section’ of our forthcoming “document.” However, COM also has some policies unique to our program that we’d like to organize and present much like on the University’s parent site.

Erica Heffner suggested that I connect with you, as the guru who helped them organize the policies in an SQL database and assisted with programming the interface. I’m pretty adept at databases, but have never created one specifically for a website. I was hoping you might be willing to give me a glimpse at how you went about this for the main UVM policy page, so that I don’t struggle trying to re-invent a wheel.

I’m also curious about recommended practices around “versioning” and welcome your thoughts. Erica explained that her office doesn’t use an elaborate database or system; but rather when they replace a policy, they create a new version number, keep the retired policy in an archived folder with the date the policy was replaced, and that the new version of the policy includes an effective date.

Is there any chance you’d be willing to share some insight/advice with me as I prepare to embark on this undertaking? Or someone else you might refer me to, if not?

Entered on 09/19/2013 at 13:55:17 EDT (GMT-0400) by Wesley Wright:

 

 

The Policies database is a php application on www.uvm.edu interfaced with a MySQL database living on webdb.uvm.edu
You can get an account on www.uvm.edu here:
http://www.uvm.edu/it/account/?Page=apply-department.html
And you can get a mySQL database here:
https://webdb.uvm.edu/
Polices db is pretty simple. Main table looks like this:
CREATE TABLE `policy_docs` (
`doc_id` varchar(100) NOT NULL DEFAULT ”,
`filename` varchar(100) DEFAULT NULL,
`title2` varchar(200) DEFAULT NULL,
`category` varchar(255) DEFAULT NULL,
`official` varchar(255) DEFAULT NULL,
`review_year` char(10) DEFAULT NULL,
`status` char(2) DEFAULT NULL,
`board` char(2) DEFAULT NULL,
PRIMARY KEY (`doc_id`)
)
doc_id is compliance internal numbering scheme (http://www.uvm.edu/policies/?Page=numberingsystem.html&SM=SubProcessMenu.html)
filename is name/location of PDF
title2 is full document title
category is comma delimited list of applicable category codes, related to table categories
official is code for responsible office/officer, see table officials
review_year is sort of a last reviewed/next review date
status is code letter, f for final, d for draft
borad is Governance code b Board of Trustees Institutional
Other tables:
# Dump of table categories
# ————————————————————CREATE TABLE `categories` (
`code` char(2) NOT NULL DEFAULT ”,
`cat_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

# Dump of table community
# ————————————————————

CREATE TABLE `community` (
`comm_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`doc_id` varchar(100) NOT NULL DEFAULT ”,
`community` varchar(100) NOT NULL DEFAULT ”,
PRIMARY KEY (`comm_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PACK_KEYS=1;

# Dump of table officials
# ————————————————————

CREATE TABLE `officials` (
`code` char(4) NOT NULL DEFAULT ”,
`official` varchar(255) DEFAULT NULL,
PRIMARY KEY (`code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Typical SQL:

SELECT policy_docs.doc_id, policy_docs.title2,policy_docs.filename, policy_docs.category, board from policy_docs where status=’f’ order by title2
Don’t know much about versioning. You could come up with a version numbering scheme, put a code in status indicating “Most recent” and keep less recent in database for archival.
Posted in Wes | Tagged , , | Leave a comment

Mixing UVM and non-UVM passwords

Entered on 09/19/2013 at 14:02:35 EDT (GMT-0400) by Bob Erickson

I am working on a web site project that will require users to log in, we need to restrict this to uvm faculty and students which is easily done with uvm authentication in an htaccess file.

however we need to allow 6 or more non uvm people access. i looked into the temporary wireless guest accounts but those do not work with uvm authentication. I did not find any reference online about just getting temporary uvm accounts. Does any have any thoughts on the matter?

Entered on 09/19/2013 at 14:03:46 EDT (GMT-0400) by Wesley Wright:

Can’t use or without an error 502. works

Can’t link

ln -s UVM_ONLY NOT_UVM

Apache sees through that, knows they are the same thing, and defaults to the original when choosing directive

Don’t want ErrorDocument 403 — failed authentication generates error 401 . ErrorDocument 401 is tricky. Send it to a php file with header(“Location: blahblah”) and error 401 goes there without  asking for Basic Credentials . Send it to /~waw/UVM_ONLY, get “Additionally, a 302 Found error was encountered while trying to use an ErrorDocument to handle the request.”

Tried a lot of stuff that didn’t work, came up with this

mkdir UVM_ONLY
mkdir NOT_UVM
mkdir UVM_ONLY/shared
put content in shared
cd NOT_UVM
ln -s ../UVM_ONLY/shared

Put this in NOT_UVM/.htaccess

AuthType Basic
AuthName “Guest Access”
AuthUserFile /users/w/a/waw/ht_password_file_mysql_admin
require valid-user
order deny,allow
ErrorDocument 401 /~waw/uvm_only.html

Put this in UVM_ONLY/.htaccess

AuthType WebAuth
require valid-user
satisfy any
order allow,deny

put this in /~waw/uvm_only.html

Click  here to access site with UVM NetID

Now go here:

https://www.uvm.edu/~waw/NOT_UVM/shared/

USe name:dog pass:cat, you’re in

Else click cancel,click here, use UVM auth, you’re in

Posted in Wes | Tagged | Leave a comment

Migrate BBB front end from Drupal 6.x to 7.x, add BBB v.8.x features

Migrate BBB front end from Drupal 6.x to 7.x, add BBB v.8.x features. Current BBB interface at https://www.uvm.edu/ctl/apps/bigbluebutton uses Drupal 6.28 and a hacked instance of the BBB Drupal module. Plan to move all to ETS “silk” server http://ctl.w3.uvm.edu/

So far, I installed Drupal 7. Working out authentication/authorization issues

Posted in --Project Summary, Wes | Tagged , , | Leave a comment

Kathy Marmor Fan Software update

While on summer vacation, I updated Kathy’s Fan Script to use Twitter API 1.1, since they dropped sport for V1.0 right after her sat show.

After the update, she noticed some test SMS texts weren’t generating any sentences.

The script performs a twitter search on each significant word in the SMS entry. So, somebody texts “I am your maker and creator.” Insignificant words stripped (“am”,”your”,”and”), three twitter searches, one for “I”, one for “maker”, one for “creator.” Twitter, not being told otherwise, defaulted to returning just 15 tweets that forms the “seed” text for Wabby — but ONLY if that search term appeared in the test, CASE sensitive. So in this example, the seed would contain at most 45 tweets, skipping any where the search term was capitalized in any way.
The problem text she sent me were single word texts: summertime and ballons (not balloons). One word, one twitter search, 15 tweets, many containing “Summertime.” and thus skipped. Result: seed too small for Wabby to deal with, it spewed empty phrases.
Solution: I bumped up the returned tweet count to 50 per search. I remove the case-sensitive word match requirement.

More: stripped out #whatevers and @whoevers from tweets, fixed another bug I introduced that reset seed text between searches

Posted in Wes | Tagged | Leave a comment

Omeka updates

Upgraded omeka from version 1.5 => 2.0.3  , which essentially broke omeka. Why? Themes. Themes let one customize the layout of pages and exhibits. Themes are a collection of php script files that call omega  API functions to display stuff. The omeka 2.x API is completely different than the 1.x API. Only 3 out of maybe a dozen themes have been updated to the new API, and we aren’t using those three, so I had to update our themes myself. Wasn’t easy and it took a bit of genius, but I persevered and ultimately won the day. Or two.

Posted in Wes | Tagged , , | Leave a comment

New Landscape Server

Ben Coddington told me:

We’ve had some loading lately when bots crawl /landscape.  Looks like /landscape often opens its own files through the web server, which clogs things up.

The worst requests are like these:

/landscape/search/details.php?ls=55237&sequence=000&set_seq=3533&imageSet=1367046201-517b7839a64eb&AddRel=

They make several self-requests to load image files through the web server, even though only HTML is returned.  I got to looking at the code a bit, and it looks like there’s a test to see if an image exists before writing out the HTML to load the image, but that test actually loads the image into the web server.

There are some other optimizations that can be done here as well; there are some very long-running database queries.  Would you be willing to work with me to make the site run a bit better?  Right now, indexing of this site causes all the SAA pagers to make noise – and that happens a couple times a day.

 

I made some code changes but was reminded that it was doing what it was doing because of php “Safe Mode” and we needed to change fuel permissions and ownership on tens of thousands of file for the code changes to work. This prompted Ben and Mike Austin to conclude:

Might be nice to get this thing on a dedicated server — we could turn off safe_mode, and the filesystem access would be much faster.  Then it could age gracefully without UVM dancing around trying to fit it into our architecture over and over again.

How would you feel about that?

Turns out it didn’t matter how I felt, it is happening anyway. And of course, it isn’t all smooth sailing — walking the website now, finding and squashing bugs.

as far as sql goes,The most common query — the quick search — was performing a full text query on a set  of fields which did not match the fields in the fulltext index.  rebuilt the index, and queries formerly taking 3-4 seconds are now clocking in at 2.1ms .

 

Posted in --Project Summary, Wes | Tagged , , | Leave a comment

New Landscape Pages

Ana Vang, geology, informed me:

We’re created some banners that are traveling to fairs this summer, and in addition we would like to set up some new webpages within the landscape change website to include their content. Is there a time I can meet with you to go over how to set up these pages?

Paul Bierman added:

Ana has been preparing some great public dissemination banners and we want (at the request of advisors) to add QR codes to the banners.  I attach a somewhat dated banner draft for you to see what we are up to.Screen Shot 2013-05-20 at 11.54.18 AM
 
We’d like to set up a web page (in normal LCP header and footer format) for each banner that includes:
 
am image of the banner (jpg)
links to each image on the banner (via it’s LS#).
a link to download the banner in high res as a PDF
even cooler would be a  link to the audio file for the interview from which the quotation on the banner was taken
 
The cool way to do this would be a clickable image map but that might be too much work…
 
the easy way would be a list of links that tied to the images, perhaps with a thumbnail.
 
To use the QR codes, we need a hard URL for “each banner”.  We need to set those up soon – but since it’ll take 4 weeks to print the banners, the pages needn’t be built right away.

 

Read up on using Photoshop Slice tool, made this mock-up, showed Ana how to do same for the other nine. See:

http://www.uvm.edu/landscape/banners/banner_6/

Posted in Wes | Tagged | Leave a comment

Big Blue Button roles and permissions

Some inconsistent and conflicting role based permissions in Drupal BBB module affecting some Faculty (most notably our own Director), causing inability to attend meetings. Fixed March 26.

Reared its ugly head again early May for Nick Gingrow, UVM School of Business IT Professional, who had a different set of roles. Think I have it right now, although the php code is getting uglier and uglier.

Posted in Wes | Tagged , , | Leave a comment

Emails for recent event attendees

I was tasked to produce a list of unique email addresses of CTL event attendees for events held Spring 2013.

Short answer:

select distinct first_name,last_name,email  from users left join enrollments on enrollments.user_id=users.id left join events on enrollments.event_id=events.id left join event_types on event_types.event_id=events.id left join types on types.id=event_types.`type_id` left join event_sponsors on event_sponsors.event_id=events.id left join sponsors on sponsors.id=event_sponsors.`sponsor_id`    where events.start_day>’2012-12-31′ and is_facilitating=0 and (sponsors.sponsor IS NULL or sponsors.sponsor != “Writing in the Disciplines”) order by last_name

Long answer:

https://www.uvm.edu/~waw/php/recent_event_attendees.php

Notes:

  1. No need to tag events: just need to filter start day where events.start_day>’2012-12-31′
  2. Some small effort was made to filter by sponsor (CTL, WID, etc.); however, sponsor was not specified for many events
  3. No effort was made to sponsor by event type (workshop, book group, etc.) as event type was not specified for many events
Posted in Wes | Tagged , | Leave a comment

Omeka code hack

Omeka wasn’t allowing admins to alter banner image associated with some themes. Nor would it display the current banner image on the update theme page.

I fixed both issues.

Posted in Wes | Tagged , , | Leave a comment