[Archivesspace_Users_Group] Plugin: Custom import mapping for MarcXML Agents, help

Carlos Lemus carlos.lemus at unlv.edu
Thu Sep 10 00:44:20 EDT 2015


Hello Brian,

Sorry if I'm not replying to our current thread correctly. I have yet to
set up git for the plugin, but as soon as I do I will let you know. It is
mostly some of the yale marcxml plugin setup and a lot of commented trial
and error code at this point anyways.

I tried the code you gave me and I think you understand perfectly what my
issue is and I understand what you're trying to do by matching the agent to
the current resource, exactly what I need.
However, it's not working because the batch object seems to be Null. Not
sure if maybe I'm required to import something.

Error: #<NoMethodError: undefined method `working_area' for
nil:NilClass>

Here is the current state of my code

UNLVMarcXMLAgentsConverter.configure do |config|
config["/record"][:map]["controlfield[@tag='001']"] = -> resource, node {
existing_agent_uri = resource.linked_agents.find {|link| link[:ref] =~
/people/ }
existing_agent = @batch.working_area.find {|obj| obj.uri ==
existing_agent_uri }
make(:name_person) do |name|
name.primary = node.xpath("subfield[@code='a']").inner_text
# add more name fields as necessary
val = node.inner_text
name['authority_id'] = val
existing_agent.names << name
end
}
end
Thanks for the quick reply by the way. I would have gotten to you sooner,
but I didn't get an email that you had replied. I'll keep an eye on the
listserv from now on.

Carlos Lemus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20150909/4ea3d479/attachment.html>


More information about the Archivesspace_Users_Group mailing list