Skip to content

Commit

Permalink
remove metrics stores and references to this. is of local flavour and…
Browse files Browse the repository at this point in the history
… should be in layer
  • Loading branch information
vpeil committed Oct 12, 2017
1 parent 3d63bfa commit 1891d38
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 143 deletions.
7 changes: 0 additions & 7 deletions config/store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ main:
reqcopy:
plugins: []

metrics:
package: DBI
options:
data_source: "DBI:mysql:database=librecat_metrics"
username: librecat
password: librecat

search:
package: ElasticSearch
options:
Expand Down
2 changes: 0 additions & 2 deletions devel/mysql.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
CREATE DATABASE librecat_main;
CREATE DATABASE librecat_metrics;
GRANT ALL ON librecat_main.* TO 'librecat'@'localhost' IDENTIFIED BY 'librecat';
GRANT ALL ON librecat_metrics.* TO 'librecat'@'localhost' IDENTIFIED BY 'librecat';
FLUSH PRIVILEGES;
7 changes: 0 additions & 7 deletions lib/LibreCat/App/Helper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,6 @@ sub get_statistics {

}

sub get_metrics {
my ($self, $bag, $id) = @_;
return {} unless $bag and $id;

return Catmandu->store('metrics')->bag($bag)->get($id);
}

sub new_record {
my ($self, $bag) = @_;
Catmandu->store('main')->bag($bag)->generate_id;
Expand Down
14 changes: 0 additions & 14 deletions lib/LibreCat/App/Search/Route/ajax.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@ use Dancer::Plugin::Ajax;
use HTML::Entities;
use LibreCat::App::Helper;

=head2 AJAX /metrics/:id
Web of Science 'Times Cited' information
=cut

ajax '/metrics/:id' => sub {
my $metrics = h->get_metrics('wos', params->{id});
return to_json {
times_cited => $metrics->{times_cited},
citing_url => $metrics->{citing_url},
};
};

=head2 AJAX /search_researcher
=cut
Expand Down
2 changes: 1 addition & 1 deletion views/embed/links_js.tt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[% bag = entry.type == "research_data" ? "data" : "publication" %]<a href="[% uri_base %]/[% bag %]/[% entry._id %]" target="_top">PUB</a>[% IF entry.type == "research_data" AND (entry.file || entry.related_material || entry.externalFiles == "1") %] | <a href="[% uri_base %]/[% bag %]/[% entry._id %]" class="label label-primary">Files available</a>[% ELSIF entry.type != "research_data" AND entry.file AND entry.file.size > 1 %][% display_file = [] %][% counter = 0 %][% FOREACH fi IN entry.file %][% IF fi.open_access %][% counter = counter + 1 %][% display_file.push(fi) %][% END %][% END %][% IF counter > 1 %] | <a href="[% uri_base %]/[% bag %]/[% entry._id %]" class="label label-primary">Files available</a>[% ELSIF counter == 1 %] | <a href="[% uri_base %]/download/[% entry._id %]/[% display_file.0.file_id %]/[% display_file.0.file_name | uri %]">[% display_file.0.content_type == "application/pdf" ? "PDF" : "File" %]</a>[% END %][% ELSIF entry.type != "research_data" AND entry.file AND entry.file.size == 1 %][% IF entry.file.0.open_access %] | <a href="[% uri_base %]/download/[% entry._id %]/[% entry.file.0.file_id %]/[% entry.file.0.file_name | uri %]">[% entry.file.0.content_type == "application/pdf" ? "PDF" : "File" %]</a>[% END %][% END %][% FOREACH supp IN entry.related_material %][% IF supp.link %] | <a href="[% supp.link.url %]" title="[% supp.link.title %]">Suppl. Material</a>[% ELSIF supp.file %] | <a href="[% uri_base %]/download/[% entry._id %]/[% supp.file.file_id %]/[% supp.file.file_name | uri %]" title="[% supp.file.file_name %]">Suppl. Material</a> [% END %][% END %][% IF entry.doi %]| <a href="http://doi.org/[% entry.doi %]" target="_top">DOI</a>[% END %][% IF entry.external_id.isi %] | <a href="http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&amp;rft_id=info:ut/[% entry.external_id.isi %]" target="_top">WoS</a>[% END %][% IF entry.external_id.pmid %] | <a href="http://www.ncbi.nlm.nih.gov/pubmed/[% entry.external_id.pmid %]" target="_top">PubMed</a> | <a href="http://europepmc.org/abstract/MED/[% entry.external_id.pmid %]">Europe PMC</a>[% END %][% IF entry.external_id.arxiv %] | <a href="http://arxiv.org/abs/[% entry.external_id.arxiv %]" target="_top">arXiv</a>[% END %][% IF entry.external_id.inspire %] | <a href="http://inspirebeta.net/record/[% entry.external_id.inspire %]" target="_top">Inspire</a>[% END %][% IF entry.external_id.ahf %] | <a href="http://www.oldenbourg.de/verlag/ahf/hbo.php?F=titel&amp;T=HB&amp;ID=[% entry.external_id.ahf %]" target="_top">AHF</a>[% END %][% IF qp.timescited && entry.metrics.timesCited %] | <a href="[% entry.metrics.citingURL %]" target="_parent">WOS&reg; Times Cited: [% entry.metrics.timesCited %]</a>[% END %]
[% bag = entry.type == "research_data" ? "data" : "publication" %]<a href="[% uri_base %]/[% bag %]/[% entry._id %]" target="_top">PUB</a>[% IF entry.type == "research_data" AND (entry.file || entry.related_material || entry.externalFiles == "1") %] | <a href="[% uri_base %]/[% bag %]/[% entry._id %]" class="label label-primary">Files available</a>[% ELSIF entry.type != "research_data" AND entry.file AND entry.file.size > 1 %][% display_file = [] %][% counter = 0 %][% FOREACH fi IN entry.file %][% IF fi.open_access %][% counter = counter + 1 %][% display_file.push(fi) %][% END %][% END %][% IF counter > 1 %] | <a href="[% uri_base %]/[% bag %]/[% entry._id %]" class="label label-primary">Files available</a>[% ELSIF counter == 1 %] | <a href="[% uri_base %]/download/[% entry._id %]/[% display_file.0.file_id %]/[% display_file.0.file_name | uri %]">[% display_file.0.content_type == "application/pdf" ? "PDF" : "File" %]</a>[% END %][% ELSIF entry.type != "research_data" AND entry.file AND entry.file.size == 1 %][% IF entry.file.0.open_access %] | <a href="[% uri_base %]/download/[% entry._id %]/[% entry.file.0.file_id %]/[% entry.file.0.file_name | uri %]">[% entry.file.0.content_type == "application/pdf" ? "PDF" : "File" %]</a>[% END %][% END %][% FOREACH supp IN entry.related_material %][% IF supp.link %] | <a href="[% supp.link.url %]" title="[% supp.link.title %]">Suppl. Material</a>[% ELSIF supp.file %] | <a href="[% uri_base %]/download/[% entry._id %]/[% supp.file.file_id %]/[% supp.file.file_name | uri %]" title="[% supp.file.file_name %]">Suppl. Material</a> [% END %][% END %][% IF entry.doi %]| <a href="http://doi.org/[% entry.doi %]" target="_top">DOI</a>[% END %][% IF entry.external_id.isi %] | <a href="http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&amp;rft_id=info:ut/[% entry.external_id.isi %]" target="_top">WoS</a>[% END %][% IF entry.external_id.pmid %] | <a href="http://www.ncbi.nlm.nih.gov/pubmed/[% entry.external_id.pmid %]" target="_top">PubMed</a> | <a href="http://europepmc.org/abstract/MED/[% entry.external_id.pmid %]">Europe PMC</a>[% END %][% IF entry.external_id.arxiv %] | <a href="http://arxiv.org/abs/[% entry.external_id.arxiv %]" target="_top">arXiv</a>[% END %][% IF entry.external_id.inspire %] | <a href="http://inspirebeta.net/record/[% entry.external_id.inspire %]" target="_top">Inspire</a>[% END %][% IF entry.external_id.ahf %] | <a href="http://www.oldenbourg.de/verlag/ahf/hbo.php?F=titel&amp;T=HB&amp;ID=[% entry.external_id.ahf %]" target="_top">AHF</a>[% END %]
29 changes: 0 additions & 29 deletions views/publication/record.tt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
[%- relLinkRd = [] %]
[%- relLinkSw = [] %]
[%- relFile = [] %]
[%- IF external_id.pmid.0 %]
[%- epmc_cit = h.get_metrics('epmc_citations',external_id.pmid.0) %]
[%- epmc_ref = h.get_metrics('epmc_references',external_id.pmid.0) %]
[%- ebi_data = h.get_metrics('epmc_dblinks',external_id.pmid.0) %]
[%- END -%]

[%- FOREACH key IN related_material.keys %]
[%- IF key == "record" %]
Expand Down Expand Up @@ -208,22 +203,6 @@
<li><a href="#relResData" data-toggle="tab">[% h.loc("frontdoor.tabs.data_publication.label") %]</a></li>
[% END %]

[% IF toolkit %]
<li><a href="#toolkit" data-toggle="tab">[% h.loc("frontdoor.tabs.toolkit.label") %]</a></li>
[% END %]

[% IF ebi_data %]
<li><a href="#ebi_dblinks" data-toggle="tab">[% h.loc("frontdoor.tabs.ebi_links.label") %]</a></li>
[% END %]

[% IF epmc_cit %]
<li><a href="#ebi_citations" data-toggle="tab">[% h.loc("frontdoor.tabs.epmc_citation.label") %]</a></li>
[% END %]

[% IF epmc_ref %]
<li><a href="#ebi_references" data-toggle="tab">[% h.loc("frontdoor.tabs.epmc_references.label") %]</a></li>
[% END %]

[% IF confLetter.size %]
<li><a href="#confletter" data-toggle="tab">[% h.loc("frontdoor.tabs.confirmation_letter.label") %]</a>
[% END %]
Expand Down Expand Up @@ -260,14 +239,6 @@

[% IF relResData %] [% PROCESS publication/tab_relresdata.tt %] [% END %]

[% IF toolkit %] [% PROCESS publication/tab_toolkit.tt %] [% END %]

[% IF ebi_data %] [% PROCESS publication/tab_ebi_links.tt %] [% END %]

[% IF epmc_cit %] [% PROCESS publication/tab_ebi_cit.tt %] [% END %]

[% IF epmc_ref %] [% PROCESS publication/tab_ebi_ref.tt %] [% END %]

[% IF relMat.size OR relLink.size %]
[% PROCESS publication/tab_relmat.tt %]
[% END %]
Expand Down
26 changes: 0 additions & 26 deletions views/publication/tab_ebi_cit.tt

This file was deleted.

36 changes: 0 additions & 36 deletions views/publication/tab_ebi_links.tt

This file was deleted.

21 changes: 0 additions & 21 deletions views/publication/tab_ebi_ref.tt

This file was deleted.

0 comments on commit 1891d38

Please sign in to comment.