Sha256: a2cfbaeb9d5f81ff4a2f7f184c84bf1fec4b1fd40fccb039472a8f701b92823d

Contents?: true

Size: 883 Bytes

Versions: 9

Compression:

Stored size: 883 Bytes

Contents

module BlacklightOaiProvider
  module Response
    class ListSets < OAI::Provider::Response::Base
      def to_xml
        raise OAI::SetException unless provider.model.sets

        response do |r|
          r.ListSets do
            provider.model.sets.each do |set|
              r.set do
                r.setSpec set.spec
                r.setName set.name

                if set.respond_to?(:description) && set.description
                  r.setDescription do
                    r.tag!("#{oai_dc.prefix}:#{oai_dc.element_namespace}", oai_dc.header_specification) do
                      r.dc :description, set.description
                    end
                  end
                end
              end
            end
          end
        end
      end

      private

      def oai_dc
        OAI::Provider::Metadata::DublinCore.instance
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
blacklight_oai_provider-7.0.2 lib/blacklight_oai_provider/response/list_sets.rb
blacklight_oai_provider-6.1.1 lib/blacklight_oai_provider/response/list_sets.rb
blacklight_oai_provider-6.1.0 lib/blacklight_oai_provider/response/list_sets.rb
blacklight_oai_provider-6.0.0 lib/blacklight_oai_provider/response/list_sets.rb
blacklight_oai_provider-6.0.0.pre2 lib/blacklight_oai_provider/response/list_sets.rb
blacklight_oai_provider-6.0.0.pre1 lib/blacklight_oai_provider/response/list_sets.rb
blacklight_oai_provider-5.1.0 lib/blacklight_oai_provider/response/list_sets.rb
blacklight_oai_provider-5.0.0 lib/blacklight_oai_provider/response/list_sets.rb
blacklight_oai_provider-5.0.0.pre1 lib/blacklight_oai_provider/response/list_sets.rb