lib/libis/services/scope/search.rb in libis-services-1.0.0 vs lib/libis/services/scope/search.rb in libis-services-1.0.1
- old
+ new
@@ -15,13 +15,17 @@
@doc = nil
end
def connect(name, password, database = nil)
database ||= 'libis-db-scope.cc.kuleuven.be:1556/SCOPEP.kuleuven.be'
- @oracle = OracleClient.new(database, name, password)
+ @oracle = OracleClient.new("#{name}/#{password}/#{database}")
end
+ def connect_url(url)
+ @oracle = OracleClient.new(url)
+ end
+
def find(term, options = {})
super
end
def query(term, options = {})
@@ -33,11 +37,11 @@
@oracle.call('kul_packages.scope_xml_meta_file_by_id', [term.to_i])
else
raise RuntimeError, "Invalid Scope search type '#{options[:type]}'"
end
term = term.gsub(/[-\/]/, '_')
- err_file = "/nas/vol03/oracle/SCOPEP/#{term}_err.XML"
- md_file = "/nas/vol03/oracle/SCOPEP/#{term}_md.XML"
+ err_file = "/nas/vol03/oracle/#{options[:dir] || 'SCOPEP'}/#{term}_err.XML"
+ md_file = "/nas/vol03/oracle/#{options[:dir] || 'SCOPEP'}/#{term}_md.XML"
if File.exist? err_file
doc = Libis::Tools::XmlDocument.open(err_file)
msg = doc['/error/error_msg']
detail = doc['/error/error_']
File.delete(err_file) rescue nil