Sha256: 8c975bbc14cbc2de65341957c9b4e6a21b8ae02f763ca87720303c1dc2599978

Contents?: true

Size: 867 Bytes

Versions: 35

Compression:

Stored size: 867 Bytes

Contents

# returns a list of solr documents for collections the item is a part of
module Hyrax
  class CollectionMemberService
    include Blacklight::Configurable
    include Blacklight::SearchHelper

    attr_reader :item, :current_ability

    copy_blacklight_config_from(CatalogController)

    # @param [SolrDocument] item represents a work
    def self.run(item, ability)
      new(item, ability).list_collections
    end

    def initialize(item, ability)
      @item = item
      @current_ability = ability
    end

    def list_collections
      query = collection_search_builder.rows(1000)
      resp = repository.search(query)
      resp.documents
    end

    def collection_search_builder
      @collection_search_builder ||= ParentCollectionSearchBuilder.new([:include_item_ids, :add_paging_to_solr, :add_access_controls_to_solr_params], self)
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/services/hyrax/collection_member_service.rb
hyrax-2.9.5 app/services/hyrax/collection_member_service.rb
hyrax-2.9.4 app/services/hyrax/collection_member_service.rb
hyrax-2.9.3 app/services/hyrax/collection_member_service.rb
hyrax-2.9.2 app/services/hyrax/collection_member_service.rb
hyrax-2.9.1 app/services/hyrax/collection_member_service.rb
hyrax-2.9.0 app/services/hyrax/collection_member_service.rb
hyrax-2.8.0 app/services/hyrax/collection_member_service.rb
hyrax-2.7.2 app/services/hyrax/collection_member_service.rb
hyrax-2.7.1 app/services/hyrax/collection_member_service.rb
hyrax-2.7.0 app/services/hyrax/collection_member_service.rb
hyrax-2.6.0 app/services/hyrax/collection_member_service.rb
hyrax-3.0.0.pre.rc1 app/services/hyrax/collection_member_service.rb
hyrax-3.0.0.pre.beta3 app/services/hyrax/collection_member_service.rb
hyrax-2.5.1 app/services/hyrax/collection_member_service.rb
hyrax-2.5.0 app/services/hyrax/collection_member_service.rb
hyrax-3.0.0.pre.beta2 app/services/hyrax/collection_member_service.rb
hyrax-2.4.1 app/services/hyrax/collection_member_service.rb
hyrax-3.0.0.pre.beta1 app/services/hyrax/collection_member_service.rb
hyrax-2.4.0 app/services/hyrax/collection_member_service.rb