Skip to content

Commit 678b494

Browse files
authored
remove junii2 support (#1832)
1 parent 755485c commit 678b494

File tree

2 files changed

+0
-144
lines changed

2 files changed

+0
-144
lines changed

app/models/concerns/enju_oai/junii2.rb

-22
This file was deleted.

app/models/concerns/enju_oai/oai_model.rb

-122
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module EnjuOai
22
module OaiModel
33
extend ActiveSupport::Concern
44
OAI::Provider::Base.register_format(EnjuOai::Jpcoar.instance)
5-
OAI::Provider::Base.register_format(EnjuOai::Junii2.instance)
65
OAI::Provider::Base.register_format(EnjuOai::Dcndl.instance)
76

87
def to_oai_dc
@@ -263,127 +262,6 @@ def to_dcndl
263262
xml.target!
264263
end
265264

266-
def to_junii2
267-
xml = Builder::XmlMarkup.new
268-
xml.junii2 :version => '3.1',
269-
"xsi:schemaLocation" => "http://irdb.nii.ac.jp/oai http://irdb.nii.ac.jp/oai/junii2-3-1.xsd",
270-
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
271-
"xmlns" => "http://irdb.nii.ac.jp/oai",
272-
"xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
273-
xml.title original_title
274-
xml.alternative title_alternative if title_alternative.present?
275-
276-
creators.readable_by(nil).each do |patron|
277-
xml.creator patron.full_name
278-
end
279-
280-
subjects.each do |subject|
281-
unless subject.subject_type.name =~ /BSH|NDLSH|MeSH|LCSH/io
282-
xml.subject subject.term
283-
end
284-
end
285-
286-
if try(:classifications)
287-
%w[NDC NDLC].each do |c|
288-
classifications.each do |classification|
289-
if classification.classification_type.name =~ /#{c}/i
290-
xml.tag! c, classification.category
291-
end
292-
end
293-
end
294-
end
295-
296-
if try(:subjects)
297-
%w[BSH NDLSH MeSH].each do |s|
298-
subjects.each do |subject|
299-
if subject.subject_type.name =~ /#{s}/i
300-
xml.tag! subject, subject.term
301-
end
302-
end
303-
end
304-
end
305-
306-
if try(:classifications)
307-
%w[DDC LCC UDC].each do |c|
308-
classifications.each do |classification|
309-
if classification.classification_type.name =~ /#{c}/i
310-
xml.tag! c, classification.category
311-
end
312-
end
313-
end
314-
end
315-
316-
subjects.each do |s|
317-
if s.subject_type.name =~ /LCSH/i
318-
xml.tag! subject, subject.term
319-
end
320-
end
321-
322-
if description?
323-
xml.description description
324-
end
325-
publishers.readable_by(nil).each do |patron|
326-
xml.publisher patron.full_name
327-
end
328-
contributors.readable_by(nil).each do |patron|
329-
xml.contributor patron.full_name
330-
end
331-
xml.date created_at.to_date.iso8601
332-
xml.type manifestation_content_type&.name
333-
if try(:nii_type)
334-
xml.NIItype nii_type.name
335-
else
336-
xml.NIItype 'Others'
337-
end
338-
if attachment.attached?
339-
xml.format attachment.content_type
340-
end
341-
if manifestation_identifier?
342-
xml.identifier manifestation_identifier
343-
end
344-
identifiers.each do |identifier|
345-
unless identifier.identifier_type.name =~ /isbn|issn|ncid|doi|naid|pmid|ichushi/io
346-
xml.identifier identifier.body
347-
end
348-
end
349-
xml.URI URI.join(ENV['ENJU_LEAF_BASE_URL'], "/manifestations/#{id}")
350-
if attachment.attached?
351-
xml.fulltextURL Rails.application.routes.url_helpers.rails_storage_proxy_url(fileset.attachment, host: ENV['ENJU_LEAF_BASE_URL'])
352-
end
353-
%w[isbn issn NCID].each do |identifier|
354-
identifier_contents(identifier.downcase).each do |val|
355-
xml.tag! identifier, val
356-
end
357-
end
358-
if root_series_statement
359-
xml.jtitle root_series_statement.original_title
360-
end
361-
xml.volume volume_number_string
362-
xml.issue issue_number_string
363-
xml.spage start_page
364-
xml.epage end_page
365-
if pub_date?
366-
xml.dateofissued pub_date
367-
end
368-
# TODO: junii2: source
369-
if language.blank? || language.name == 'unknown'
370-
xml.language "und"
371-
else
372-
xml.language language.iso_639_2
373-
end
374-
%w[pmid doi NAID ichushi].each do |identifier|
375-
identifier_contents(identifier.downcase).each do |val|
376-
xml.tag! identifier, val
377-
end
378-
end
379-
# TODO: junii2: isVersionOf, hasVersion, isReplaceBy, replaces, isRequiredBy, requires, isPartOf, hasPart, isReferencedBy, references, isFormatOf, hasFormat
380-
# TODO: junii2: coverage, spatial, NIIspatial, temporal, NIItemporal
381-
# TODO: junii2: rights
382-
# TODO: junii2: textversion
383-
# TODO: junii2: grantid, dateofgranted, degreename, grantor
384-
end
385-
end
386-
387265
def self.repository_url
388266
URI.join(ENV['ENJU_LEAF_BASE_URL'], '/oai')
389267
end

0 commit comments

Comments
 (0)