app/controllers/collections_controller.rb
# TODO - review these. There are too many and as a result there's some redundancy in, for example, checking whether the user is logged in on unpublished
# collections
review these. There are too many and as a result there's some redundancy in, for example, checking whether the user is logged in on unpublished
collections
review these . There are too many and as a result there ' s some redundancy in for example checking whether the user is logged in on unpublished collections
def collection_items_with_scope(options)
    collection_items = []
    if params[:scope].nil? || params[:scope] == 'selected_items'
      collection_items = options[:items] 
    elsif params[:scope] == 'all_items'
      raise EOL::Exceptions::MaxCollectionItemsExceeded if
        options[:from].collection_items.count > $MAX_COLLECTION_ITEMS_TO_MANIPULATE && ! options[:allow_all]
      collection_items = options[:from].collection_items
    else 
      count = options[:from].facet_count(CollectionItem.types[params[:scope].to_sym][:facet])
      raise EOL::Exceptions::MaxCollectionItemsExceeded if count > $MAX_COLLECTION_ITEMS_TO_MANIPULATE
      results = options[:from].items_from_solr(facet_type: params[:scope], page: 1,
                                               per_page: $MAX_COLLECTION_ITEMS_TO_MANIPULATE)
      collection_items = results.map { |i| i['instance'] }
    end
    collection_items
  end
def collection_items_with_scope ( options ) collection_items = [ ] if params [ :scope ] . nil? || params [ :scope ] == 'selected_items' collection_items = options [ :items ] elsif params [ :scope ] == 'all_items' raise EOL :: Exceptions :: MaxCollectionItemsExceeded if options [ :from ] . collection_items . count > $MAX_COLLECTION_ITEMS_TO_MANIPULATE && ! options [ :allow_all ] collection_items = options [ :from ] . collection_items else count = options [ :from ] . facet_count ( CollectionItem . types [ params [ :scope ] . to_sym ] [ :facet ] ) raise EOL :: Exceptions :: MaxCollectionItemsExceeded if count > $MAX_COLLECTION_ITEMS_TO_MANIPULATE results = options [ :from ] . items_from_solr ( facet_type : params [ :scope ] , page : 1 , per_page : $MAX_COLLECTION_ITEMS_TO_MANIPULATE ) collection_items = results . map { | i | i [ 'instance' ] } end collection_items end
TODO - review these.
TODO - review these .
# NOTE - no limit, since these are HTML parms, which are limited already. # It's a particular type of item.
options
<not_specific>