[Archivesspace_Users_Group] Adding display fields for search results - How to?

Joshua D. Shaw Joshua.D.Shaw at dartmouth.edu
Tue Sep 13 12:12:40 EDT 2016


Hi Kari-

An AO doesn’t have the resource id attached by default, so you have to add it to the SOLR document for the AO. I’m actually working on a similar plugin that does that and a couple of other things. In the meantime, if you take a look at https://github.com/hudmol/component_levels you can get an idea of how that process works.

Best,
Joshua

From: <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Kari R Smith <smithkr at mit.edu>
Reply-To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Date: Tuesday, September 13, 2016 at 10:34 AM
To: Noah Huffman <noah.huffman at duke.edu>
Cc: "archivesspace_users_group at lyralists.lyrasis.org" <archivesspace_users_group at lyralists.lyrasis.org>
Subject: Re: [Archivesspace_Users_Group] Adding display fields for search results - How to?

Noah, Steve and Eric -- thank you for your help.  I've got the plug-in running and in search results I now have a column for "ID" ... however it only shows an ID for a Resource result and not with any of the archival objects.  In the Plug-in, I see this bit of code and am wondering how to have it also display the collection (resource) "identifier" for "archival object".  Our reference staff would like to be able to sort / know to which collection the archival objects belong without having to open each one to find that out.

My continued thanks!   -Kari


 <% @search_data['results'].each do |result|
      deleted = (params.has_key?("deleted_uri") and Array(params["deleted_uri"]).include?(result["id"])) || false
      # SET DISPLAY IDENTIFIER
      @display_identifier = ""
      @display_identifier = result["identifier"].html_safe if result["identifier"]
      @display_identifier = result["digital_object_id"].html_safe if result["digital_object_id"]
      @display_identifier = result["authority_id"].html_safe if result["authority_id"]
      if result["primary_type"] == "archival_object"
        json = JSON.parse(result["json"])
        @display_identifier = json["component_id"].html_safe if json["component_id"]
      end
    %>




________________________________
From: Noah Huffman [noah.huffman at duke.edu]
Sent: Tuesday, September 13, 2016 09:02
To: Kari R Smith
Subject: RE: [Archivesspace_Users_Group] Adding display fields for search results - How to?
Hi Kari,

As Steve and Eric mentioned, you need a comma between the last two plugin names and you should uncomment the line by removing the # from the beginning of the line.

Should look like this:

AppConfig[:plugins] = ['local',  'lcnaf', 'aspace-public-formats', 'aspace-search-identifier']

If you make those change and restart, it should work.  If not, I’m happy to troubleshoot.

We use this plugin at Duke and it’s very useful.

-Noah

From: archivesspace_users_group-bounces at lyralists.lyrasis.org [mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org] On Behalf Of Kari R Smith
Sent: Monday, September 12, 2016 5:02 PM
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: Re: [Archivesspace_Users_Group] Adding display fields for search results - How to?

Noah,
Does this snippet look like it's formatted correctly to work in the config.rb file?  I saved this to the plug-in folder and restarted ASpace but it's not taking (meaning, ID is not showing up in search results.)

#AppConfig[:plugins] = ['local',  'lcnaf', 'aspace-public-formats' 'aspace-search-identifier']

Thanks for your help with this
Kari

________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org<mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org> [archivesspace_users_group-bounces at lyralists.lyrasis.org] on behalf of Noah Huffman [noah.huffman at duke.edu]
Sent: Monday, September 12, 2016 13:52
To: Archivesspace Users Group
Subject: Re: [Archivesspace_Users_Group] Adding display fields for search results - How to?
Kari,

Here is a plugin that adds an identifier column to search results in the staff interface: MailScanner has detected a possible fraud attempt from "urldefense.proofpoint.com" claiming to be https://github.com/lyrasis/aspace-search-identifier<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_lyrasis_aspace-2Dsearch-2Didentifier&d=CwMFEA&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=F0JE8U9-xhxe_nE7d7aEUi-uqfKqvYJ222bS0oz9mko&m=XzVVdhtu-NOYwHpF7t1-skr-ItWN1h9pITcz5Cbf_uE&s=DhHvT91cE0yMiKtoYywN7I2G7ilS_k2IDiDwCZnTUqA&e=>

I assume you could tweak this to have the identifier column display in the public interface as well.

-Noah

From: archivesspace_users_group-bounces at lyralists.lyrasis.org<mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org> [mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org] On Behalf Of Kari R Smith
Sent: Monday, September 12, 2016 1:40 PM
To: Archivesspace Users Group (archivesspace_users_group at lyralists.lyrasis.org<mailto:archivesspace_users_group at lyralists.lyrasis.org>) <archivesspace_users_group at lyralists.lyrasis.org<mailto:archivesspace_users_group at lyralists.lyrasis.org>>
Subject: [Archivesspace_Users_Group] Adding display fields for search results - How to?

Hi,
I’m interested in hearing about any solutions for adding to the display fields for search results.  Our main interest is in having the collection ID display in addition to the Resource Type and Title (currently the only displayed data + last modified data).

Thanks,

Kari R. Smith
Digital Archivist, Institute Archives and Special Collections
Massachusetts Institute of Technology Libraries
617.253.5690   smithkr at mit.edu   MailScanner has detected a possible fraud attempt from "urldefense.proofpoint.com" claiming to be http://libraries.mit.edu/archives/<https://urldefense.proofpoint.com/v2/url?u=http-3A__libraries.mit.edu_archives_&d=CwMFEA&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=F0JE8U9-xhxe_nE7d7aEUi-uqfKqvYJ222bS0oz9mko&m=XzVVdhtu-NOYwHpF7t1-skr-ItWN1h9pITcz5Cbf_uE&s=EBE7rM9t-8OTzIMav4NpIY7v4ego4g7TTFaz_c7R0Rg&e=>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20160913/0752094e/attachment.html>


More information about the Archivesspace_Users_Group mailing list