[Archivesspace_Users_Group] marcxml exporter plugin questions

Esha Datta esha at nyu.edu
Tue Mar 1 13:16:39 EST 2016


Hi,

I am trying to write a plugin to apply some custom mappings to the marc
export for Archives Space records. I am using Hudson Molonglo's plugin
<https://github.com/hudmol/dartmouth_udf_exports> and the ASpace plugin
documentation
<http://archivesspace.github.io/archivesspace/user/archivesspace-plug-ins-readme/>
as
a template. My question is how do I access the archives space object? So
far, I have created a custom marc serializer class where I specify the
class in the MarcSerializer add decorator method. I can inspect the
object(record) in the MarcCustomFieldSerialize class and see the marc
record...which is pretty cool. However, I also need to access the archives
space object before it's transformed to marc to access some other values.

I see from the plugin listed above that the MarcModel class is being
re-defined in it and is getting the aspace record. It also has some
decorator logic which I assume got pulled back into the main code, as I see
it there now. However, I'm not sure how object is being read in the plugin.
I see how that's happening in the main source code.

So far, I have:
plugins/name/
plugin_init.rb:
   MARCSerializer.add_decorator(MARCCustomFieldSerialize)
and the class:
plugins/name/backend/lib/
class MARCCustomFieldSerialize
  ControlField = Struct.new(:tag, :text)
  DataField = Struct.new(:tag, :ind1, :ind2, :subfields)
  SubField = Struct.new(:code, :text)

  def initialize(record)
    @record = record
  end
end

I'd really appreciate any feedback on this. Thanks for your time! Please
let me know if you need any clarifications.

Thanks.

Esha Datta
Senior Programmer/Analyst
Bobst Library
NYU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20160301/8c8f649d/attachment.html>


More information about the Archivesspace_Users_Group mailing list