Skip to content

Commit db24f9b

Browse files
committed
Merge remote-tracking branch 'upstream/content-provider' into content-provider
2 parents ccfa7a9 + 4a7fe64 commit db24f9b

File tree

99 files changed

+2677
-1081
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2677
-1081
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = {
2525
},
2626
env: {
2727
browser: true,
28+
node: true,
2829
es6: true,
2930
},
3031
settings: {

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 2022-05-05
4+
5+
### New features
6+
7+
- Added export to BibTex for each paper (frontend interface & backend endpoint).
8+
- Added BASE document type tags with icons.
9+
- New share buttons.
10+
11+
### Changes
12+
13+
- New look and feel (design & CSS changes).
14+
15+
### Security
16+
17+
- Periodical npm security update.
18+
319
## 2022-03-28
420

521
### Changes

examples/project_website/base.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@
8787
<script>
8888
data_config.files = [{
8989
//title: "digital education",
90-
title: "calcium",
90+
//title: "calcium",
91+
title: "production",
9192
//file: "./data/digital-education.json"
92-
file: "./data/calcium.json"
93+
//file: "./data/calcium.json",
94+
file: "./data/production.json"
9395
}]
9496
data_config.server_url = window.location.href.replace(/[^/]*$/, '') + "./headstart/server/";
9597
</script>

examples/project_website/css/main.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,15 +2591,6 @@ time {
25912591
margin-bottom: 0px;
25922592
}
25932593

2594-
.citation {
2595-
display: inline-block;
2596-
padding: 10px;
2597-
background-color: rgba(239,243,244,1);
2598-
hyphens: none;
2599-
border-radius: 3px;
2600-
-moz-border-radius: 3px;
2601-
}
2602-
26032594
.overflow-vis {
26042595
overflow-y: hidden;
26052596
}

examples/project_website/data-config_base.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var data_config = {
2828
context_most_relevant_tooltip: true,
2929

3030
embed_modal: true,
31-
share_modal: true,
31+
share_modal: false,
3232

3333
doi_outlink: true,
3434
filter_menu_dropdown: true,
@@ -46,4 +46,7 @@ var data_config = {
4646

4747
highlight_query_terms: true,
4848
show_context_oa_number: false,
49+
50+
show_twitter_button: true,
51+
show_email_button: true,
4952
};

examples/project_website/data/production.json

Lines changed: 10 additions & 0 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"doc": "doc"
88
},
99
"scripts": {
10-
"test": "jest",
10+
"test": "TZ='Europe/Vienna' jest",
1111
"dev": "webpack --progress --watch --mode=development",
1212
"prod": "webpack --progress",
1313
"start": "webpack serve --progress --mode=development --env publicPath=http://localhost:8080/dist/",

server/preprocessing/other-scripts/utils.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ detect_error <- function(failed, service) {
110110
if (grepl("xml_find_first", failed$query_reason, fixed=TRUE)){
111111
reason <- c(reason, 'API error: BASE not reachable')
112112
}
113+
if (grepl("read_xml.raw", failed$query_reason, fixed=TRUE)){
114+
reason <- c(reason, 'API error: BASE not reachable')
115+
}
113116
}
114117
if (length(reason) == 0 && service == 'pubmed') {
115118
if (startsWith(failed$query_reason, "HTTP failure: 500") && grepl("error forwarding request", failed$query_reason, fixed=TRUE)){

server/services/exportMetadata.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
require_once dirname(__FILE__) . '/../classes/headstart/library/CommUtils.php';
4+
require_once dirname(__FILE__) . '/../classes/headstart/library/APIClient.php';
5+
require_once dirname(__FILE__) . '/../classes/headstart/library/toolkit.php';
6+
use headstart\library;
7+
8+
function export($export_format, $metadata_json) {
9+
$INI_DIR = dirname(__FILE__) . "/../preprocessing/conf/";
10+
$ini_array = library\Toolkit::loadIni($INI_DIR);
11+
$apiclient = new \headstart\library\APIClient($ini_array);
12+
13+
14+
$payload = $metadata_json;
15+
#$res = $apiclient->call_persistence("export/" . $export_format, $payload);
16+
$res = $apiclient->call_api("export/" . $export_format, $payload);
17+
return $res;
18+
};
19+
20+
$json = $_POST['paper'];
21+
$format = (isset($_REQUEST['format'])) ? $_REQUEST['format'] : "bibtex";
22+
$download = (isset($_REQUEST['download'])) ? $_REQUEST['download'] : false;
23+
$result = export($format, $json);
24+
25+
if (isset($result["status"]) && $result["status"] === "error") {
26+
header('Content-type: application/json');
27+
echo json_encode($result);
28+
}
29+
30+
if ($format == "bibtex") {
31+
$format = "bib";
32+
}
33+
34+
if (isset($download) & $download==true ) {
35+
header('Content-type: application/text');
36+
header('Content-Disposition: attachment; filename=metadata.' . $format);
37+
} else {
38+
header('Content-type: text/plain');
39+
}
40+
41+
$result = json_decode($result["result"], true);
42+
echo $result["export"];
43+
44+
?>

0 commit comments

Comments
 (0)