<div dir="ltr">Hi,<div><br></div><div>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 <a href="https://github.com/hudmol/dartmouth_udf_exports">plugin</a> and the ASpace plugin <a href="http://archivesspace.github.io/archivesspace/user/archivesspace-plug-ins-readme/">documentation</a> 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.</div><div><br></div><div>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.</div><div><br></div><div>So far, I have:</div><div>plugins/name/</div><div>plugin_init.rb:</div><div>   MARCSerializer.add_decorator(MARCCustomFieldSerialize)</div><div>and the class:</div><div>plugins/name/backend/lib/</div><div><div>class MARCCustomFieldSerialize</div><div>  ControlField = Struct.new(:tag, :text)</div><div>  DataField = Struct.new(:tag, :ind1, :ind2, :subfields)</div><div>  SubField = Struct.new(:code, :text)</div><div>  </div><div>  def initialize(record)</div><div>    @record = record</div><div>  end</div><div>end</div><div><br></div><div>I'd really appreciate any feedback on this. Thanks for your time! Please let me know if you need any clarifications.</div><div><br></div><div>Thanks.</div><div><br></div><div>Esha Datta</div><div>Senior Programmer/Analyst</div><div>Bobst Library</div><div>NYU</div><div><br></div><div><br></div></div></div>