Archive

Archive for the ‘recipes’ Category

CONTENTdm to DSpace

August 19th, 2009 No comments

There are probably lots of ways to do this, but this is mine.  As part of our migration to the OhioLINK DRC I’ve created a quick php script to 1) take the default export format of CONTENTdm, 2) translate a mapping of fields to the appropriate dSpace ones, and 3) create the DSpace bulk submission package for it. You will need php5+ running on a unix-like system with allow_fopen set to true. It may work on Windows, but I haven’t tested it and I probably won’t. You could upgrade your Windows Installation and have better luck though.

You can find the scripts here. CAVEAT: These are ugly hacks at best http://staff.lib.muohio.edu/~millarj/cdmtab2dspace/

Instructions:

  1. Export your data from CONTENTdm in the control panel. Select a Tab Delimited export and make sure to check “Return field names in first record” cdm-export
  2. Next, open the resulting text file in a spreadsheet application of your choice. If you don’t want to munge dates and other non-text data, make sure each column is imported as the “Text” type. Excel for example, has a hard time with ISO dates.
  3. Add a row to the top of the spreadsheet and place the appropriate DSpace fieladn mes (minus the dc. prefix) above the CONTENTdm field to be mapped. If you want to skip a field, just use “skip” as the DSpace field label.
  4. Save it back out as a tab-delimited file.
  5. Download the script and edit it to customize to your hearts content.
  6. Run the script from a unix/linux/macosx commandline “php cdmtab2dspace.php”

At the top of the script are various customizations/configurations. To see how things will look, set $test_mode = “on” When ready to run it live, change that bit to “off”

In particular, customize/rewrite the “move_bitstreams” function to, you guessed it, move the bitstreams (digital objects) from wherever you have them into the submission package.

Categories: CONTENTdm, DSpace, OhioLINK, recipes Tags:

Changing filename case in bash

August 5th, 2009 No comments

I keep having to google for this, so I decided to write it down here. This is how to change the case of every file in a directory to lowercase. It’s a great way to fix the case insensitivity seen when moving files from a windows filesystem to a Unix-y one. We have several windows PC’s in our lab for special machines with windows only requirements.

When in the directory where the files are stored, issue this command from the Bash shell prompt

for i in `ls`; do mv $i `echo $i | tr '[A-Z]' '[a-z]'`; done

Categories: recipes Tags:

Regular Backup solution for a MacBook Pro

July 23rd, 2007 No comments

About a year ago, I gave up my G5 tower and began using a MacBook Pro as my primary desktop computer. So far, it’s worked out fine. I have the desktop power I need at work complete with external keyboard, mouse, and Cinema Display and I have the mobility I need to work at home or on the road. The only problem is making sure that everything is backed up regularly so that if anything happens while the machine is “in the wild” I won’t have to worry about losing everything.
Read more…

Categories: recipes Tags:

Converting DjVu to PDF

December 8th, 2006 Comments off

Ok, so say you have a bunch of bundled djvu files. djvu has many advantages over pdf in quality and size, but you just can’t beat pdf for it’s ubiquity. The djvu viewer on the mac is pretty flaky too. My latest problem with it is that the djvu looks stunning on screen but looks fuzzy when printed. For a project we have here, students needed to print the djvu files of musical scores so they could easily reference the hard copy whileentering the notation in Finale. That’s the setup. Using a couple of open source tools and some php glue, here’s a quick solution to batch conversion of djvu to pdf. You need the djvulibre tools and imagemagick. You also need some bundled djvu files.
Read more…

Categories: Digital Libraries, recipes Tags: