Sha256: 80004d824f427269b9d0fbb4cfa1ff106367d4f95d01f708cdb75bef3b37f135
Contents?: true
Size: 1 KB
Versions: 1
Compression:
Stored size: 1 KB
Contents
require "transformator/transformation" require_relative "../result_transformation" class Skala::PrimoAdapter::Search::ResultTransformation:: DocTransformation < Transformator::Transformation require_directory "#{File.dirname(__FILE__)}/doc_transformation" def call(source, options = {}) options[:target] ||= Skala::Adapter::Search::Result::Hit.new(record: {}) super(source, options) end sequence [ SetMetadata, [ # fields SetId, SetCreator, SetTitle, SetYearOfPublication, SetEdition, SetPublisher, SetSubject, SetLanguage, SetDescription, SetSource, SetIsPartOf, SetIdentifier, SetOpenurl, SetFulltextAvailable ], #AddImage, # needs isbn to be present ] def read_source_values(xpath, split: nil) source.xpath(xpath).map do |e| if split e.content.try do |c| c.split(split).map(&:strip) end else e.content end end.flatten.compact end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
skala-1.1.0 | lib/skala/primo_adapter/search/result_transformation/doc_transformation.rb |