From 1b1fa591491bb09cb58e471e5fdd095a89da722e Mon Sep 17 00:00:00 2001 From: Peter Mangiafico Date: Fri, 21 Oct 2016 13:53:07 -0700 Subject: [PATCH 1/2] switch over the creation of links in pub-hash from http to https; move the base URLs to config --- README.md | 4 ++-- .../August19 17 Batch/aydin.txt | 4 ++-- .../August19 17 Batch/elambin.txt | 4 ++-- .../August23 8 Batch/mjgrove.txt | 12 +++++------ .../August23 8 Batch/mmac.txt | 2 +- .../August23 8 Batch/zoback.txt | 4 ++-- app/models/pubmed_source_record.rb | 4 ++-- app/models/sciencewire_source_record.rb | 6 +++--- app/views/layouts/_header.html.erb | 2 +- app/views/pages/api_samples/get_pub_out.json | 10 +++++----- app/views/pages/api_samples/get_pubs_out.json | 20 +++++++++---------- config/settings.yml | 5 ++++- lib/bibtex_ingester.rb | 2 +- spec/api/sul_bib/authorship_api_spec.rb | 6 +++--- spec/api/sul_bib/sourcelookup_spec.rb | 2 +- spec/factories/pub_hash.rb | 4 ++-- .../user_submitted_source_records.rb | 2 +- spec/lib/doi_search_spec.rb | 2 +- spec/lib/pubmed_harvester_spec.rb | 2 +- spec/models/pub_hash_spec.rb | 4 ++-- spec/models/publication_spec.rb | 2 +- spec/models/pubmed_source_record_spec.rb | 2 +- 22 files changed, 54 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 267a4bddf..22c74d0ad 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/app/data/bibtex_to_ingest/August19 17 Batch/aydin.txt b/app/data/bibtex_to_ingest/August19 17 Batch/aydin.txt index c7c0443d4..f2f6ef86b 100755 --- a/app/data/bibtex_to_ingest/August19 17 Batch/aydin.txt +++ b/app/data/bibtex_to_ingest/August19 17 Batch/aydin.txt @@ -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}, } @@ -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, diff --git a/app/data/bibtex_to_ingest/August19 17 Batch/elambin.txt b/app/data/bibtex_to_ingest/August19 17 Batch/elambin.txt index 613396448..b25e0ba0b 100755 --- a/app/data/bibtex_to_ingest/August19 17 Batch/elambin.txt +++ b/app/data/bibtex_to_ingest/August19 17 Batch/elambin.txt @@ -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, @@ -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, diff --git a/app/data/bibtex_to_ingest/August23 8 Batch/mjgrove.txt b/app/data/bibtex_to_ingest/August23 8 Batch/mjgrove.txt index ae8d6c6e6..8f7c98e46 100755 --- a/app/data/bibtex_to_ingest/August23 8 Batch/mjgrove.txt +++ b/app/data/bibtex_to_ingest/August23 8 Batch/mjgrove.txt @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, diff --git a/app/data/bibtex_to_ingest/August23 8 Batch/mmac.txt b/app/data/bibtex_to_ingest/August23 8 Batch/mmac.txt index 1d2df55fa..64e72f9ba 100755 --- a/app/data/bibtex_to_ingest/August23 8 Batch/mmac.txt +++ b/app/data/bibtex_to_ingest/August23 8 Batch/mmac.txt @@ -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, diff --git a/app/data/bibtex_to_ingest/August23 8 Batch/zoback.txt b/app/data/bibtex_to_ingest/August23 8 Batch/zoback.txt index 35434f32b..f739830f1 100755 --- a/app/data/bibtex_to_ingest/August23 8 Batch/zoback.txt +++ b/app/data/bibtex_to_ingest/August23 8 Batch/zoback.txt @@ -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, @@ -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, diff --git a/app/models/pubmed_source_record.rb b/app/models/pubmed_source_record.rb index 37408f981..b4dee913f 100644 --- a/app/models/pubmed_source_record.rb +++ b/app/models/pubmed_source_record.rb @@ -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 diff --git a/app/models/sciencewire_source_record.rb b/app/models/sciencewire_source_record.rb index cd64ee075..d04072e07 100644 --- a/app/models/sciencewire_source_record.rb +++ b/app/models/sciencewire_source_record.rb @@ -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? diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 58efcf20f..169b7ba1d 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -8,7 +8,7 @@ - <%= 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/' %>