Skip to content

Metadata manipulator: AddContentdmData

Mark Jordan edited this page Dec 27, 2015 · 10 revisions

Overview

This metadata manipulator Adds several types of data about objects being migrated from CONTENTdm, specifically the output of the following CONTENTdm web API requests for the current object: dmGetItemInfo in JSON format, dmGetCompoundObjectInfo (if applicable) in XML format, and GetParent (if applicable) in XML format.

Toolchains

This metadata manipulator applies to all CONTENTdm toolchains.

Configuration

To register this manipulator in your toolchain, add the following line to the "[MANIPULATORS]" section of your .ini file:

metadatamanipulators[] = "AddContentdmData"

Also note that the mappings file must contain a row that adds the following element to your MODS: <extension><CONTENTdmData></CONTENTdmData></extension>, e.g.,

null5,<extension><CONTENTdmData></CONTENTdmData></extension>

Parameters

This manipulator does not take any parameters.

Functionality

The purpose of this metadata manipulator is to include several types of the current object's metadata as it was managed by CONTENTdm. If registered in a toolchain's .ini file, this manipulator adds the JSON version of the output of the dmGetItemInfo CONTENTdm web API request to a MODS <extension> element. All objects also have their CONTENTdm alias and pointer added to the <extension> element. If applicable to the CONTENTdm object, it also adds the XML output of the dmGetCompoundObjectInfo web API request, and the XML output of the GetParent web API request. All of these elements are wrapped in a <CONTENTdmData> element, and all have timestamp, source, and mimetype attributes. All data from CONTENTdm is wrapped in CDATA sections.

Some typical <extension><CONTENTdmData> markup added to a MODS document by this manipulator looks like this:

<extension>
    <CONTENTdmData>
      <alias>ecucals</alias>
      <pointer>3223</pointer>
      <dmGetItemInfo timestamp="2015-10-05 15:38:46" mimetype="application/json" source="http://content.lib.sfu.ca:81/dmwebservices/index.php?q=dmGetItemInfo/ecucals/3223/json"><![CDATA[{"title":"Session 1931-1932","subjec":"Vancouver School of Decorative and Applied Arts","descri":"Paper","creato":"Unknown","publis":"Vancouver School of Decorative and Applied Arts","date":"1931","contri":"Booklet","type":"Charles H. Scott","format":"A.B. Jamieson; Mrs. Paul M. Smith; T. Brooks; R.H. Neelands; H.M. Drost;  C.M. Woodworth; James Blackwood; J.E. Carpenter; E. Mahon","identi":"J.S. Gordon; H.F. Hines","source":"F. Horsman Varley; J.W.G. MacDonald; Grace W. Melvin;  Charles Marega; F. Hoole; R.P.S. Twizell; S.P. Judge;  Fred A. Amess; S.J. Bryant; J. Allen; E.G. Maw; Frances Gatewood","langua":"Ruel Wonder","relati":"Diploma of the School;  Diploma in Crawing and Painting; Diploma in Design and Decorative Arts; Teaching Certificate","covera":"Drawing and Painting; Design and Decorative Arts; Modelling and Sculpture","audien":{},"schola":"Ione Macdonald; Norma Park; Maisie Robertson; Margaret Carter; Jean Kirton; Bernice Wilson; Alice Parker; Edward Hughes; Orville Fisher; Ida Wilson","notes":{},"full":{},"fullrs":{},"find":"3224.cpd","dmaccess":{},"dmimage":{},"dmcreated":"2012-06-05","dmmodified":"2012-06-05","dmoclcno":{},"dmrecord":"3223","restrictionCode":"1","cdmfilesize":"1890","cdmfilesizeformatted":"0.00 MB","cdmprintpdf":"1","cdmhasocr":"0","cdmisnewspaper":"0"}]]></dmGetItemInfo>
      <dmGetCompoundObjectInfo timestamp="2015-10-05 15:38:46" mimetype="text/xml" source="http://content.lib.sfu.ca:81/dmwebservices/index.php?q=dmGetCompoundObjectInfo/ecucals/3223/xml"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<cpd>
  <type>Document-PDF</type>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 1</pagetitle>
    <pagefile>3212.pdfpage</pagefile>
    <pageptr>3211</pageptr>
  </page>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 2</pagetitle>
    <pagefile>3213.pdfpage</pagefile>
    <pageptr>3212</pageptr>
  </page>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 3</pagetitle>
    <pagefile>3214.pdfpage</pagefile>
    <pageptr>3213</pageptr>
  </page>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 4</pagetitle>
    <pagefile>3215.pdfpage</pagefile>
    <pageptr>3214</pageptr>
  </page>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 5</pagetitle>
    <pagefile>3216.pdfpage</pagefile>
    <pageptr>3215</pageptr>
  </page>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 6</pagetitle>
    <pagefile>3217.pdfpage</pagefile>
    <pageptr>3216</pageptr>
  </page>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 7</pagetitle>
    <pagefile>3218.pdfpage</pagefile>
    <pageptr>3217</pageptr>
  </page>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 8</pagetitle>
    <pagefile>3219.pdfpage</pagefile>
    <pageptr>3218</pageptr>
  </page>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 9</pagetitle>
    <pagefile>3220.pdfpage</pagefile>
    <pageptr>3219</pageptr>
  </page>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 10</pagetitle>
    <pagefile>3221.pdfpage</pagefile>
    <pageptr>3220</pageptr>
  </page>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 11</pagetitle>
    <pagefile>3222.pdfpage</pagefile>
    <pageptr>3221</pageptr>
  </page>
  <page>
    <pagetitle>1931-32 Prospectus photocopy 12</pagetitle>
    <pagefile>3223.pdfpage</pagefile>
    <pageptr>3222</pageptr>
  </page>
</cpd>
]]></dmGetCompoundObjectInfo>
    </CONTENTdmData>
  </extension>

If the CONTENTdm object has a parent, the output of GetParent call is also retrieved and stored as a child of <CONTENTdmData>, as in this example:

<GetParent timestamp="2015-10-05 15:38:46" mimetype="text/xml" source="http://content.lib.sfu.ca:81/dmwebservices/index.php?q=GetParent/ecucals/3223/xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?><parent>4572</parent>]]></GetParent>

The choice of which CONTENTdm metadata to store in the <extension> element, and the formats to store them in, are largely dictated by the requirements for SFU Library's Islandora CONTENTdm API module. If implementers want other formats, they can use this manipulator as the basis for their own.

Clone this wiki locally