Commit d243d56c authored by Maxime Chaillet's avatar Maxime Chaillet

Merge branch 'issue61' into 'master'

Issue61

Closes #61

See merge request !68
parents bb200e4d cf0bc77c
Pipeline #7503 passed with stages
in 1 minute and 50 seconds
......@@ -4,6 +4,7 @@
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
......@@ -54,8 +55,7 @@ module.exports = function (config) {
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
var ESRF_DC_142893590 = {
"id": "https://doi.org/10.15151/ESRF-DC-142893590",
"id": "https://doi.org/10.15151/esrf-dc-142893590",
"doi": "10.15151/ESRF-DC-142893590",
"creator": [
{
"type": "Person",
"url": "https://doi.esrf.fr/10.15151/ESRF-DC-142893590",
"types": {
"ris": "DATA",
"bibtex": "misc",
"citeproc": "dataset",
"schemaOrg": "Dataset",
"resourceType": "Datacollection",
"resourceTypeGeneral": "Dataset"
},
"creators": [
{
"name": "Naschberger, Andreas",
"nameType": "Personal",
"givenName": "Andreas",
"familyName": "Naschberger"
},
{
"type": "Person",
"name": "Bowler, Matthew W.",
"nameType": "Personal",
"givenName": "Matthew W.",
"familyName": "Bowler"
},
{
"type": "Person",
{
"name": "Rupp, Bernhard",
"nameType": "Personal",
"givenName": "Bernhard",
"familyName": "Rupp"
}
],
"title": "Structural Evidence for a Role of the Multi-functional Human Glycoprotein Afamin in Wnt Transport",
"titles": [
{
"title": "Structural Evidence for a Role of the Multi-functional Human Glycoprotein Afamin in Wnt Transport"
}
],
"publisher": "European Synchrotron Radiation Facility",
"resource_type_general": "Dataset",
"resource_type": "Datacollection",
"subject": [
[
{
"subject_scheme": "Proposal",
"text": "OPID-30A1"
},
{
"subject_scheme": "instrument",
"text": "ID30A1"
}
]
"container": {},
"subjects": [
{
"subject": "OPID-1",
"subjectScheme": "Proposal"
},
{
"subject": "ID30A1",
"subjectScheme": "Instrument"
}
],
"description": {
"type": "Abstract",
"text": "Afamin, a human plasma glycoprotein and putative transporter of hydrophobic molecules, has been shown to act as extracellular chaperone for poorly soluble, acylated Wnt proteins, forming a stable, soluble complex with functioning Wnt proteins. The 2.1-Å crystal structure of glycosylated human afamin reveals an almost exclusively hydrophobic binding cleft capable of harboring large hydrophobic moieties. Lipid analysis confirms the presence of lipids, and density in the primary binding pocket of afamin was modeled as palmitoleic acid, presenting the native O-acylation on serine 209 in human Wnt3a. The modeled complex between the experimental afamin structure and a Wnt3a homology model based on the XWnt8-Fz8-CRD fragment complex crystal structure is compelling, with favorable interactions comparable with the crystal structure complex. Afamin readily accommodates the conserved palmitoylated serine 209 of Wnt3a, providing a structural basis how afamin solubilizes hydrophobic and poorly soluble Wnt proteins."
},
"date_collected": "2018-03-07",
"date_published": "2018",
"date_registered": "2018-03-07T14:37:09Z",
"date_updated": "2018-03-08T16:30:22Z",
"publication_year": 2018,
"language": "eng",
"contributors": [],
"dates": [
{
"date": "2018",
"dateType": "Issued"
}
],
"publicationYear": 2018,
"language": "en",
"identifiers": [
{
"identifier": "https://doi.org/10.15151/esrf-dc-142893590",
"identifierType": "DOI"
}
],
"sizes": [],
"formats": [],
"rightsList": [],
"descriptions": [
{
"description": "Afamin, a human plasma glycoprotein and putative transporter of hydrophobic molecules, has been shown to act as extracellular chaperone for poorly soluble, acylated Wnt proteins, forming a stable, soluble complex with functioning Wnt proteins. The 2.1-Å crystal structure of glycosylated human afamin reveals an almost exclusively hydrophobic binding cleft capable of harboring large hydrophobic moieties. Lipid analysis confirms the presence of lipids, and density in the primary binding pocket of afamin was modeled as palmitoleic acid, presenting the native O-acylation on serine 209 in human Wnt3a. The modeled complex between the experimental afamin structure and a Wnt3a homology model based on the XWnt8-Fz8-CRD fragment complex crystal structure is compelling, with favorable interactions comparable with the crystal structure complex. Afamin readily accommodates the conserved palmitoylated serine 209 of Wnt3a, providing a structural basis how afamin solubilizes hydrophobic and poorly soluble Wnt proteins.",
"descriptionType": "Abstract"
}
],
"geoLocations": [],
"fundingReferences": [],
"relatedIdentifiers": [],
"schemaVersion": "http://datacite.org/schema/kernel-3",
"provider_id": "INIST",
"client_id": "INIST.ESRF"
};
\ No newline at end of file
"providerId": "inist",
"clientId": "inist.esrf",
"state": "findable"
};
// {
// "id": "https://doi.org/10.15151/ESRF-DC-142893590",
// "doi": "10.15151/ESRF-DC-142893590",
// "creator": [
// {
// "type": "Person",
// "name": "Naschberger, Andreas",
// "givenName": "Andreas",
// "familyName": "Naschberger"
// },
// {
// "type": "Person",
// "name": "Bowler, Matthew W.",
// "givenName": "Matthew W.",
// "familyName": "Bowler"
// },
// {
// "type": "Person",
// "name": "Rupp, Bernhard",
// "givenName": "Bernhard",
// "familyName": "Rupp"
// }
// ],
// "title": "Structural Evidence for a Role of the Multi-functional Human Glycoprotein Afamin in Wnt Transport",
// "publisher": "European Synchrotron Radiation Facility",
// "resource_type_general": "Dataset",
// "resource_type": "Datacollection",
// "subject": [
// [
// {
// "subject_scheme": "Proposal",
// "text": "OPID-30A1"
// },
// {
// "subject_scheme": "instrument",
// "text": "ID30A1"
// }
// ]
// ],
// "description": {
// "type": "Abstract",
// "text": "Afamin, a human plasma glycoprotein and putative transporter of hydrophobic molecules, has been shown to act as extracellular chaperone for poorly soluble, acylated Wnt proteins, forming a stable, soluble complex with functioning Wnt proteins. The 2.1-Å crystal structure of glycosylated human afamin reveals an almost exclusively hydrophobic binding cleft capable of harboring large hydrophobic moieties. Lipid analysis confirms the presence of lipids, and density in the primary binding pocket of afamin was modeled as palmitoleic acid, presenting the native O-acylation on serine 209 in human Wnt3a. The modeled complex between the experimental afamin structure and a Wnt3a homology model based on the XWnt8-Fz8-CRD fragment complex crystal structure is compelling, with favorable interactions comparable with the crystal structure complex. Afamin readily accommodates the conserved palmitoylated serine 209 of Wnt3a, providing a structural basis how afamin solubilizes hydrophobic and poorly soluble Wnt proteins."
// },
// "date_collected": "2018-03-07",
// "date_published": "2018",
// "date_registered": "2018-03-07T14:37:09Z",
// "date_updated": "2018-03-08T16:30:22Z",
// "publication_year": 2018,
// "language": "eng",
// "schemaVersion": "http://datacite.org/schema/kernel-3",
// "provider_id": "INIST",
// "client_id": "INIST.ESRF"
// };
\ No newline at end of file
var ESRF_DC_142915526 = {
"id": "https://doi.org/10.15151/esrf-dc-142915526",
"doi": "10.15151/ESRF-DC-142915526",
"creator": [
{
"type": "Person",
"name": "Naschberger, Andreas",
"givenName": "Andreas",
"familyName": "Naschberger"
},
{
"type": "Person",
"name": "Bowler, Matthew W.",
"givenName": "Matthew W.",
"familyName": "Bowler"
},
{
"type": "Person",
"name": "Rupp, Bernhard",
"givenName": "Bernhard",
"familyName": "Rupp"
}
"url": "https://doi.esrf.fr/10.15151/ESRF-DC-142915526",
"types": {
"ris": "DATA",
"bibtex": "misc",
"citeproc": "dataset",
"schemaOrg": "Dataset",
"resourceType": "Datacollection",
"resourceTypeGeneral": "Dataset"
},
"creators": [
{
"name": "Naschberger, Andreas",
"nameType": "Personal",
"givenName": "Andreas",
"familyName": "Naschberger"
},
{
"name": "Bowler, Matthew W.",
"nameType": "Personal",
"givenName": "Matthew W.",
"familyName": "Bowler"
},
{
"name": "Rupp, Bernhard",
"nameType": "Personal",
"givenName": "Bernhard",
"familyName": "Rupp"
}
],
"titles": [
{
"title": "Controlled dehydration, structural flexibility, and Gadolinium MRI contrast compound binding in human plasma glycoprotein afamin"
}
],
"title": "Controlled dehydration, structural flexibility, and Gadolinium MRI contrast compound binding in human plasma glycoprotein afamin",
"publisher": "European Synchrotron Radiation Facility",
"resource_type_general": "Dataset",
"resource_type": "Datacollection",
"subject": [
[
{
"subject_scheme": "Proposal",
"text": "OPID-30A1"
},
{
"subject_scheme": "instrument",
"text": "ID30A1"
}
]
"container": {},
"subjects": [
{
"subject": "OPID-1",
"subjectScheme": "Proposal"
},
{
"subject": "ID30A1",
"subjectScheme": "Instrument"
}
],
"description": {
"type": "Abstract",
"text": "Afamin, a human blood plasma glycoprotein, a putative multi-functional transporter of hydrophobic molecules and a marker for metabolic syndrome, poses multiple challenges for crystallographic structure determination, both practically and in analysis of the models. Several hundred crystals were analysed, and unusual variability in cell volume and difficulty solving the structure despite a ~34% sequence identity with non-glycosylated human serum albumin indicated that the molecule exhibits variable and context-sensitive packing, despite greatly simplified glycosylation in insect cell expressed recombinant afamin. Controlled dehydration of the crystals was able to stabilise the orthorhombic crystal form reducing the number of molecules in the asymmetric unit from the monoclinic form and changing the conformational states of the protein. An iterative strategy using fully automatic experiments available on MASSIF-1 was used to quickly determine the optimal protocol to achieve the phase transition that should be readily applicable to many types of sample. The study also highlights the drawback of using a single crystallographic structure model for computation modelling purposes given that conformational state of the binding sites and electron density in the binding site, likely resulting from PEGs, greatly varies between models. This also holds for the analysis of unspecific low-affinity ligands, where often a variety fragments with similar uncertainty can be modelled, inviting interpretative bias. As a promiscuous transporter, afamin can also bind Gadoteridol, a magnetic resonance imaging contrast compound in two sites, one near the human albumin Sudlow-site and a second hitherto unknown binding site."
},
"date_collected": "2018-03-07",
"date_published": "2018",
"date_registered": "2018-03-07T14:37:09Z",
"date_updated": "2018-03-08T16:30:22Z",
"publication_year": 2018,
"language": "eng",
"contributors": [],
"dates": [
{
"date": "2018",
"dateType": "Issued"
}
],
"publicationYear": 2018,
"language": "en",
"identifiers": [
{
"identifier": "https://doi.org/10.15151/esrf-dc-142915526",
"identifierType": "DOI"
}
],
"sizes": [],
"formats": [],
"rightsList": [],
"descriptions": [
{
"description": "Afamin, a human blood plasma glycoprotein, a putative multi-functional transporter of hydrophobic molecules and a marker for metabolic syndrome, poses multiple challenges for crystallographic structure determination, both practically and in analysis of the models. Several hundred crystals were analysed, and unusual variability in cell volume and difficulty solving the structure despite a ~34% sequence identity with non-glycosylated human serum albumin indicated that the molecule exhibits variable and context-sensitive packing, despite greatly simplified glycosylation in insect cell expressed recombinant afamin. Controlled dehydration of the crystals was able to stabilise the orthorhombic crystal form reducing the number of molecules in the asymmetric unit from the monoclinic form and changing the conformational states of the protein. An iterative strategy using fully automatic experiments available on MASSIF-1 was used to quickly determine the optimal protocol to achieve the phase transition that should be readily applicable to many types of sample. The study also highlights the drawback of using a single crystallographic structure model for computation modelling purposes given that conformational state of the binding sites and electron density in the binding site, likely resulting from PEGs, greatly varies between models. This also holds for the analysis of unspecific low-affinity ligands, where often a variety fragments with similar uncertainty can be modelled, inviting interpretative bias. As a promiscuous transporter, afamin can also bind Gadoteridol, a magnetic resonance imaging contrast compound in two sites, one near the human albumin Sudlow-site and a second hitherto unknown binding site.",
"descriptionType": "Abstract"
}
],
"geoLocations": [],
"fundingReferences": [],
"relatedIdentifiers": [],
"schemaVersion": "http://datacite.org/schema/kernel-3",
"provider_id": "INIST",
"client_id": "INIST.ESRF"
};
\ No newline at end of file
"providerId": "inist",
"clientId": "inist.esrf",
"state": "findable"
};
\ No newline at end of file
function Citation(data) {
this.isBuildable = (data && data.creator && data.creator.length !== 0 &&
data.date_registered && data.title && data.publisher && data.doi) ? true
: false;
function Citation(doiData) {
function isBuildable() {
if (doiData && doiData.creators && doiData.creators.length !== 0 &&
doiData.title && doiData.publisher && doiData.doi) {
if (doiData.resourceType === CONSTANTS.ES_RESOURCE_TYPE && doiData.sessionDate) {
return true;
}
if (doiData.resourceType === CONSTANTS.DC_RESOURCE_TYPE && doiData.publiclyAccessibleYear) {
return true;
}
}
return false;
}
this.isBuildable = isBuildable();
}
/**
......@@ -14,43 +26,55 @@ function Citation(data) {
* @return {string} The formated list of authors to be used for the citation. An
* empty string when the list could not be generated.
*/
Citation.prototype.getAuthorsForCitation = function(creator) {
if (this.isBuildable) {
var authorList = _.transform(creator, function(result, val, key, obj) {
if (!(obj instanceof Array)) {
val = obj;
}
var author = null;
if (val.givenName) {
author = new Author();
author.setFamilyName(val.familyName);
author.setFirstName(val.givenName);
result.push(author.getTitleCaseFamilyName() + ' ' +
author.getFirstNameInitials());
} else {
// Here first name and last name are in a single string field
// creator.name
author = new Author();
author.setSingleName(val.name);
if (!author.getRawFamilyName() || !author.getRawFirstName()) {
result.push(val.name);
} else {
// FirstName and family name are not in a single string
result.push(author.getTitleCaseFamilyName() + " " +
author.getFirstNameInitials());
}
}
if (!(obj instanceof Array)) {
return false;
}
}, []);
Citation.prototype.getAuthorsForCitation = function (creator) {
if (this.isBuildable) {
var authorList = _.transform(creator, function (result, val, key, obj) {
if (!(obj instanceof Array)) {
val = obj;
}
var author = null;
if (val.givenName) {
author = new Author();
author.setFamilyName(val.familyName);
author.setFirstName(val.givenName);
result.push(author.getTitleCaseFamilyName() + ' ' +
author.getFirstNameInitials());
} else {
// Here first name and last name are in a single string field
// creator.name
author = new Author();
author.setSingleName(val.name);
if (!author.getRawFamilyName() || !author.getRawFirstName()) {
result.push(val.name);
} else {
// FirstName and family name are not in a single string
result.push(author.getTitleCaseFamilyName() + " " +
author.getFirstNameInitials());
}
}
if (!(obj instanceof Array)) {
return false;
}
}, []);
return _.join(authorList, ', ');
} else {
console.log("[CITATION GENERATION] Author list for the citation could not be generated.");
return "";
}
};
Citation.prototype.getDOIRegistrationYear = function (doiData) {
if (doiData.resourceType === CONSTANTS.ES_RESOURCE_TYPE) {
return moment(doiData.sessionDate).year();
}
if (doiData.resourceType === CONSTANTS.DC_RESOURCE_TYPE) {
return doiData.publiclyAccessibleYear;
}
return _.join(authorList, ', ');
} else {
console.log("the author list for the citation could not be generated.");
console.log("[CITATION GENERATION] Could not get the year to generate the citation.");
return "";
}
};
\ No newline at end of file
function DoiData(title, doi, dataciteLink, publisher, creator, publication_year) {
this.title = title;
function DoiData(doi, dataciteLink, publisher, creator, publication_year) {
this.doi = doi;
this.dataciteLink = dataciteLink;
this.publisher = publisher;
......
......@@ -27,66 +27,89 @@ function DOIController(view) {
* executed. Reloading the page is treated by .fail as it should be.
*/
DOIController.prototype.isValidDOIData = function (doiData) {
if (_.keysIn(doiData).length > 3) {
return _.find(_.keysIn(doiData), function (value) {
return value === "title";
}).length > 0;
}
return false;
// console.log(doiData)
// if (_.keysIn(doiData).length > 3) {
// return _.find(_.keysIn(doiData), function (value) {
// return value === "title";
// }).length > 0;
// }
// return false;
return true;
};
DOIController.prototype.render = function (doi, data) {
var _this = this;
// Test abnormal length of the json object
if (!_this.isValidDOIData(data)) {
_this.view.renderError("Not Found", _this.origin);
} else {
// Extract data and fill doiData with it
var doiData = new DoiData(data.title, data.doi.toUpperCase(), _this.doiServer + doi, data.publisher, data.creator, data.publication_year);
var jsonExtractor = new JsonExtractor();
doiData.abstract = jsonExtractor.getAbstract(data);
doiData.investigationId = jsonExtractor.getInvestigationId(data);
doiData.mintingYear = jsonExtractor.getMintingYear(data);
doiData.proposalType = jsonExtractor.getFieldFromSubject(data.subject, "Proposal Type Description");
doiData.resourceType = jsonExtractor.getResourceType(data);
doiData.resourceTypeGeneral = jsonExtractor.getResourceTypeGeneral(data);
doiData.sessionDate = jsonExtractor.getSessionDate(data);
var proposalNames = jsonExtractor.getFieldFromSubject(data.subject, "Proposal");
var beamlines = jsonExtractor.getFieldFromSubject(data.subject, "Instrument");
_this.experimentalReportController.requestFilenameList(proposalNames[0]);
doiData.accessibility = doiData.getAccessibilityStatus(doiData.resourceType, doiData.sessionDate, doiData.publiclyAccessibleYear);
doiData.accessMessage = _this.view.setDataAccessMessage(doiData);
doiData.citation = _this.createCitation(data);
if (doiData.resourceType === CONSTANTS.ES_RESOURCE_TYPE) {
doiData.beamlineUrls = _this.getBeamlineUrl(beamlines, data.date_collected, doiData.resourceType);
}
// Test abnormal length of the json object
if (!_this.isValidDOIData(data)) {
_this.view.renderError("Not Found", _this.origin);
} else {
// Extract data and fill doiData with it
if (doiData.resourceType === CONSTANTS.DC_RESOURCE_TYPE) {
doiData.beamlineUrls = _this.getBeamlineUrl(beamlines, data.publication_year, doiData.resourceType);
}
// Create a table containing unique tuples [proposal, beamline, beamlineUrl]
doiData.mergedProposalBeamlines = jsonExtractor.getMergedProposalAndBeamline(proposalNames, beamlines, doiData.beamlineUrls);
// send to dust render
_this.view.renderDOIData(doiData);
var doiData = new DoiData();
// var doiData = new DoiData(data.doi.toUpperCase(), _this.doiServer + doi, data.publisher, data.creator, data.publication_year);
var jsonExtractor = new JsonExtractor();
doiData.title = jsonExtractor.getTitle(data);
doiData.doi = jsonExtractor.getDOI(data);
doiData.dataciteLink = _this.doiServer + doi;
doiData.publisher = jsonExtractor.getPublisher(data);
doiData.creators = jsonExtractor.getCreators(data);
doiData.publiclyAccessibleYear = jsonExtractor.getPubliclyAccessibleYear(data);
doiData.abstract = jsonExtractor.getAbstract(data);
doiData.investigationId = jsonExtractor.getInvestigationId(data);
doiData.resourceType = jsonExtractor.getResourceType(data);
// doiData.mintingYear = jsonExtractor.getMintingYear(data);
//console.log("minting year = " + doiData.mintingYear);
doiData.proposalType = jsonExtractor.getFieldFromSubject(data.subjects, "Proposal Type Description");
doiData.resourceTypeGeneral = jsonExtractor.getResourceTypeGeneral(data);
doiData.sessionDate = jsonExtractor.getSessionDate(data);
var proposalNames = jsonExtractor.getFieldFromSubject(data.subjects, "Proposal");
var beamlines = jsonExtractor.getFieldFromSubject(data.subjects, "Instrument");
_this.experimentalReportController.requestFilenameList(proposalNames[0]);
doiData.accessibility = doiData.getAccessibilityStatus(doiData.resourceType, doiData.sessionDate, doiData.publiclyAccessibleYear);
doiData.accessMessage = _this.view.setDataAccessMessage(doiData);
doiData.citation = _this.createCitation(doiData);
if (doiData.resourceType === CONSTANTS.ES_RESOURCE_TYPE) {
doiData.beamlineUrls = _this.getBeamlineUrl(beamlines, doiData.sessionDate, doiData.resourceType);
doiData.mintingYear = moment(doiData.sessionDate).year();
}
if (doiData.resourceType === CONSTANTS.DC_RESOURCE_TYPE) {
doiData.beamlineUrls = _this.getBeamlineUrl(beamlines, doiData.publiclyAccessibleYear, doiData.resourceType);
doiData.mintingYear = doiData.publiclyAccessibleYear;
}
// Create a table containing unique tuples [proposal, beamline, beamlineUrl]
doiData.mergedProposalBeamlines = jsonExtractor.getMergedProposalAndBeamline(proposalNames, beamlines, doiData.beamlineUrls);
// send to dust render
_this.view.renderDOIData(doiData);
}
};
DOIController.prototype.getData = function (doi) {
var _this = this;
this.view.setDOIInTopBanner(doi);
if (doi.toUpperCase() == "10.15151/ESRF-DC-142893590"){
if (doi.toUpperCase() == "10.15151/ESRF-DC-142893590") {
this.render(doi, ESRF_DC_142893590);
return;
}
if (doi.toUpperCase() == "10.15151/ESRF-DC-142915526"){
if (doi.toUpperCase() == "10.15151/ESRF-DC-142915526") {
this.render(doi, ESRF_DC_142915526);
return;
}
......@@ -110,7 +133,7 @@ DOIController.prototype.getData = function (doi) {
.done(function (data) {
if (data) {
_this.render(doi, data);
_this.render(doi, data);
}
}).fail(function (jqXHR, textStatus, errorThrown) {
_this.view.renderError(jqXHR, errorThrown, _this.origin);
......@@ -179,7 +202,7 @@ DOIController.prototype.getBeamlineUrl = function (beamlines, date, resourceType
if (resourceType === CONSTANTS.DC_RESOURCE_TYPE) {
date = moment(date, "YYYY");
}
var foundUrl = "";
for (var i = 0; i < BEAMLINEURL.length; i++) {
var startDate = moment(BEAMLINEURL[i].startDate);
......@@ -205,25 +228,22 @@ DOIController.prototype.getBeamlineUrl = function (beamlines, date, resourceType
/**
* Create the citation for the current work. Citation proposes a recommendation
* to the reader on how to cite this work.
*
* @param {string}
* data: the data object, it is a reference
* @return {string}
* citation : the citation to be displayed
* @param {object} doiData the doiData object we have constructed from JSON datacite
* @return {string} the citation to be displayed
*/
DOIController.prototype.createCitation = function (data) {
DOIController.prototype.createCitation = function (doiData) {
// Authors sent in json can be in several format. The following call find
// first name and last name when possible.
var citation = new Citation(data);
var citation = new Citation(doiData);
if (!citation.isBuildable) {
return "The citation could not be generated.";
} else {
var authorInCitation = citation.getAuthorsForCitation(data.creator);
var doiRegistrationYear = moment(data.date_registered).year();
var fullCitation = authorInCitation + ' (' + doiRegistrationYear + '). ' + data.title + '. ' + data.publisher + ' (ESRF). ' +
" <a href='https://doi.esrf.fr/" + data.doi + "'> doi:" + data.doi.toUpperCase() + "</a>";
var authorInCitation = citation.getAuthorsForCitation(doiData.creators);
var doiRegistrationYear = citation.getDOIRegistrationYear(doiData);
var fullCitation = authorInCitation + ' (' + doiRegistrationYear + '). ' + doiData.title + '. ' + doiData.publisher + ' (ESRF). ' +
" <a href='https://doi.esrf.fr/" + doiData.doi + "'> doi:" + doiData.doi.toUpperCase() + "</a>";
return fullCitation;
}
};
......@@ -53,6 +53,7 @@ DOIView.prototype.renderExperimentalReportData = function (data) {
DOIView.prototype.renderDOIData = function (doiData) {
var _this = this;
console.log(doiData);
dust.render('landingpage_tpl', {
data: doiData,
constants : CONSTANTS
......
function JsonExtractor(json) {
/**
* This is the json extractor. It tries to extract from the json datacite object the required fields to render the DOI
* landing page.
*/
function JsonExtractor() {
}
/**
* Extract investigationId from the data.doi field as received from the json
* response.
* Extract the DOI title from the datacite's JSON response.
* @param {json} data The data object provided by datacite
* @return {string} doi title. Null if it does not exist
*/
JsonExtractor.prototype.getTitle = function (data) {
if (data) {
if (data.titles) {
if (data.titles.length > 0) {
if (data.titles[0].title) {
return data.titles[0].title;
}
}
}
}
console.log('[JSON EXTRACTOR ERROR] title extraction failed.');
return null;
};
/**
* Extract the DOI number from the datacite's JSON response.
* @param {json} data The data object provided by datacite
* @return {string} doi number. Null if it does not exist.
*/
JsonExtractor.prototype.getDOI = function (data) {
if (data) {
if (data.doi) {
return data.doi.toUpperCase();
}
}
console.log('[JSON EXTRACTOR ERROR] doi extraction failed.');
return null;
};
/**
* Extract the DOI publisher from the datacite's JSON response.
* @param {json} data The data object provided by datacite
* @return {string} doi publisher. Null if it does not exist.
*/
JsonExtractor.prototype.getPublisher = function (data) {
if (data) {
if (data.publisher) {
return data.publisher;
}
}
console.log('[JSON EXTRACTOR ERROR] publisher extraction failed.');
return null;
};
/**
* Extract the DOI authors/creators from the datacite's JSON response.
* @param {json} data The data object provided by datacite
* @return {array} doi creators. Null if creators does not exist. When creators details are not available, it returns
* an empty item within the array for each badly extracted creator.
*/
JsonExtractor.prototype.getCreators = function (data) {