Skip to content

Commit

Permalink
switch over the creation of links in pub-hash from http to https; mov…
Browse files Browse the repository at this point in the history
…e the base URLs to config
  • Loading branch information
peetucket committed Oct 25, 2016
1 parent 9989c1d commit 1b1fa59
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 51 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

# SUL Bibliographic Management System

[*SUL Bibliographic Management System*](http://sulcap.stanford.edu/)
by [Stanford University Libraries](http://library.stanford.edu).
[*SUL Bibliographic Management System*](https://sulcap.stanford.edu/)
by [Stanford University Libraries](https://library.stanford.edu).

## Configuration

Expand Down
4 changes: 2 additions & 2 deletions app/data/bibtex_to_ingest/August19 17 Batch/aydin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ journal = {Geological Society, London,},
title = {Fluid flow through porous sandstone with overprinting and intersecting geological structures of various types},
year = {2012},
doi = {10.1144/SP374.11},
url = {http://dx.doi.org/10.1144/SP374.11},
url = {https://dx.doi.org/10.1144/SP374.11},
comment = {Special Paper on Advances in the Study of Fractured Reservoirs},
}

Expand All @@ -53,7 +53,7 @@ journal = {Journal of Structural Geology},
title = {Growth processes, dimensional parameters and scaling relationships of two conjugate sets of compactive shear bands in porous carbonate grainstones, Favignana Island, Italy},
year = {2012},
doi = {10.1016/j.bbr.2011.03.031},
url = {http://dx.doi.org/10.1016/j.bbr.2011.03.031},
url = {https://dx.doi.org/10.1016/j.bbr.2011.03.031},
}

@article{na110,
Expand Down
4 changes: 2 additions & 2 deletions app/data/bibtex_to_ingest/August19 17 Batch/elambin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ author = {Lambin E. F. and Gibbs H. and Ferreira L. and Grau R. and Mayaux P. an
journal = {Global Environmental Change},
title = {Estimating the world's potentially available cropland using a bottom-up approach},
year = {2013},
url = {http://dx.doi.org/10.1016/j.gloenvcha.2013.05.005},
url = {https://dx.doi.org/10.1016/j.gloenvcha.2013.05.005},
}

@article{jvmrtfwcfsawfrra13,
Expand Down Expand Up @@ -39,7 +39,7 @@ journal = {Current Opinion in Environmental Sustainability},
title = {Globalization of land use: Displacement and distant drivers},
volume = {5},
year = {2013},
url = {http://dx.doi.org/10.1016/j.cosust.2013.04.003},
url = {https://dx.doi.org/10.1016/j.cosust.2013.04.003},
}

@incollection{fp13,
Expand Down
12 changes: 6 additions & 6 deletions app/data/bibtex_to_ingest/August23 8 Batch/mjgrove.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ author = {J. C. Fosdick and M. Grove and J. K. Hourigan and M. Calderón},
journal = {Earth and Planetary Science Letters},
title = {Retroarc deformation and exhumation near the end of the Andes, southern Patagonia},
year = {2013},
url = {http://dx.doi.org/10.1016/j.epsl.2012.12.007},
url = {https://dx.doi.org/10.1016/j.epsl.2012.12.007},
}

@article{yfiwwlg13,
Expand All @@ -56,7 +56,7 @@ pages = {268-282},
title = {Is Myanmar jadeitite of Jurassic age? A result from incompletely recrystallized inherited zircon},
volume = {160-161},
year = {2013},
url = {http://dx.doi.org/10.1016/j.lithos.2012.12.011},
url = {https://dx.doi.org/10.1016/j.lithos.2012.12.011},
}

@article{zlcgoit13,
Expand All @@ -75,7 +75,7 @@ pages = {TC6006},
title = {Paleozoic-to-early Cenozoic cooling and exhumation of the basement underlying the eastern Puna plateau margin},
volume = {31},
year = {2013},
url = {http://dx.doi.org/10.1029/2012TC003168},
url = {https://dx.doi.org/10.1029/2012TC003168},
}

@article{fgsbi12,
Expand Down Expand Up @@ -156,7 +156,7 @@ pages = {75-87},
title = {Calibration of Nu-Instruments Noblesse multicollector mass spectrometers for argon isotopic measurements using a newly developed reference gas},
volume = {290},
year = {2011},
url = {http://dx.doi.org/10.1016/j.chemgeo.2011.09.003},
url = {https://dx.doi.org/10.1016/j.chemgeo.2011.09.003},
}

@article{gtiwgsm11,
Expand Down Expand Up @@ -247,7 +247,7 @@ number = {20-30},
title = {Decoupling of U-Pb dates from chemical and crystallographic domains in granulite facies zircon},
volume = {270},
year = {2010},
url = {http://dx.doi.org/10.1016/j.chemgeo.2009.11.002},
url = {https://dx.doi.org/10.1016/j.chemgeo.2009.11.002},
}

@article{kelwg10,
Expand All @@ -257,7 +257,7 @@ pages = {22-32},
title = {First Paleoproterozoic ophiolite from Gondwana: Geochronologic-geochemical documentation of ancient oceanic crust from Kandra, SE India},
volume = {487},
year = {2010},
url = {http://dx.doi.org/10.1016/j.tecto.2010.03.005},
url = {https://dx.doi.org/10.1016/j.tecto.2010.03.005},
}

@article{cygdslkgf09,
Expand Down
2 changes: 1 addition & 1 deletion app/data/bibtex_to_ingest/August23 8 Batch/mmac.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ title = {Provenance of north Gondwana Cambrian-Ordovician sandstone: U-Pb SHRIMP
volume = {143},
year = {2006},
doi = {10.1017/S0016756805001640},
url = {http://dx.doi.org/10.1017/S0016756805001640},
url = {https://dx.doi.org/10.1017/S0016756805001640},
}

@article{vmdgm05,
Expand Down
4 changes: 2 additions & 2 deletions app/data/bibtex_to_ingest/August23 8 Batch/zoback.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ title = {Intraplate Earthquakes, Regional Stress and Fault Mechanics in the Cent
volume = {581},
year = {2012},
doi = {10.1016/j.tecto.2012.04.002},
url = {http://dx.doi.org/10.1016/j.tecto.2012.04.002},
url = {https://dx.doi.org/10.1016/j.tecto.2012.04.002},
}

@article{dz11,
Expand Down Expand Up @@ -330,7 +330,7 @@ title = {Viscous creep in room-dried unconsolidated Gulf of Mexico shale (II): D
volume = {72},
year = {2010},
doi = {0.2118/110542-PA},
url = {http://dx.doi.org/10.2118/110542-PA},
url = {https://dx.doi.org/10.2118/110542-PA},
}

@article{cz09,
Expand Down
4 changes: 2 additions & 2 deletions app/models/pubmed_source_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def convert_pubmed_publication_doc_to_hash(publication)
journal_hash[:identifier] = journal_identifiers
record_as_hash[:journal] = journal_hash

record_as_hash[:identifier] = [{ type: 'PMID', id: pmid, url: 'http://www.ncbi.nlm.nih.gov/pubmed/' + pmid }]
record_as_hash[:identifier] = [{ type: 'PMID', id: pmid, url: "#{Settings.PUBMED.ARTICLE_BASE_URI}#{pmid}"}]
# the DOI can be in one of two places: ArticleId or ELocationID
doi = publication.at_xpath('//ArticleId[@IdType="doi"]')
doi = publication.at_xpath('//ELocationID[@EIdType="doi"]') unless doi.present? && doi.text.present?
record_as_hash[:identifier] << { type: 'doi', id: doi.text, url: 'http://dx.doi.org/' + doi.text } if doi.present? && doi.text.present?
record_as_hash[:identifier] << { type: 'doi', id: doi.text, url: "#{Settings.SCIENCEWIRE.DOI_BASE_URL}#{doi.text}" } if doi.present? && doi.text.present?

record_as_hash
end
Expand Down
6 changes: 3 additions & 3 deletions app/models/sciencewire_source_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ def self.convert_sw_publication_doc_to_hash(publication)
swid = extract_swid(publication)
wosid = extract_wosid(publication)

doi_identifier = { type: 'doi', id: doi, url: 'http://dx.doi.org/' + doi } unless doi.blank?
doi_identifier = { type: 'doi', id: doi, url: "#{Settings.SCIENCEWIRE.DOI_BASE_URL}#{doi}" } unless doi.blank?
issn_identifier = { type: 'issn', id: issn, url: Settings.SULPUB_ID.SEARCHWORKS_URI + issn } unless issn.blank?

identifiers = []
identifiers << { type: 'PMID', id: pmid, url: 'http://www.ncbi.nlm.nih.gov/pubmed/' + pmid } unless pmid.blank?
identifiers << { type: 'WoSItemID', id: wosid, url: 'http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/' + wosid } unless wosid.blank?
identifiers << { type: 'PMID', id: pmid, url: "#{Settings.PUBMED.ARTICLE_BASE_URI}#{pmid}" } unless pmid.blank?
identifiers << { type: 'WoSItemID', id: wosid, url: "#{Settings.SCIENCEWIRE.ARTICLE_BASE_URI}#{wosid}" } unless wosid.blank?
identifiers << { type: 'PublicationItemID', id: swid } unless swid.blank?
identifiers << doi_identifier unless doi.blank?

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<%= link_to image_tag("sul-logo.png", alt: "SUL"), 'http://library.stanford.edu/' %>
<%= link_to image_tag("sul-logo.png", alt: "SUL"), 'https://library.stanford.edu/' %>
</div>
<!-- <%= link_to "SUL Publications Server", '#', id: "logo" %> -->
<!-- <nav>
Expand Down
10 changes: 5 additions & 5 deletions app/views/pages/api_samples/get_pub_out.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
{
"id": "7692670",
"type": "PMID",
"url": "http://www.ncbi.nlm.nih.gov/pubmed/7692670"
"url": "https://www.ncbi.nlm.nih.gov/pubmed/7692670"
},
{
"id": "A1993MB62100041",
"type": "WoSItemID",
"url": "http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/A1993MB62100041"
"url": "https://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/A1993MB62100041"
},
{
"id": "24151039",
Expand All @@ -17,7 +17,7 @@
{
"id": "1702",
"type": "SULPubId",
"url": "http://sulcap.stanford.edu/publications/1702"
"url": "https://sulcap.stanford.edu/publications/1702"
}
],
"title": "IDENTIFICATION OF A NEW NEUTRALIZATION EPITOPE ON VP7 OF HUMAN SEROTYPE-2 ROTAVIRUS AND EVIDENCE FOR ELECTROPHEROTYPE DIFFERENCES CAUSED BY SINGLE NUCLEOTIDE SUBSTITUTIONS",
Expand Down Expand Up @@ -295,12 +295,12 @@
{
"id": "0042-6822",
"type": "issn",
"url": "http://searchworks.stanford.edu/?search_field=advanced&number=0042-6822"
"url": "https://searchworks.stanford.edu/?search_field=advanced&number=0042-6822"
},
{
"id": "",
"type": "doi",
"url": "http://dx.doi.org/"
"url": "https://dx.doi.org/"
}
],
"conferencestartdate": "",
Expand Down
20 changes: 10 additions & 10 deletions app/views/pages/api_samples/get_pubs_out.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
{
"id": "15262723",
"type": "PMID",
"url": "http://www.ncbi.nlm.nih.gov/pubmed/15262723"
"url": "https://www.ncbi.nlm.nih.gov/pubmed/15262723"
},
{
"id": "",
"type": "WoSItemID",
"url": "http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/"
"url": "https://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/"
},
{
"id": "45435892",
Expand All @@ -28,7 +28,7 @@
{
"id": "1573",
"type": "SULPubId",
"url": "http://sulcap.stanford.edu/publications/1573"
"url": "https://sulcap.stanford.edu/publications/1573"
}
],
"title": "Use of a dual-mode erbium:YAG laser for the surgical correction of rhinophyma.",
Expand Down Expand Up @@ -162,12 +162,12 @@
{
"id": "1521-2491",
"type": "issn",
"url": "http://searchworks.stanford.edu/?search_field=advanced&number=1521-2491"
"url": "https://searchworks.stanford.edu/?search_field=advanced&number=1521-2491"
},
{
"id": "",
"type": "doi",
"url": "http://dx.doi.org/"
"url": "https://dx.doi.org/"
}
],
"conferencestartdate": "",
Expand All @@ -191,12 +191,12 @@
{
"id": "15137956",
"type": "PMID",
"url": "http://www.ncbi.nlm.nih.gov/pubmed/15137956"
"url": "https://www.ncbi.nlm.nih.gov/pubmed/15137956"
},
{
"id": "",
"type": "WoSItemID",
"url": "http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/"
"url": "https://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/"
},
{
"id": "45408384",
Expand All @@ -205,7 +205,7 @@
{
"id": "1574",
"type": "SULPubId",
"url": "http://sulcap.stanford.edu/publications/1574"
"url": "https://sulcap.stanford.edu/publications/1574"
}
],
"title": "The etiology and epidemiology of anal cancer.",
Expand Down Expand Up @@ -397,12 +397,12 @@
{
"id": "1055-3207",
"type": "issn",
"url": "http://searchworks.stanford.edu/?search_field=advanced&number=1055-3207"
"url": "https://searchworks.stanford.edu/?search_field=advanced&number=1055-3207"
},
{
"id": "",
"type": "doi",
"url": "http://dx.doi.org/"
"url": "https://dx.doi.org/"
}
],
"conferencestartdate": "",
Expand Down
5 changes: 4 additions & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ PUBMED:
LOG: log/pubmed.log
FETCH_PATH: /entrez/eutils/efetch.fcgi?db=pubmed&retmode=xml
BASE_URI: https://eutils.ncbi.nlm.nih.gov

ARTICLE_BASE_URI: https://www.ncbi.nlm.nih.gov/pubmed/

## Sciencewire Auth Config
SCIENCEWIRE:
LOG: log/sciencewire.log
Expand All @@ -39,6 +40,8 @@ SCIENCEWIRE:
LICENSE_ID: some-license-id
RECOMMENDATION_PATH: /PublicationCatalog/MatchedPublicationItemIdsForAuthor?format=xml
TMPDIR: /tmp
ARTICLE_BASE_URI: https://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/
DOI_BASE_URL: https://dx.doi.org/

HARVESTER:
USE_MIDDLE_NAME: true
Expand Down
2 changes: 1 addition & 1 deletion lib/bibtex_ingester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def convert_bibtex_record_to_pub_hash(record, author)
identifiers << isbn_for_id_array
end
unless doi.blank?
doi_for_id_array = { type: 'doi', id: doi, url: 'http://dx.doi.org/' + doi }
doi_for_id_array = { type: 'doi', id: doi, url: "#{Settings.SCIENCEWIRE.DOI_BASE_URL}#{doi}" }
identifiers << doi_for_id_array
record_as_hash[:doi] = doi
end
Expand Down
6 changes: 3 additions & 3 deletions spec/api/sul_bib/authorship_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,15 @@
it 'adds proper identifiers section' do
pub_ids = result['identifier']
# Check the PMID, e.g.
# {"type"=>"PMID", "id"=>"23684686", "url"=>"http://www.ncbi.nlm.nih.gov/pubmed/23684686"}
# {"type"=>"PMID", "id"=>"23684686", "url"=>"https://www.ncbi.nlm.nih.gov/pubmed/23684686"}
pmid_hash = pub_ids.find {|id| id['type'] == 'PMID'}
expect(pmid_hash).to be_instance_of Hash
pmid = request_data[:pmid]
expect(pmid_hash['type']).to eq('PMID')
expect(pmid_hash['id']).to eq(pmid)
expect(pmid_hash['url']).to eq("http://www.ncbi.nlm.nih.gov/pubmed/#{pmid}")
expect(pmid_hash['url']).to eq("https://www.ncbi.nlm.nih.gov/pubmed/#{pmid}")
# Check the SULPubId, e.g.
# {:type=>"SULPubId", :id=>"2355", :url=>"http://sulcap.stanford.edu/publications/2355"}],
# {:type=>"SULPubId", :id=>"2355", :url=>"https://sulcap.stanford.edu/publications/2355"}],
sul_hash = pub_ids.find {|id| id['type'] == 'SULPubId'}
expect(sul_hash).to be_instance_of Hash
sul_pub_id = Publication.last.id.to_s
Expand Down
2 changes: 1 addition & 1 deletion spec/api/sul_bib/sourcelookup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
{
type: 'doi',
id: test_doi,
url: "http://dx.doi.org/#{test_doi}"
url: "https://dx.doi.org/#{test_doi}"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions spec/factories/pub_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
url: Settings.SULPUB_ID.SEARCHWORKS_URI + '0165-0173' },
{ type: 'doi',
id: '10.1016/j.brainresrev.2004.05.006',
url: 'http://dx.doi.org/10.1016/j.brainresrev.2004.05.006' }] },
url: 'https://dx.doi.org/10.1016/j.brainresrev.2004.05.006' }] },
abstract: 'Gap junctions represent direct intercellular conduits between contacting cells. The subunit proteins of these conduits are called connexins. To date, 20 and 21 connexin genes have been described in the mouse and human genome, respectiv',
last_updated: '2013-07-23 22:06:49 UTC',
authorship: [{ cap_profile_id: 8804,
Expand Down Expand Up @@ -89,7 +89,7 @@
url: Settings.SULPUB_ID.SEARCHWORKS_URI + '0165-0173' },
{ type: 'doi',
id: '10.1016/j.brainresrev.2004.05.006',
url: 'http://dx.doi.org/10.1016/j.brainresrev.2004.05.006' }] },
url: 'https://dx.doi.org/10.1016/j.brainresrev.2004.05.006' }] },
abstract: 'Gap junctions represent direct intercellular conduits between contacting cells. The subunit proteins of these conduits are called connexins. To date, 20 and 21 connexin genes have been described in the mouse and human genome, respectiv',
last_updated: '2013-07-23 22:06:49 UTC',
authorship: [{ cap_profile_id: 8804,
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/user_submitted_source_records.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"id": "10.1016/j.petrol.2016.02.026",
"type": "doi",
"url": "http://dx.doi.org/10.1016/j.petrol.2016.02.026",
"url": "https://dx.doi.org/10.1016/j.petrol.2016.02.026",
"additionalProperties": {}
}
],
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/doi_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
VCR.use_cassette('doi_search_manual_doi_local') do
publication.pub_hash = {
provenance: 'cap',
identifier: [{ type: 'doi', id: '10.1111/j.1444-0938.2010.00524.x', url: 'http://dx.doi.org/10.1111/j.1444-0938.2010.00524.x' }]
identifier: [{ type: 'doi', id: '10.1111/j.1444-0938.2010.00524.x', url: 'https://dx.doi.org/10.1111/j.1444-0938.2010.00524.x' }]
}
publication.sync_identifiers_in_pub_hash_to_db
publication.save
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/pubmed_harvester_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# /publications/sourcelookup?pmid=
h = PubmedHarvester.search_all_sources_by_pmid 24_930_130
expect(h.first[:provenance]).to eq('pubmed')
expect(h.first[:identifier]).to include(type: 'doi', id: '10.1038/nmeth.2999', url: 'http://dx.doi.org/10.1038/nmeth.2999')
expect(h.first[:identifier]).to include(type: 'doi', id: '10.1038/nmeth.2999', url: 'https://dx.doi.org/10.1038/nmeth.2999')
expect(h.first[:chicago_citation]).to match(/Chemically Defined Generation/)
end

Expand Down
Loading

0 comments on commit 1b1fa59

Please sign in to comment.