Class: Hyrax::Dashboard::NestedCollectionsSearchBuilder
- Inherits:
-
CollectionSearchBuilder
- Object
- SearchBuilder
- CollectionSearchBuilder
- Hyrax::Dashboard::NestedCollectionsSearchBuilder
- Defined in:
- app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb
Overview
Responsible for searching for collections of the same type that are not the given collection
Instance Attribute Summary collapse
-
#discovery_permissions ⇒ Object
readonly
Override for Hydra::AccessControlsEnforcement.
Attributes inherited from CollectionSearchBuilder
Instance Method Summary collapse
-
#initialize(access:, collection:, scope:, nesting_attributes:, nest_direction:) ⇒ NestedCollectionsSearchBuilder
constructor
A new instance of NestedCollectionsSearchBuilder.
- #show_only_other_collections_of_the_same_collection_type(solr_parameters) ⇒ Object
- #with_pagination(solr_parameters) ⇒ Object
Methods inherited from CollectionSearchBuilder
#add_sorting_to_solr, #gated_discovery_filters, #models, #sort_field, #with_access
Methods included from FilterByType
Constructor Details
#initialize(access:, collection:, scope:, nesting_attributes:, nest_direction:) ⇒ NestedCollectionsSearchBuilder
Returns a new instance of NestedCollectionsSearchBuilder.
11 12 13 14 15 16 17 |
# File 'app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb', line 11 def initialize(access:, collection:, scope:, nesting_attributes:, nest_direction:) super(scope) @collection = collection @discovery_permissions = (access) @nesting_attributes = nesting_attributes @nest_direction = nest_direction end |
Instance Attribute Details
#discovery_permissions ⇒ Object (readonly)
Override for Hydra::AccessControlsEnforcement
20 21 22 |
# File 'app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb', line 20 def @discovery_permissions end |
Instance Method Details
#show_only_other_collections_of_the_same_collection_type(solr_parameters) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb', line 27 def show_only_other_collections_of_the_same_collection_type(solr_parameters) solr_parameters[:fq] ||= [] solr_parameters[:fq] += [ "-" + Hyrax::SolrQueryBuilderService.construct_query_for_ids([limit_ids]), Hyrax::SolrQueryBuilderService.construct_query(Hyrax.config.collection_type_index_field => @collection.collection_type_gid) ] solr_parameters[:fq] += limit_clause if limit_clause # add limits to prevent illegal nesting arrangements end |
#with_pagination(solr_parameters) ⇒ Object
23 24 25 |
# File 'app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb', line 23 def with_pagination(solr_parameters) solr_parameters[:rows] = 1000 end |