Tuesday, 18 November 2014

World of Persistent Identifiers [Updated]

The reason I created this diagram was so I could visualise what the relationship is between Handles and DOIs, as well as other persistent identification systems.  This diagram has also helped colleagues, so I thought it was worth updating.

The Diagram for the World of Persistent Identifiers has been updated to include the OUR Journal service (Otago University Research Journal service).






Access the first version of this diagram World of Persistent Identifiers.

Wednesday, 6 March 2013

Setting up CrossRef DOIs in OJS

When looking at the requirements for implementing CrossRef DOIs (digital object identifiers) in OJS (open journal systems) I was uncertain of the order required to set this up. (It did not help that the terminology used by OJS, CrossRef and other resources varies.)

There are different OJS forum posts that cover this, like Re: STEP BY STEP FOR USING CROSSREF.  These posts did help me figure out most of the steps and code I have used. However, I still needed to figure out the right order for when you display a DOI and then when it should be activated (so it can be used as a link).

The order for setting up DOIs in OJS for a journal are:
  1. Apply to CrossRef and receive a DOI prefix
  2. Add this DOI prefix to the Journal Setup / Details page
  3. Enter/select and save your preferred DOI suffix 
  4. Alter the metadata displayed on the Article record page. This should include the DOI you generated. 
  5. Once the article is Published/Live/Public submit the metadata and DOI to CrossRef.  Either use the CrossRef XML export plugin or submit to CrossRef manually via the form http://www.crossref.org/webDeposit/ 
  6. CrossRef will activate the DOIs, using your submitted metadata/DOI. (There may be a delay in the activation but the DOI can still be cited.)

More details for some of these steps and code

2. Adding and generating your DOI for each article
  • Go to - User Home / Journal Manager /  Journal Setup / 1. Details / 1.1 General Information / DOI Prefix.  Enter the prefix here
3. Create the DOI suffix for each journal.

4. Alter the metadata displayed on the Article record page (i.e. Journal Initials, Volume, Issue, Year)
  • The OJS default does not display metadata that CrossRef requires, so you will need to change what is displayed for each article.
  • OJS provides support to help you figure out how to create or change the code: OJS API Reference http://pkp.sfu.ca/ojs/doxygen/current/html/index.html and go to the Class List
  • Within the directory (file structure) for your journal go to: Templates / Article and open the article.tpl file (via an XML editor, but I found WordPad is enough to edit the file). I added this code under the Authors and above the Abstract.  Edit or order this based on the needs of each journal.

      <div>  
      <br />  
      <div><h4>{$journal->getLocalizedInitials()|escape}, Vol {$issue->getVolume()|escape}, No {$issue->getNumber()|escape} ({$issue->getYear()|escape}) </h4></div>  
      <div><a href="http://dx.doi.org/{$article->getStoredDOI()|escape}">http://dx.doi.org/{$article->getStoredDOI()|escape}</a></div>  
      <br />  
      </div>   

  • If you do not want to display the DOI as a link before it is activated when you first set this up use the code for the DOI without the link

 <div>DOI: {$article->getStoredDOI()|escape}</div>  


Monday, 17 December 2012

World of Persistent Identifiers

We have been working on providing DOIs (Digital Object Identifiers) for some journals we are managing in OJS (Open Journal Systems). When I was trying to understand the relationship between the handles used by DSpace and different types of DOIs I wanted to visualise this. I also needed to cover options for persistency when managing data and archives. I ended up creating a diagram to help me picture the 'world of persistent identifiers'.

This diagram is a snapshot of what I was focusing on at the time of this investigation. If you want to remix this for your own purposes contact us and we can provide the original diagram (created in Microsoft Visio).

View the Updated version if this Diagram http://otagoliblab.blogspot.co.nz/2014/11/world-of-persistent-identifiers-updated.html.

Monday, 20 August 2012

Omeka (again) Showing/hiding on Advanced Search

So we're getting rather clever with Omeka (omeka.org) here at Otago  :) But we want MORE from the system without tinkering around with the engine of it (makes updates awkward). 

Our recent 'challenge' was to try and display ONLY the fields that we chose on the Advanced Search page (http://otago.ourheritage.ac.nz/items/advanced-search).  There were a few notes on Omeka forums, and I did pick and choose some of it (notably, the 'blacklist' idea) but then it started tying my brain into knots.  Our resident genius then said 'why not create a whitelist?' Oh. Of course.

Resident genius came up with the following (I tweaked a couple of tiny things :)):

So, if you are struggling with customising your Advanced Search in Omeka, you are welcome to try this....

Step 1.  If it's not there already, take a copy of advanced-search.php from application/views/scripts/
items/advanced-search.php and put it in your items folder (credit to Will Riley on Omeka Dev for this - https://groups.google.com/d/topic/omeka-dev/FsotR2xTI5k/discussion).

Eg. themes/yourtheme/items/advanced-search.php

Step 2.  Decide what 'optgroup' and 'options' that you want to display. !important - it's easier/less time consuming to do this at Step 2. than later on .... trust me :)

Step 3.  Place the following at the BOTTOM of the advanced-search.php page:

<?php echo js('jquery'); ?>
<script type="text/javascript">
jQuery(document).ready(function () {
    
    <!--Part 1 - lets through the fields that you want showing up...-->
 whiteList = ['Abstract','Creator','Date','Description', 'Identifier', 'License', 'Medium', 'Publisher', 'Relation', 'Source', 'Spatial Coverage', 'Subject', 'Temporal Coverage', 'Title'];
    
    <!--Part 2 - blocks the optgroups that you DON'T want-->
    jQuery("[id='advanced-0-element_id-optgroup-Digital New Zealand']").remove();
    jQuery("[id='advanced-0-element_id-optgroup-Zotero']").remove();
    jQuery("[id='advanced-0-element_id-optgroup-Item Type Metadata']").remove();
    
    <!--Part 3 - is to take the optgroup that you DO want and head back up to the whitelisted fields and display them, remove all the other options-->
    jQuery.each($("[id='advanced-0-element_id-optgroup-Dublin Core'] option"), function(index, option) {
        console.log(option);
        if (jQuery.inArray(option.label,whiteList) == -1) {
            jQuery(option).remove();
        }
    });
});
</script>

Step 4.  In Part 1 add the fields you want to SHOW.
Step 5.  In Part 2 add the optgroups that you want to REMOVE.
Step 6.  In Part 3 add the optgroup that has the whitelisted fields that you want to SHOW.

Step 7. Test and debug :)

Merrin

Tuesday, 7 August 2012

Create a one page online exhibition with Omeka data...

The University of Otago Library has been doing online exhibitions for about ten years now. During that time a lot of trends have come and gone (Flash has gone thank goodness!). The latest trend (as we see it, or actually, as I see it!) is the one page online exhibition. This is due in large part to the fantastic-ness of Jquery...

We recently installed Omeka and were keen to use it as the container for a large number of our images.  We were also keen to keep with the ethos of 'enter once, use multiple times and let others use it too...'

I did have a look at the Exhibition component of Omeka, but this did not suit the purpose I had in mind - a really 'lite' exhibition site that could be easily viewed across all platforms - mobile and desktop.

To start with, images taken for the last online exhibition were entered directly into Omeka and wrapped into a 'Collection'.

What we then wanted to do was hook into that Collection and display the relevant details on a separate page - a 'skin' so to speak.

So, below is the 'recipe' for using Omeka-Json data and PHP to display fields on another page (or site):

Step 1. Use Omeka 'Item Order' (plugin) via Collections to order the images. If you want them in a particular order that is! We did as we also used navigation.

Step 2. Grab the Json file from Omeka and decode it:

require '../../jsonwrapper/jsonwrapper.php'; //you'll need this if you are using a server less that has anything less than PHP5 - we found this to be a 'gotcha' when developing on one server but hosting on another!

$json = file_get_contents("http://yoursite/collections/show/41/?output=omeka-json");
$data = json_decode($json, true);

The '41' is the id for the Collection, btw.

Step 3. Find the items within the data to display images and all their parts. This bit was REALLY labour intensive. Basically, what I had to do was count where an array fell in the Omeka-Json output. To get the initial output in order to do this we did a var-dump (ie. var_dump($item); die();).

$i = 0;
foreach ($data[5] as $item){
if ($item[0]=='item')
{
$i++;
$src = $item[2][1][2][1]; //find image link
$srcthumb = explode("fullsize", $src); //find Fullsize and replace with 'thumbnails' - echo it out a thumbnail
$Title = $item[3][1][4][1][4][1][2][1]; //find item title
$Date = $item[3][1][4][5][4][1][2][1]; //find publication date
$Abstract = $item[3][1][4][2][4][1][2][1]; //find abstract
$Creator = $item[3][1][4][3][4][1][2][1]; //find author/creator
$Publisher = $item[3][1][4][4][4][1][2][1]; //find publisher

Step 4. Echo it all out (we used lightbox/slimbox too):

Eg. echo '<div class="thumbnail-img"><a href="' . $src . '" rel="lightbox[gallery]" title="<h3>' . $Title . '</h3> <p> ' . $Abstract . ' </p><p>' . '<i>' . $Title . '</i>, ' . $Creator . ', ' . $Publisher . ', ' . $Date . '.</p>"><img class="lazy" src="grey.gif" data-original="' . $srcthumb[0] . 'thumbnails' . $srcthumb[1] . '"/></a></div>';
etc

Step 5. Debug and add your own customisations :)

Here is a real example of what we achieved: http://www.library.otago.ac.nz/exhibitions/charting-the-land-on-the-ocean/index.php


One issue that still remains unresolved is displaying all the images/thumbnails that are associated with an item record - at present, the Omeka-Json only outputs one image, not all available images.

Merrin

Wednesday, 4 July 2012

Box of PHP bits n pieces

Being a self-taught (and still a relative newbie) to PHP, it can become a bit daunting to use all the correct bits and bobs that go into creating something functional. One of my issues is trying to remember what the operators and things mean. For example, I couldn't recall what '++' meant (it means increment by one - which I have re-remembered when work colleague reminded me :)). Try Googling '++' :) Now, if I had Googled 'PHP increment' I would have gotten somewhere, but alas, I didn't know the right question to get the right answer!!

However, I have a solution to my dilemma, and I've been working with it successfully for a couple of years now. It's a piece of paper. With stuff on it. Like comparitive and logical operators, ternary operators etc.

Here it is:


It's actually written on the back of a useful PHP cheatsheet that I found on the 'net (and printed out!)

Not hi-tech. But it works. And doesn't need charging up. Or software upgrades to run it :)

Merrin

Wednesday, 13 June 2012

Be warned: it can take 7 days to up your GAE quota from free to billed

The google docs say that it takes 15 - 20 min to update your quota after your first credit card charge is cleared. But they fail to say that it can take up to 7 days for that first charge to clear. I've got 6.5 days and counting ...

http://blog.stochastictechnologies.com/going-from-loving-appengine-to-hating-it-in-9