05: THE FULL RECORD

API: dmGetItemInfo

INVOKED: <server address>/dmwebservices/index.php?q=dmGetItemInfo/<alias>/<record no>/xml

EXAMPLE: https://server16614.contentdm.oclc.org/dmwebservices/index.php?q=dmGetItemInfo/linl/72/xml

The resulting XML records look like:

<title>Advertising blimp</title>
<creato/>
<contri/>
<subjec>
Airships; Aeronautics--Commercial; Aeronautics in advertising
</subjec>
<subjeb>Commercial Airport</subjeb>
<subjea>Transportation & Communication</subjea>
<descri>
First blimp to land at Commercial Airport, Springfield, Illinois.
</descri>
<date>1931-11-11</date>
<date1>1931</date1>
<coverb>1930s (1930-1939)</coverb>
<source/>
<relati>
Sangamon Valley Collection, Southwest Airport Collection, Box 2, Folder 10
</relati>
<langua/>
<covera>
United States--Illinois--Sangamon County--Springfield
</covera>
<publis>Lincoln Library</publis>
<rights>
Contact Lincoln Library, 327 South 7th Street, Springfield, Illinois, (217) 753-4900 for information concerning copyright restrictions applying to the use or reproduction of this image.
</rights>
<datedi>2004-06-10</datedi>
<identi>llsa0022</identi>
<type>Image</type>
<formaa>Photograph</formaa>
<digita>JPEG</digita>
<format>
TIFF images created with CanoScan 9900F scanner, 300 DPI, grayscale, ArcSoft Photo Studio 5
</format>
<transc/>
<tag/>
<collec>Springfield Aviation Company Collection</collec>
<fullrs/>
<find>73.jpg</find>
<dmaccess/>
<dmimage/>
<dmcreated>2004-11-15</dmcreated>
<dmmodified>2009-12-02</dmmodified>
<dmoclcno/>
<dmrecord>72</dmrecord>
<restrictionCode>1</restrictionCode>
<cdmfilesize>67781</cdmfilesize>
<cdmfilesizeformatted>0.06 MB</cdmfilesizeformatted>
<cdmprintpdf>0</cdmprintpdf>
<cdmhasocr>0</cdmhasocr>
<cdmisnewspaper>0</cdmisnewspaper>

You can see where the nicknames come into play– we will need to translate these into some kind of human readable label.

dmGetItemInfo.php

<?php

$xmlData = file_get_contents('https://server16614.contentdm.oclc.org/dmwebservices/index.php?q=dmGetItemInfo/linl/85/xml');
$fieldData = file_get_contents('https://server16614.contentdm.oclc.org/dmwebservices/index.php?q=dmGetCollectionFieldInfo/linl/xml');

$sxe = new SimpleXMLElement($xmlData);

$xml = simplexml_load_string($xmlData);
$fieldData = simplexml_load_string($fieldData);

foreach ($fieldData->xpath('//field') as $record) {
        $result[] = array(
                'nick' => (string) $record->nick,
                'name' => (string) $record->name
        );
}

// Find the nickname of a term, find its array index, and then find the name value at the same index

foreach ($sxe->children() as $child) {
        $str = $child->getName();
        $title = $xml[0]->{"$str"};

        if ($str == "dmrecord") { $pointer = $title; }

        $id = searchForId($str, $result);
        if (isset($id)) {
                $fieldName = $result[$id]["name"];
                echo "$fieldName: $str: $title\n";
        }
}


// This function from Jacob Trunecek (http://stackoverflow.com/users/819364/jakub-trune%C4%8Dek)

function searchForId($id, $array) {
   foreach ($array as $key => $val) {
       if ($val['nick'] === $id) {
           return $key;
       }
   }
   return null;
}

?>