Week Beginning 15th February 2016

I was on holiday on Monday so it was a four-day week for me, which was nice but it meant I had rather a lot to try to squeeze in. I mainly worked on four projects this week, which I will run through in no particular order. On Wednesday I met with Michael Shaw, the RA on the ‘People’s Voice’ project. The project is getting to the stage now where they really need their research database in place so Michael and I met to talk about the sorts of data they need to record about the poems they are researching and what sort of collection method would be suitable. We agreed that having an online content management system and database would work well in most situations, but there would be times when researchers would not be able to guaranteed internet access and would need to work offline. I suggested that I could create a CSV based template file that could be filled in using Excel when an internet connection was unavailable. A simple ‘drag and drop’ script would then allow rows from this file to be integrated with the main database once a connection could be established. We talked through the structure of the data and following on from our meeting I created a first version of a database specification document, a CSV template file and a set of guidelines for filling in the template. Michael has already started conducting research at the Mitchell so will be able to use the template until the content management system is ready for use. My documents were sent on to the rest of the team for feedback. There will no doubt be a bit of toing and froing over the structure of the data, but once that has been sorted out I will be able to start work on the database.

My second project this week was REELS. The project met last week to finalise the database specification, and following on from this I had created the underlying database for the project. This week I began to create the content management system that will sit on top of this database. As I’ve already created many such systems before it was pretty straightforward to set up the basic structure for the CMS, such as logins, layout templates etc. After that I focussed on the place-name element side of the system. We need facilities to create, list, edit and delete place-name elements and I managed to get all of these facilities set up with little difficulty. Carole had also suggested that the project reuse the elements from the Fife place-names project so I created a script that would migrate and clean-up the element data from this project. The script stripped out any tags and timed white spaces and ensured that each distinct element was only recorded once. A total of 1752 elements have been transferred, with 4 languages represented, plus existing and proper names. REELS wants to record data for elements that was not present in the Fife data, such as part of speech, a URL and a description, so these fields are currently blank and will need to be filled in as the project proceeds.

My third project was SciFiMedHums, for which I completed work on the facilities to allow users of the site to suggest new bibliographic items and for administrators to manage these submissions. Users need to register and log into the site in order to post suggested items and the submission form allows the user to enter an item title, select a type and medium and select one or more themes from the list of existing themes. There is also an additional ‘comments’ box where users can supply additional information, such as suggestions for new themes. I’ve updated the item database to include new columns for whether an item was submitted by a user of the site, what the status of the item is (approved, not approved or deleted), who submitted the item and their comments.

Upon submission the details are as a new item, but with ‘user submit’ set to ‘Y’ and ‘status’ set to ‘not approved’ and an email is sent to the project email address. The admin interface now has a new page called ‘List Pending Contributions’ which lists tems that have been submitted by users but have not yet been approved. From this list an Admin user can view the submitted data and decide whether to add it to the main item list (set ‘status’ to ‘approved’) or to delete it (set ‘status’ to ‘deleted’).

 

If status for an item is set to ‘deleted’ the item is removed from the list and won’t appear anywhere else in the system. If the status for an item is set to ‘approved’ the item will be removed from the list and will instead appear in the main ‘SFMH Bibliography’ list. This also generates a WordPress ‘post’ for the item, thus fully integrating the item with our custom post type. The feature is not ‘live’ yet, as I am awaiting feedback from Gavin before I do that.

My fourth project of the week was Metaphor in the Curriculum, the Mapping Metaphor follow-on project. The original Mapping Metaphor project has been nominated for ‘Best DH Data Visualisation’ in the DH Awards 2015. Voting is open to everyone so if you would like to vote for the project you can do so here: http://dhawards.org/dhawards2015/voting/

I continued this week with the app version of the Mapping Metaphor visualisations, migrating all of the existing server-side parts of the code to Javascript so that everything will work in a self-contained app. I lost a couple of hours of progress to investigating a rather annoying bug that was caused by the different way that source data is processed. Previously the data was stored in an SQL database and relevant parts were then pulled out and assigned to variables in the code for processing. With the app version the data is now stored in a JSON file which is loaded into the Javascript code. As with before, relevant parts are then pulled out and assigned to variables for processing. What I didn’t quite remember is that assigning a Javascript variable to an object loaded from the JSON file doesn’t actually create a new object, all it does is create a new pointer to the existing object. So updating the data in what I had considered to be a new copy of the data was actually updating the source data too, which was causing major problems when other parts of the code then tried to grab the same data. Thankfully I figured out what was causing the weirdness and jQuery has a nice little function for copying an object to a new variable rather than just creating a new pointer to the existing object. Basically instead of doing var newObject = metaphorData[i] you do var newObject = jQuery.extend({},metaphorData[i]) and the source object remains untampered with.

I managed to get the visualisation view of the data completed this week, including both aggregate and drilldown views and the metaphor cards for each. I also started work on the tabular view of the data, although I haven’t managed to get this working yet. There is still so much to do, but hopefully I will continue to make good progress with this next week.