Commit 6615a363 authored by Maxime Chaillet's avatar Maxime Chaillet

Merge branch 'issue68' into 'master'

Use sessionDate and publication year to infere the publication date. Fix bug...

Closes #68

See merge request !79
parents 59838ab0 265cd582
Pipeline #9335 passed with stages
in 14 seconds
......@@ -20,11 +20,13 @@ module.exports = function (config) {
'src/constants.js',
'src/doicontroller.js',
'src/doiview.js',
'src/doiData.js',
'src/experimentalreportcontroller.js',
'src/event.js',
'src/jsonextractor.js',
'tests/jsonExtractor.test.js',
'tests/doiController.test.js',
'tests/doiData.test.js',
'bower_components/lodash/lodash.js',
'bower_components/moment/moment.js'
......
function Author(){}function Citation(e){this.isBuildable=function(){if(e&&e.creators&&0!==e.creators.length&&e.title&&e.publisher&&e.doi){if(e.resourceType===CONSTANTS.ES_RESOURCE_TYPE&&e.sessionDate)return!0;if(e.resourceType===CONSTANTS.DC_RESOURCE_TYPE&&e.publiclyAccessibleYear)return!0}return!1}()}function DOIController(e){var t=this;this.doiServer="https://data.datacite.org/",this.icatPlusServer="https://icatplus.esrf.fr/doi/",this.acceptedPrefix=["10.5072","10.15151"],this.view=e,this.experimentalReportController=new ExperimentalReportController,this.experimentalReportController.onSuccess.attach(function(e,r){t.view.renderExperimentalReportData(r)}),this.experimentalReportController.onError.attach(function(e,r){console.log("Error when retrieving fileList from SMIS."),t.view.renderErrorForExperimentalReport()})}function DoiData(e,t,r,i,n){this.doi=e,this.dataciteLink=t,this.publisher=r,this.creator=i,this.publiclyAccessibleYear=n}function DOIView(){this.mainPanelId="main",this.reportPanelId="expReport",this.badgePanelId="badges",this.metadataDivId="metadata",this.reportExperimentFileNames=null,this.failedRecievingExpReport=!1,this.isDOIAlreadyRendered=!1,this.onDOIRendered=new Event(this)}function Event(e){this._sender=e,this._listeners=[]}function ExperimentalReportController(){this.server="https://wwws.esrf.fr/misapps/SMISServer/rest/reports/fileNames",this.timeout=5e3,this.onSuccess=new Event(this),this.onError=new Event(this)}function JsonExtractor(){}function proposalBeamlineTable(e,t,r,i){var n=i.mergedProposalBeamlines;if(e.write('<table class="table table-striped">'),e.write("<thead>"),e.write("<tr>"),e.write('<th scope="col">Proposals</th>'),e.write('<th scope="col">Beamlines</th>'),e.write("</tr>"),e.write("</thead>"),e.write("<tbody>"),n){for(var a=0;a<n.length;a++)if(n[a]){var o=n[a].proposal||"unknown",s=n[a].beamline||"unknown",l=n[a].beamlineUrl;e.write("<tr>"),e.write("<td>"+o+"</td>"),"noLink"===l?e.write("<td>"+s+"</td>"):e.write('<td> <a href="'+l+'" target="_blank">'+s+" </a> </td>"),e.write("</tr>")}else e.write("<tr>"),chunck.write("<td> unknown </td>"),chunck.write("<td> unknown </td>"),e.write("</tr>");return e.write("</tbody>"),e.write("</table>"),e.render(r.block,t)}}function abstract(e,t,r,i){var n=i.abstract;return e.write('<div class="myBorder-left">'),e.write("<label> Abstract </label>"),e.write('<div class="padding-left-15">'),n?e.write(n):e.write("There is no abstract for this session."),e.write("</div >"),e.write("</div >"),e.render(r.block,t)}Author.prototype.setFirstName=function(e){this.firstName=e},Author.prototype.setFamilyName=function(e){this.familyName=e},Author.prototype.setSingleName=function(e){this.singleName=e},Author.prototype.getRawFamilyName=function(){if(this.familyName)return this.familyName;if(this.singleName){var e=new RegExp(/(\S+)/g),t=this.singleName.match(e);if(2===t.length)return this.familyName=t[1],this.familyName;var r=new RegExp(/\s([^a-z]+$)/).exec(this.singleName);return r&&(this.familyName=r[1]),this.familyName}},Author.prototype.getRawFirstName=function(){if(this.firstName)return this.firstName;if(this.singleName){var e=new RegExp(/(\S+)/g),t=this.singleName.match(e);if(2===t.length)return this.firstName=t[0],this.firstName;var r=new RegExp(/^(.[^A-Z]+)+\b/).exec(this.singleName);return r&&(this.firstName=r[0]),r}},Author.prototype.getTitleCaseFamilyName=function(){if(this.familyName){allLowerCase=this.familyName.toLowerCase();var e=new RegExp(/^./);return allLowerCase.replace(e,function(e){return e.toUpperCase()})}return console.log("family name is undefined"),null},Author.prototype.getFirstNameInitials=function(){var e=new RegExp(/(\S+)/g);return this.firstName?this.firstName.replace(e,function(e){return e.charAt(0)+"."}):(console.log("first name is undefined"),null)};var BEAMLINEURL=[{name:"BM05",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/UsersAndScience/Experiments/XNP/BM05"},{name:"BM29",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/UsersAndScience/Experiments/MX/About_our_beamlines/BM29"},{name:"CM01",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/home/UsersAndScience/Experiments/MX/About_our_beamlines/CM01.html"},{name:"ID01",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/UsersAndScience/Experiments/XNP/ID01"},{name:"ID06",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/home/UsersAndScience/Experiments/MEx/id06-large-volume-press.html"},{name:"ID11",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/UsersAndScience/Experiments/StructMaterials/ID11"},{name:"ID16A",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/UsersAndScience/Experiments/XNP/ID16A"},{name:"ID16B",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/UsersAndScience/Experiments/XNP/ID16B"},{name:"ID17",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/UsersAndScience/Experiments/CBS/ID17"},{name:"ID19",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/home/UsersAndScience/Experiments/StructMaterials/ID19.html"},{name:"ID21",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/UsersAndScience/Experiments/XNP/ID21"},{name:"ID22",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/id22"},{name:"ID23-1",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/UsersAndScience/Experiments/MX/About_our_beamlines/ID23-1"},{name:"ID23-2",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/UsersAndScience/Experiments/MX/About_our_beamlines/ID23-2"},{name:"ID29",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/home/UsersAndScience/Experiments/Beamlines/content/content/id29.html"},{name:"ID30A1",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/MASSIF1"},{name:"ID30A3",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/home/UsersAndScience/Experiments/MX/About_our_beamlines/id30a-3--massif-3.html"},{name:"ID30B",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/id30b"},{name:"ID32",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/ID32"}];Citation.prototype.getAuthorsForCitation=function(e){if(this.isBuildable){var t=_.transform(e,function(e,t,r,i){i instanceof Array||(t=i);var n=null;if(t.givenName?((n=new Author).setFamilyName(t.familyName),n.setFirstName(t.givenName),e.push(n.getTitleCaseFamilyName()+" "+n.getFirstNameInitials())):((n=new Author).setSingleName(t.name),n.getRawFamilyName()&&n.getRawFirstName()?e.push(n.getTitleCaseFamilyName()+" "+n.getFirstNameInitials()):e.push(t.name)),!(i instanceof Array))return!1},[]);return _.join(t,", ")}return console.log("[CITATION GENERATION] Author list for the citation could not be generated."),""},Citation.prototype.getDOIRegistrationYear=function(e){return e.resourceType===CONSTANTS.ES_RESOURCE_TYPE?moment(e.sessionDate).year():e.resourceType===CONSTANTS.DC_RESOURCE_TYPE?e.publiclyAccessibleYear:(console.log("[CITATION GENERATION] Could not get the year to generate the citation."),"")};var CONSTANTS={ES_RESOURCE_TYPE:"experimental session resource type",DC_RESOURCE_TYPE:"dataset collection resource type"};DOIController.prototype.isValidDOIData=function(e){return!0},DOIController.prototype.render=function(e,t){if(this.isValidDOIData(t)){var r=new DoiData,i=new JsonExtractor;r.title=i.getTitle(t),r.doi=i.getDOI(t),r.dataciteLink=this.doiServer+e,r.publisher=i.getPublisher(t),r.creators=i.getCreators(t),r.publiclyAccessibleYear=i.getPubliclyAccessibleYear(t),r.abstract=i.getAbstract(t),r.investigationId=i.getInvestigationId(t),r.resourceType=i.getResourceType(t),r.proposalType=i.getFieldFromSubject(t.subjects,"Proposal Type Description"),r.resourceTypeGeneral=i.getResourceTypeGeneral(t),r.sessionDate=i.getSessionDate(t);var n=i.getFieldFromSubject(t.subjects,"Proposal"),a=i.getFieldFromSubject(t.subjects,"Instrument");this.experimentalReportController.requestFilenameList(n[0]),r.accessibility=r.getAccessibilityStatus(r.resourceType,r.sessionDate,r.publiclyAccessibleYear),r.accessMessage=this.view.setDataAccessMessage(r),r.citation=this.createCitation(r),r.resourceType===CONSTANTS.ES_RESOURCE_TYPE&&(r.beamlineUrls=this.getBeamlineUrl(a,r.sessionDate,r.resourceType),r.mintingYear=moment(r.sessionDate).year()),r.resourceType===CONSTANTS.DC_RESOURCE_TYPE&&(r.beamlineUrls=this.getBeamlineUrl(a,r.publiclyAccessibleYear,r.resourceType),r.mintingYear=r.publiclyAccessibleYear),r.mergedProposalBeamlines=i.getMergedProposalAndBeamline(n,a,r.beamlineUrls),this.view.renderDOIData(r)}else this.view.renderError("Not Found",this.origin)},DOIController.prototype.getData=function(e){var t=this;this.view.setDOIInTopBanner(e),"10.15151/ESRF-DC-142893590"!=e.toUpperCase()?"10.15151/ESRF-DC-142915526"!=e.toUpperCase()?this.hasAcceptedPrefix(e)?($.ajax({headers:{Accept:"application/vnd.datacite.datacite+json"},type:"GET",timeout:15e3,url:this.doiServer+e,beforeSend:function(){t.view.setLoading("Retrieving data from Server")},complete:function(){t.view.setLoading(!1)}}).done(function(r){r&&t.render(e,r)}).fail(function(r,i,n){$.ajax({type:"GET",timeout:15e3,url:t.icatPlusServer+e+"/json-datacite",beforeSend:function(){try{$("logo").fadeIn().fadeOut().fadeIn().fadeOut().fadeIn().fadeOut()}catch(e){}t.view.setLoading("Retrieving data from Server")},complete:function(){t.view.setLoading(!1)}}).done(function(r){r&&t.render(e,r)}).fail(function(e,r,i){t.view.renderError(e,i,t.origin),t.view.setLoading(!1)})}),this.getDataForGoogleSearch(e)):t.view.renderError("Bad Prefix",t.origin):this.render(e,ESRF_DC_142915526):this.render(e,ESRF_DC_142893590)},DOIController.prototype.getDataForGoogleSearch=function(e){var t=this;e&&$.ajax({headers:{Accept:"application/vnd.schemaorg.ld+json"},type:"GET",timeout:15e3,url:"https://data.datacite.org/"+e,success:function(e){e?e.name?(e.description||(e.description=e.name),t.view.addDOIMetadataToHead(JSON.stringify(e))):console.log("[GOOGLE SEARCH INDEXING] - The data required by Google is missing the 'name' field. This is required by Google for indexing."):console.log("[GOOGLE SEARCH INDEXING] - No metadata recieved from datacite.")},error:function(e){console.log("[GOOGLE SEARCH INDEXING] - Failed getting metadata from datacite."),console.log(e.responseJSON)}})},DOIController.prototype.hasAcceptedPrefix=function(e){var t=e.split("/")[0];return-1!=_.findIndex(this.acceptedPrefix,function(e){return t==e})},DOIController.prototype.displayMainContent=function(e){"welcome-page"===this.origin&&dust.render("welcome_tpl",{},function(e,t){$("#main").html(t)}),"index"===this.origin&&this.getData(e)},DOIController.prototype.setOrigin=function(e){this.origin=e},DOIController.prototype.getBeamlineUrl=function(e,t,r){var i=[];return e.forEach(function(e){if(t){r===CONSTANTS.ES_RESOURCE_TYPE&&(t=moment(t)),r===CONSTANTS.DC_RESOURCE_TYPE&&(t=moment(t,"YYYY"));for(var n="",a=0;a<BEAMLINEURL.length;a++){var o=moment(BEAMLINEURL[a].startDate),s=moment(BEAMLINEURL[a].endDate);if(BEAMLINEURL[a].name.toLowerCase()===e.toLowerCase()&&t>=o&&t<=s){n=BEAMLINEURL[a].url;break}}""===n?i.push("noLink"):i.push(n)}else i.push("noLink")}),i},DOIController.prototype.createCitation=function(e){var t=new Citation(e);if(t.isBuildable){return t.getAuthorsForCitation(e.creators)+" ("+t.getDOIRegistrationYear(e)+"). "+e.title+". "+e.publisher+" (ESRF). <a href='https://doi.esrf.fr/"+e.doi+"'> doi:"+e.doi.toUpperCase()+"</a>"}return"The citation could not be generated."},DoiData.prototype.getAccessibilityStatus=function(e,t,r){if(e)if(e===CONSTANTS.ES_RESOURCE_TYPE){if(r&&t){var i=moment(r,"YYYY"),n=moment();if(n>i)return"Open access";if(n<=i)return"Restricted access"}}else if(e===CONSTANTS.DC_RESOURCE_TYPE)return"Open access";return console.log("Failed to determine whether the accessibility of the DOI."),"Accessibility status could not be determined"},DOIView.prototype.setLoading=function(e){0!=e?$("body").addClass("loading"):$("body").removeClass("loading")},DOIView.prototype.setDOIInTopBanner=function(e){$("#doiValue").text("DOI > "+e.toUpperCase())},DOIView.prototype.renderExperimentalReportData=function(e){if(e){var t=this;this.isDOIAlreadyRendered?dust.render("experimentalreport_tpl",{data:e},function(e,r){$("#"+t.reportPanelId).html(r)}):this.reportExperimentFileNames=e}},DOIView.prototype.renderDOIData=function(e){var t=this;dust.render("landingpage_tpl",{data:e,constants:CONSTANTS},function(r,i){$("#"+t.mainPanelId).html(i),t.isDOIAlreadyRendered=!0,t.renderBadges(e),t.renderMetadata(e),t.failedRecievingExpReport?t.renderErrorForExperimentalReport():t.reportExperimentFileNames&&t.renderExperimentalReportData(t.reportExperimentFileNames)})},DOIView.prototype.renderError=function(e,t,r){var i="welcome-page"===r?"doinotfound2_tpl":"doinotfound_tpl",n="";n="Bad Prefix"===t?"welcome-page"===r?'<h3> Not found ! </h3> <p> The DOI was not found at ESRF because its prefix is not ESRF specific. Please use the DOI search engine at <a href="https://www.doi.org"> doi.org</a>. </p>':'<h2> Not found ! </h2> <p> The DOI was not found at ESRF because its prefix is not ESRF specific. </br> Please use the DOI search engine at <a href="https://www.doi.org"> doi.org</a>. </p>':"Not Found"===t?"welcome-page"===r?"<h3> Not found ! </h3> <p> Sorry, the requested DOI was not found. </p>":"<h2> Not found ! </h2> <p> Sorry, the requested DOI was not found. </p>":"timeout"===t?"welcome-page"===r?"<h3> Not found ! </h3> <p> Sorry, the server took too long to reply. Try again later. </p>":"<h2> Not found ! </h2> <p> Sorry, the server took too long to reply. Try again later. </p>":""===t&&"The resource you are looking for doesn't exist."===e.responseText?"welcome-page"===r?"<h3> Not found ! </h3> <p>It may take up to 24 hours for a newly generated DOI to become available. Please try again later.</p>":"<h2> Not found ! </h2> <p>It may take up to 24 hours for a newly generated DOI to become available. Please try again later.</p>":"welcome-page"===r?"<h3> Not found ! </h3> <p> Connexion problem to the datacite server. Please try again later.</p>":"<h2> Not found ! </h2> <p> Connexion problem to the datacite server. Please try again later.</p>",dust.render(i,{message:n},function(e,t){$("#error").html(t)})},DOIView.prototype.renderErrorForExperimentalReport=function(){this.failedRecievingExpReport=!0;$("#"+this.reportPanelId).html('<div class="card-header text-center"> <label>Experimental report </label> </div> <div class="card-body padding10"> <p> The filename list is not available. </p> </div>')},DOIView.prototype.renderBadges=function(e){if(e){var t=this;dust.render("badges_tpl",{data:e,constants:CONSTANTS},function(e,r){$("#"+t.badgePanelId).html(r)})}},DOIView.prototype.renderMetadata=function(e){if(e){var t=this;e.sessionDate=moment(e.sessionDate).format("YYYY-M-D"),dust.render("metadata_tpl",{data:e,constants:CONSTANTS},function(e,r){$("#"+t.metadataDivId).html(r)})}},DOIView.prototype.setDataAccessMessage=function(e){return"Open access"===e.accessibility?"The data can be accessed by clicking on the link below":"Restricted access"===e.accessibility?"The data are under embargo until <b>"+e.publiclyAccessibleYear+"</b> but could be released earlier. Currently, they are only accessible to proposal team members.":void 0},DOIView.prototype.addDOIMetadataToHead=function(e){$("<script>").attr("type","application/ld+json").text(e).appendTo("head")};var ESRF_DC_142893590={id:"https://doi.org/10.15151/esrf-dc-142893590",doi:"10.15151/ESRF-DC-142893590",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"},{name:"Bowler, Matthew W.",nameType:"Personal",givenName:"Matthew W.",familyName:"Bowler"},{name:"Rupp, Bernhard",nameType:"Personal",givenName:"Bernhard",familyName:"Rupp"}],titles:[{title:"Structural Evidence for a Role of the Multi-functional Human Glycoprotein Afamin in Wnt Transport"}],publisher:"European Synchrotron Radiation Facility",container:{},subjects:[{subject:"OPID-1",subjectScheme:"Proposal"},{subject:"ID30A1",subjectScheme:"Instrument"}],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",providerId:"inist",clientId:"inist.esrf",state:"findable"},ESRF_DC_142915526={id:"https://doi.org/10.15151/esrf-dc-142915526",doi:"10.15151/ESRF-DC-142915526",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"}],publisher:"European Synchrotron Radiation Facility",container:{},subjects:[{subject:"OPID-1",subjectScheme:"Proposal"},{subject:"ID30A1",subjectScheme:"Instrument"}],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",providerId:"inist",clientId:"inist.esrf",state:"findable"};Event.prototype={attach:function(e){this._listeners.push(e)},notify:function(e){for(var t=0;t<this._listeners.length;t++)this._listeners[t](this._sender,e)}},ExperimentalReportController.prototype.normalizeProposalName=function(e){var t;try{return t=new RegExp(/^(.*)-(.*)/),{categoryCode:t.exec(e)[1],categoryCounter:t.exec(e)[2]}}catch(r){t=new RegExp(/\d+$/);try{return{categoryCode:e.substring(0,e.length-t.exec(e)[0].length),categoryCounter:t.exec(e)[0]}}catch(e){return console.log(e),null}}},ExperimentalReportController.prototype.requestFilenameList=function(e){var t=this;if(e){var r=this.normalizeProposalName(e);r?$.ajax({type:"GET",timeout:this.timeout,url:this.server,data:r,dataType:"json",success:function(e){t.onSuccess.notify(e)},error:function(e){t.onError.notify(e)}}):t.onError.notify("Proposal could not be normalized: "+e)}else t.onError.notify("Proposal is null")},ExperimentalReportController.prototype.openFileInNewTab=function(e){if(e)try{window.open("ftp://www.esrf.eu/pub/UserReports/"+e,"_blank")}catch(t){alert("The requested file "+e+" could not be downloaded.")}},JsonExtractor.prototype.getTitle=function(e){return e&&e.titles&&e.titles.length>0&&e.titles[0].title?e.titles[0].title:(console.log("[JSON EXTRACTOR ERROR] title extraction failed."),null)},JsonExtractor.prototype.getDOI=function(e){return e&&e.doi?e.doi.toUpperCase():(console.log("[JSON EXTRACTOR ERROR] doi extraction failed."),null)},JsonExtractor.prototype.getPublisher=function(e){return e&&e.publisher?e.publisher:(console.log("[JSON EXTRACTOR ERROR] publisher extraction failed."),null)},JsonExtractor.prototype.getCreators=function(e){return e&&e.creators?_.map(e.creators,function(e){return e.givenName&&e.familyName||e.name?e:(console.log("[JSON EXTRACTOR ERROR] one of the creator could not be properly extracted."),{})}):(console.log("[JSON EXTRACTOR ERROR] Extraction of the creators failed."),null)},JsonExtractor.prototype.getPubliclyAccessibleYear=function(e){return e&&e.publicationYear?e.publicationYear:(console.log("[JSON EXTRACTOR ERROR] Extraction of the publication year failed."),null)},JsonExtractor.prototype.getInvestigationId=function(e){var t=RegExp(/\/\w*-*[Ee][Ss][Rr][Ff]-[Ee][Ss]-(\d+)$/);return t.exec(e.doi)?t.exec(e.doi)[1]:(console.log("[JSON EXTRACTOR ERROR] investigationId extraction failed."),null)},JsonExtractor.prototype.getFieldFromSubject=function(e,t){if(e)for(var r=new RegExp("^"+t+"$","i"),i=0;i<e.length;i++)if(r.test(e[i].subjectScheme)&&e[i].subject)return _.split(e[i].subject,",");return null},JsonExtractor.prototype.getMintingYear=function(e){},JsonExtractor.prototype.getSessionDate=function(e){if(e&&e.dates&&e.dates instanceof Array){var t=_.find(e.dates,function(e){if(e.dateType)return"collected"===e.dateType.toLowerCase()});if(t&&t.date)return moment(t.date).format("YYYY-MM-DD")}return console.log("[JSON EXTRACTOR ERROR] Extraction of session date failed."),null},JsonExtractor.prototype.getResourceTypeGeneral=function(e){if(e&&e.types)for(var t in e.types)if("resourceTypeGeneral"===t)return e.types[t];return console.log("[JSON EXTRACTOR ERROR] Extraction of resource type general failed."),null},JsonExtractor.prototype.getResourceType=function(e){if(e&&e.types)for(var t in e.types)if("resourceType"===t){if("Experiment Session"===e.types[t])return CONSTANTS.ES_RESOURCE_TYPE;if("Datacollection"===e.types[t])return CONSTANTS.DC_RESOURCE_TYPE}return console.log("[JSON EXTRACTOR ERROR] Extraction of resource type failed."),null},JsonExtractor.prototype.getAbstract=function(e){if(e&&e.descriptions){var t=_.find(e.descriptions,function(e){return"abstract"===e.descriptionType.toLowerCase()});if(t)return t.description}return console.log("[JSON EXTRACTOR ERROR] Extraction of the abstract failed."),null},JsonExtractor.prototype.getMergedProposalAndBeamline=function(e,t,r){if(e&&t&&r&&e.length===t.length&&e.length===r.length){for(var i=[],n=0;n<e.length;n++)i.push({proposal:e[n],beamline:t[n],beamlineUrl:r[n]});return _.uniqBy(i,function(e){return JSON.stringify(e)})}return null},dust.helpers.proposalBeamlineTable=proposalBeamlineTable,dust.helpers.abstract=abstract;
\ No newline at end of file
function Author(){}function Citation(e){this.isBuildable=function(){if(e&&e.creators&&0!==e.creators.length&&e.title&&e.publisher&&e.doi){if(e.resourceType===CONSTANTS.ES_RESOURCE_TYPE&&e.sessionDate)return!0;if(e.resourceType===CONSTANTS.DC_RESOURCE_TYPE&&e.publiclyAccessibleYear)return!0}return!1}()}function DOIController(e){var t=this;this.doiServer="https://data.datacite.org/",this.icatPlusServer="https://icatplus.esrf.fr/doi/",this.acceptedPrefix=["10.5072","10.15151"],this.view=e,this.experimentalReportController=new ExperimentalReportController,this.experimentalReportController.onSuccess.attach(function(e,r){t.view.renderExperimentalReportData(r)}),this.experimentalReportController.onError.attach(function(e,r){console.log("Error when retrieving fileList from SMIS."),t.view.renderErrorForExperimentalReport()})}function DoiData(){}function DOIView(){this.mainPanelId="main",this.reportPanelId="expReport",this.badgePanelId="badges",this.metadataDivId="metadata",this.reportExperimentFileNames=null,this.failedRecievingExpReport=!1,this.isDOIAlreadyRendered=!1,this.onDOIRendered=new Event(this)}function Event(e){this._sender=e,this._listeners=[]}function ExperimentalReportController(){this.server="https://wwws.esrf.fr/misapps/SMISServer/rest/reports/fileNames",this.timeout=5e3,this.onSuccess=new Event(this),this.onError=new Event(this)}function JsonExtractor(){}function proposalBeamlineTable(e,t,r,n){var i=n.mergedProposalBeamlines;if(e.write('<table class="table table-striped">'),e.write("<thead>"),e.write("<tr>"),e.write('<th scope="col">Proposals</th>'),e.write('<th scope="col">Beamlines</th>'),e.write("</tr>"),e.write("</thead>"),e.write("<tbody>"),i){for(var a=0;a<i.length;a++)if(i[a]){var o=i[a].proposal||"unknown",s=i[a].beamline||"unknown",l=i[a].beamlineUrl;e.write("<tr>"),e.write("<td>"+o+"</td>"),"noLink"===l?e.write("<td>"+s+"</td>"):e.write('<td> <a href="'+l+'" target="_blank">'+s+" </a> </td>"),e.write("</tr>")}else e.write("<tr>"),chunck.write("<td> unknown </td>"),chunck.write("<td> unknown </td>"),e.write("</tr>");return e.write("</tbody>"),e.write("</table>"),e.render(r.block,t)}}function abstract(e,t,r,n){var i=n.abstract;return e.write('<div class="myBorder-left">'),e.write("<label> Abstract </label>"),e.write('<div class="padding-left-15">'),i?e.write(i):e.write("There is no abstract for this session."),e.write("</div >"),e.write("</div >"),e.render(r.block,t)}Author.prototype.setFirstName=function(e){this.firstName=e},Author.prototype.setFamilyName=function(e){this.familyName=e},Author.prototype.setSingleName=function(e){this.singleName=e},Author.prototype.getRawFamilyName=function(){if(this.familyName)return this.familyName;if(this.singleName){var e=new RegExp(/(\S+)/g),t=this.singleName.match(e);if(2===t.length)return this.familyName=t[1],this.familyName;var r=new RegExp(/\s([^a-z]+$)/).exec(this.singleName);return r&&(this.familyName=r[1]),this.familyName}},Author.prototype.getRawFirstName=function(){if(this.firstName)return this.firstName;if(this.singleName){var e=new RegExp(/(\S+)/g),t=this.singleName.match(e);if(2===t.length)return this.firstName=t[0],this.firstName;var r=new RegExp(/^(.[^A-Z]+)+\b/).exec(this.singleName);return r&&(this.firstName=r[0]),r}},Author.prototype.getTitleCaseFamilyName=function(){if(this.familyName){allLowerCase=this.familyName.toLowerCase();var e=new RegExp(/^./);return allLowerCase.replace(e,function(e){return e.toUpperCase()})}return console.log("family name is undefined"),null},Author.prototype.getFirstNameInitials=function(){var e=new RegExp(/(\S+)/g);return this.firstName?this.firstName.replace(e,function(e){return e.charAt(0)+"."}):(console.log("first name is undefined"),null)};var BEAMLINEURL=[{name:"BM05",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/UsersAndScience/Experiments/XNP/BM05"},{name:"BM29",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/UsersAndScience/Experiments/MX/About_our_beamlines/BM29"},{name:"CM01",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/home/UsersAndScience/Experiments/MX/About_our_beamlines/CM01.html"},{name:"ID01",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/UsersAndScience/Experiments/XNP/ID01"},{name:"ID06",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/home/UsersAndScience/Experiments/MEx/id06-large-volume-press.html"},{name:"ID11",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/UsersAndScience/Experiments/StructMaterials/ID11"},{name:"ID16A",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/UsersAndScience/Experiments/XNP/ID16A"},{name:"ID16B",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/UsersAndScience/Experiments/XNP/ID16B"},{name:"ID17",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/UsersAndScience/Experiments/CBS/ID17"},{name:"ID19",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.fr/home/UsersAndScience/Experiments/StructMaterials/ID19.html"},{name:"ID21",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/UsersAndScience/Experiments/XNP/ID21"},{name:"ID22",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/id22"},{name:"ID23-1",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/UsersAndScience/Experiments/MX/About_our_beamlines/ID23-1"},{name:"ID23-2",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/UsersAndScience/Experiments/MX/About_our_beamlines/ID23-2"},{name:"ID29",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/home/UsersAndScience/Experiments/Beamlines/content/content/id29.html"},{name:"ID30A1",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/MASSIF1"},{name:"ID30A3",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/home/UsersAndScience/Experiments/MX/About_our_beamlines/id30a-3--massif-3.html"},{name:"ID30B",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/id30b"},{name:"ID32",startDate:"2000-01-01T00:00+00:00",endDate:"2100-12-31T00:00+00:00",url:"http://www.esrf.eu/ID32"}];Citation.prototype.getAuthorsForCitation=function(e){if(this.isBuildable){var t=_.transform(e,function(e,t,r,n){n instanceof Array||(t=n);var i=null;if(t.givenName?((i=new Author).setFamilyName(t.familyName),i.setFirstName(t.givenName),e.push(i.getTitleCaseFamilyName()+" "+i.getFirstNameInitials())):((i=new Author).setSingleName(t.name),i.getRawFamilyName()&&i.getRawFirstName()?e.push(i.getTitleCaseFamilyName()+" "+i.getFirstNameInitials()):e.push(t.name)),!(n instanceof Array))return!1},[]);return _.join(t,", ")}return console.log("[CITATION GENERATION] Author list for the citation could not be generated."),""},Citation.prototype.getDOIRegistrationYear=function(e){return e.resourceType===CONSTANTS.ES_RESOURCE_TYPE?moment(e.sessionDate).year():e.resourceType===CONSTANTS.DC_RESOURCE_TYPE?e.publiclyAccessibleYear:(console.log("[CITATION GENERATION] Could not get the year to generate the citation."),"")};var CONSTANTS={ES_RESOURCE_TYPE:"experimental session resource type",DC_RESOURCE_TYPE:"dataset collection resource type"};DOIController.prototype.isValidDOIData=function(e){return!0},DOIController.prototype.render=function(e,t){if(this.isValidDOIData(t)){var r=new DoiData,n=new JsonExtractor;r.title=n.getTitle(t),r.doi=n.getDOI(t),r.dataciteLink=this.doiServer+e,r.publisher=n.getPublisher(t),r.creators=n.getCreators(t),r.publiclyAccessibleYear=n.getPubliclyAccessibleYear(t),console.log(r.publiclyAccessibleYear),r.abstract=n.getAbstract(t),r.investigationId=n.getInvestigationId(t),r.resourceType=n.getResourceType(t),r.proposalType=n.getFieldFromSubject(t.subjects,"Proposal Type Description"),r.resourceTypeGeneral=n.getResourceTypeGeneral(t),r.sessionDate=n.getSessionDate(t);var i=n.getFieldFromSubject(t.subjects,"Proposal"),a=n.getFieldFromSubject(t.subjects,"Instrument");this.experimentalReportController.requestFilenameList(i[0]),r.accessibility=r.getAccessibilityStatus(r.resourceType,r.sessionDate,r.publiclyAccessibleYear),r.accessMessage=this.view.setDataAccessMessage(r),r.citation=this.createCitation(r),r.resourceType===CONSTANTS.ES_RESOURCE_TYPE&&(r.beamlineUrls=this.getBeamlineUrl(a,r.sessionDate,r.resourceType),r.mintingYear=moment(r.sessionDate).year()),r.resourceType===CONSTANTS.DC_RESOURCE_TYPE&&(r.beamlineUrls=this.getBeamlineUrl(a,r.publiclyAccessibleYear,r.resourceType),r.mintingYear=r.publiclyAccessibleYear),r.mergedProposalBeamlines=n.getMergedProposalAndBeamline(i,a,r.beamlineUrls),this.view.renderDOIData(r)}else this.view.renderError("Not Found",this.origin)},DOIController.prototype.getData=function(e){var t=this;this.view.setDOIInTopBanner(e),"10.15151/ESRF-DC-142893590"!=e.toUpperCase()?"10.15151/ESRF-DC-142915526"!=e.toUpperCase()?this.hasAcceptedPrefix(e)?($.ajax({headers:{Accept:"application/vnd.datacite.datacite+json"},type:"GET",timeout:15e3,url:this.doiServer+e,beforeSend:function(){t.view.setLoading("Retrieving data from Server")},complete:function(){t.view.setLoading(!1)}}).done(function(r){r&&t.render(e,r)}).fail(function(r,n,i){$.ajax({type:"GET",timeout:15e3,url:t.icatPlusServer+e+"/json-datacite",beforeSend:function(){try{$("logo").fadeIn().fadeOut().fadeIn().fadeOut().fadeIn().fadeOut()}catch(e){}t.view.setLoading("Retrieving data from Server")},complete:function(){t.view.setLoading(!1)}}).done(function(r){r&&t.render(e,r)}).fail(function(e,r,n){t.view.renderError(e,n,t.origin),t.view.setLoading(!1)})}),this.getDataForGoogleSearch(e)):t.view.renderError("Bad Prefix",t.origin):this.render(e,ESRF_DC_142915526):this.render(e,ESRF_DC_142893590)},DOIController.prototype.getDataForGoogleSearch=function(e){var t=this;e&&$.ajax({headers:{Accept:"application/vnd.schemaorg.ld+json"},type:"GET",timeout:15e3,url:"https://data.datacite.org/"+e,success:function(e){e?e.name?(e.description||(e.description=e.name),t.view.addDOIMetadataToHead(JSON.stringify(e))):console.log("[GOOGLE SEARCH INDEXING] - The data required by Google is missing the 'name' field. This is required by Google for indexing."):console.log("[GOOGLE SEARCH INDEXING] - No metadata recieved from datacite.")},error:function(e){console.log("[GOOGLE SEARCH INDEXING] - Failed getting metadata from datacite."),console.log(e.responseJSON)}})},DOIController.prototype.hasAcceptedPrefix=function(e){var t=e.split("/")[0];return-1!=_.findIndex(this.acceptedPrefix,function(e){return t==e})},DOIController.prototype.displayMainContent=function(e){"welcome-page"===this.origin&&dust.render("welcome_tpl",{},function(e,t){$("#main").html(t)}),"index"===this.origin&&this.getData(e)},DOIController.prototype.setOrigin=function(e){this.origin=e},DOIController.prototype.getBeamlineUrl=function(e,t,r){var n=[];return e.forEach(function(e){if(t){r===CONSTANTS.ES_RESOURCE_TYPE&&(t=moment(t)),r===CONSTANTS.DC_RESOURCE_TYPE&&(t=moment(t,"YYYY"));for(var i="",a=0;a<BEAMLINEURL.length;a++){var o=moment(BEAMLINEURL[a].startDate),s=moment(BEAMLINEURL[a].endDate);if(BEAMLINEURL[a].name.toLowerCase()===e.toLowerCase()&&t>=o&&t<=s){i=BEAMLINEURL[a].url;break}}""===i?n.push("noLink"):n.push(i)}else n.push("noLink")}),n},DOIController.prototype.createCitation=function(e){var t=new Citation(e);if(t.isBuildable){return t.getAuthorsForCitation(e.creators)+" ("+t.getDOIRegistrationYear(e)+"). "+e.title+". "+e.publisher+" (ESRF). <a href='https://doi.esrf.fr/"+e.doi+"'> doi:"+e.doi.toUpperCase()+"</a>"}return"The citation could not be generated."},DoiData.prototype.getAccessibilityStatus=function(e,t,r){if(e)if(e===CONSTANTS.ES_RESOURCE_TYPE){if(r&&t){var n=moment(t).year(parseInt(r)),i=moment();if(i>n)return"Open access";if(i<=n)return"Restricted access"}}else if(e===CONSTANTS.DC_RESOURCE_TYPE)return"Open access";return console.log("Failed to determine whether the accessibility of the DOI."),"Accessibility status could not be determined"},DOIView.prototype.setLoading=function(e){0!=e?$("body").addClass("loading"):$("body").removeClass("loading")},DOIView.prototype.setDOIInTopBanner=function(e){$("#doiValue").text("DOI > "+e.toUpperCase())},DOIView.prototype.renderExperimentalReportData=function(e){if(e){var t=this;this.isDOIAlreadyRendered?dust.render("experimentalreport_tpl",{data:e},function(e,r){$("#"+t.reportPanelId).html(r)}):this.reportExperimentFileNames=e}},DOIView.prototype.renderDOIData=function(e){var t=this;dust.render("landingpage_tpl",{data:e,constants:CONSTANTS},function(r,n){$("#"+t.mainPanelId).html(n),t.isDOIAlreadyRendered=!0,t.renderBadges(e),t.renderMetadata(e),t.failedRecievingExpReport?t.renderErrorForExperimentalReport():t.reportExperimentFileNames&&t.renderExperimentalReportData(t.reportExperimentFileNames)})},DOIView.prototype.renderError=function(e,t,r){var n="welcome-page"===r?"doinotfound2_tpl":"doinotfound_tpl",i="";i="Bad Prefix"===t?"welcome-page"===r?'<h3> Not found ! </h3> <p> The DOI was not found at ESRF because its prefix is not ESRF specific. Please use the DOI search engine at <a href="https://www.doi.org"> doi.org</a>. </p>':'<h2> Not found ! </h2> <p> The DOI was not found at ESRF because its prefix is not ESRF specific. </br> Please use the DOI search engine at <a href="https://www.doi.org"> doi.org</a>. </p>':"Not Found"===t?"welcome-page"===r?"<h3> Not found ! </h3> <p> Sorry, the requested DOI was not found. </p>":"<h2> Not found ! </h2> <p> Sorry, the requested DOI was not found. </p>":"timeout"===t?"welcome-page"===r?"<h3> Not found ! </h3> <p> Sorry, the server took too long to reply. Try again later. </p>":"<h2> Not found ! </h2> <p> Sorry, the server took too long to reply. Try again later. </p>":""===t&&"The resource you are looking for doesn't exist."===e.responseText?"welcome-page"===r?"<h3> Not found ! </h3> <p>It may take up to 24 hours for a newly generated DOI to become available. Please try again later.</p>":"<h2> Not found ! </h2> <p>It may take up to 24 hours for a newly generated DOI to become available. Please try again later.</p>":"welcome-page"===r?"<h3> Not found ! </h3> <p> Connexion problem to the datacite server. Please try again later.</p>":"<h2> Not found ! </h2> <p> Connexion problem to the datacite server. Please try again later.</p>",dust.render(n,{message:i},function(e,t){$("#error").html(t)})},DOIView.prototype.renderErrorForExperimentalReport=function(){this.failedRecievingExpReport=!0;$("#"+this.reportPanelId).html('<div class="card-header text-center"> <label>Experimental report </label> </div> <div class="card-body padding10"> <p> The filename list is not available. </p> </div>')},DOIView.prototype.renderBadges=function(e){if(e){var t=this;dust.render("badges_tpl",{data:e,constants:CONSTANTS},function(e,r){$("#"+t.badgePanelId).html(r)})}},DOIView.prototype.renderMetadata=function(e){if(e){var t=this;e.sessionDate=moment(e.sessionDate).format("YYYY-M-D"),dust.render("metadata_tpl",{data:e,constants:CONSTANTS},function(e,r){$("#"+t.metadataDivId).html(r)})}},DOIView.prototype.setDataAccessMessage=function(e){return"Open access"===e.accessibility?"The data can be accessed by clicking on the link below":"Restricted access"===e.accessibility?"The data are under embargo until <b>"+e.publiclyAccessibleYear+"</b> but could be released earlier. Currently, they are only accessible to proposal team members.":void 0},DOIView.prototype.addDOIMetadataToHead=function(e){$("<script>").attr("type","application/ld+json").text(e).appendTo("head")};var ESRF_DC_142893590={id:"https://doi.org/10.15151/esrf-dc-142893590",doi:"10.15151/ESRF-DC-142893590",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"},{name:"Bowler, Matthew W.",nameType:"Personal",givenName:"Matthew W.",familyName:"Bowler"},{name:"Rupp, Bernhard",nameType:"Personal",givenName:"Bernhard",familyName:"Rupp"}],titles:[{title:"Structural Evidence for a Role of the Multi-functional Human Glycoprotein Afamin in Wnt Transport"}],publisher:"European Synchrotron Radiation Facility",container:{},subjects:[{subject:"OPID-1",subjectScheme:"Proposal"},{subject:"ID30A1",subjectScheme:"Instrument"}],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",providerId:"inist",clientId:"inist.esrf",state:"findable"},ESRF_DC_142915526={id:"https://doi.org/10.15151/esrf-dc-142915526",doi:"10.15151/ESRF-DC-142915526",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"}],publisher:"European Synchrotron Radiation Facility",container:{},subjects:[{subject:"OPID-1",subjectScheme:"Proposal"},{subject:"ID30A1",subjectScheme:"Instrument"}],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",providerId:"inist",clientId:"inist.esrf",state:"findable"};Event.prototype={attach:function(e){this._listeners.push(e)},notify:function(e){for(var t=0;t<this._listeners.length;t++)this._listeners[t](this._sender,e)}},ExperimentalReportController.prototype.normalizeProposalName=function(e){var t;try{return t=new RegExp(/^(.*)-(.*)/),{categoryCode:t.exec(e)[1],categoryCounter:t.exec(e)[2]}}catch(r){t=new RegExp(/\d+$/);try{return{categoryCode:e.substring(0,e.length-t.exec(e)[0].length),categoryCounter:t.exec(e)[0]}}catch(e){return console.log(e),null}}},ExperimentalReportController.prototype.requestFilenameList=function(e){var t=this;if(e){var r=this.normalizeProposalName(e);r?$.ajax({type:"GET",timeout:this.timeout,url:this.server,data:r,dataType:"json",success:function(e){t.onSuccess.notify(e)},error:function(e){t.onError.notify(e)}}):t.onError.notify("Proposal could not be normalized: "+e)}else t.onError.notify("Proposal is null")},ExperimentalReportController.prototype.openFileInNewTab=function(e){if(e)try{window.open("ftp://www.esrf.eu/pub/UserReports/"+e,"_blank")}catch(t){alert("The requested file "+e+" could not be downloaded.")}},JsonExtractor.prototype.getTitle=function(e){return e&&e.titles&&e.titles.length>0&&e.titles[0].title?e.titles[0].title:(console.log("[JSON EXTRACTOR ERROR] title extraction failed."),null)},JsonExtractor.prototype.getDOI=function(e){return e&&e.doi?e.doi.toUpperCase():(console.log("[JSON EXTRACTOR ERROR] doi extraction failed."),null)},JsonExtractor.prototype.getPublisher=function(e){return e&&e.publisher?e.publisher:(console.log("[JSON EXTRACTOR ERROR] publisher extraction failed."),null)},JsonExtractor.prototype.getCreators=function(e){return e&&e.creators?_.map(e.creators,function(e){return e.givenName&&e.familyName||e.name?e:(console.log("[JSON EXTRACTOR ERROR] one of the creator could not be properly extracted."),{})}):(console.log("[JSON EXTRACTOR ERROR] Extraction of the creators failed."),null)},JsonExtractor.prototype.getPubliclyAccessibleYear=function(e){return e&&e.publicationYear?e.publicationYear:(console.log("[JSON EXTRACTOR ERROR] Extraction of the publication year failed."),null)},JsonExtractor.prototype.getInvestigationId=function(e){var t=RegExp(/\/\w*-*[Ee][Ss][Rr][Ff]-[Ee][Ss]-(\d+)$/);return t.exec(e.doi)?t.exec(e.doi)[1]:(console.log("[JSON EXTRACTOR ERROR] investigationId extraction failed."),null)},JsonExtractor.prototype.getFieldFromSubject=function(e,t){if(e)for(var r=new RegExp("^"+t+"$","i"),n=0;n<e.length;n++)if(r.test(e[n].subjectScheme)&&e[n].subject)return _.split(e[n].subject,",");return null},JsonExtractor.prototype.getMintingYear=function(e){},JsonExtractor.prototype.getSessionDate=function(e){if(e&&e.dates&&e.dates instanceof Array){var t=_.find(e.dates,function(e){if(e.dateType)return"collected"===e.dateType.toLowerCase()});if(t&&t.date)return moment(t.date).format("YYYY-MM-DD")}return console.log("[JSON EXTRACTOR ERROR] Extraction of session date failed."),null},JsonExtractor.prototype.getResourceTypeGeneral=function(e){if(e&&e.types)for(var t in e.types)if("resourceTypeGeneral"===t)return e.types[t];return console.log("[JSON EXTRACTOR ERROR] Extraction of resource type general failed."),null},JsonExtractor.prototype.getResourceType=function(e){if(e&&e.types)for(var t in e.types)if("resourceType"===t){if("Experiment Session"===e.types[t])return CONSTANTS.ES_RESOURCE_TYPE;if("Datacollection"===e.types[t])return CONSTANTS.DC_RESOURCE_TYPE}return console.log("[JSON EXTRACTOR ERROR] Extraction of resource type failed."),null},JsonExtractor.prototype.getAbstract=function(e){if(e&&e.descriptions){var t=_.find(e.descriptions,function(e){return"abstract"===e.descriptionType.toLowerCase()});if(t)return t.description}return console.log("[JSON EXTRACTOR ERROR] Extraction of the abstract failed."),null},JsonExtractor.prototype.getMergedProposalAndBeamline=function(e,t,r){if(e&&t&&r&&e.length===t.length&&e.length===r.length){for(var n=[],i=0;i<e.length;i++)n.push({proposal:e[i],beamline:t[i],beamlineUrl:r[i]});return _.uniqBy(n,function(e){return JSON.stringify(e)})}return null},dust.helpers.proposalBeamlineTable=proposalBeamlineTable,dust.helpers.abstract=abstract;
\ No newline at end of file
......@@ -3,5 +3,5 @@
(function(dust){dust.register("doinotfound2_tpl",body_0);function body_0(chk,ctx){return chk.f(ctx.get(["message"], false),ctx,"h",["s"]);}body_0.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("experimentalreport_tpl",body_0);function body_0(chk,ctx){return chk.w("<div class=\"card-header text-center\"><label>Experimental report </label></div><div class=\"card-body padding10\">").x(ctx.get(["data"], false),ctx,{"else":body_1,"block":body_2},{});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("<p class=\"card-text\"> There is currently no experimental report. </p></div>");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.h("eq",ctx,{"block":body_3},{"key":ctx.getPath(false, ["data","length"]),"value":1},"h").h("gt",ctx,{"block":body_4},{"key":ctx.getPath(false, ["data","length"]),"value":1},"h").w(" ");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("<p class=\"card-text\"> <b> One </b> report has been found for this proposal. </p></div><div class=\"card-body\"> <button type=\"button\" class=\"btn btn-primary btn-lg btn-block\" onclick=\"javascript:(function(){ var expRep = new ExperimentalReportController(); expRep.openFileInNewTab('").f(ctx.getPath(false, ["data","0"]),ctx,"h").w("'); })()\" > <span class=\"fa fa-download whiteFont\"></span> ").f(ctx.getPath(false, ["data","0"]),ctx,"h").w(" </button></div>");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("<p class=\"card-text\"> In total, <b> ").f(ctx.getPath(false, ["data","length"]),ctx,"h").w(" </b> reports have been found for this proposal: </p></div> <div class=\"card-body\"><div class=\"scroll-box\">").s(ctx.get(["data"], false),ctx,{"block":body_5},{}).w("</div> </div>");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w(" ").h("sep",ctx,{"block":body_6},{},"h").h("last",ctx,{"block":body_7},{},"h");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w("<div class=\"row\"> <div class=\"col-1\"> </div><div class=\"col-10 padding-bottom-10\"><button type=\"button\" class=\"btn btn-primary btn-lg btn-block\" onclick=\"javascript:(function(){ var expRep = new ExperimentalReportController(); expRep.openFileInNewTab('").f(ctx.getPath(true, []),ctx,"h").w("'); })()\" > <span class=\"fa fa-download whiteFont\"></span> <span class=\"whitefont\"> ").f(ctx.getPath(true, []),ctx,"h").w("</span> </button></div><div class=\"col-1\"> </div> </div>");}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.w("<div class=\"row\"> <div class=\"col-1\"> </div><div class=\"col-10\"><button type=\"button\" class=\"btn btn-primary btn-lg btn-block\" onclick=\"javascript:(function(){ var expRep = new ExperimentalReportController(); expRep.openFileInNewTab('").f(ctx.getPath(true, []),ctx,"h").w("'); })()\" > <span class=\"fa fa-download whiteFont\"></span> <span class=\"whitefont\"> ").f(ctx.getPath(true, []),ctx,"h").w("</span> </button></div><div class=\"col-1\"> </div> </div>");}body_7.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("landingpage_tpl",body_0);function body_0(chk,ctx){return chk.w("<div class=\"container-fluid\"><div class=\"row padding-top-15\"><div class=\"col-12 col-md-9\"><div class=\"row\"><div class=\"col-12\"><div id=\"badges\"> </div> </div></div><div class=\"row\"><div class=\"col-12 fontSize-20 text-center text-uppercase font-weight-bold py-3\">").f(ctx.getPath(false, ["data","title"]),ctx,"h").w("</div></div><div class=\"row\"><div class=\"col-12\"><div class=\"myBorder-left\"><div><cite>").s(ctx.getPath(false, ["data","creators"]),ctx,{"block":body_1},{}).w("</cite></div></div></div></div><div class=\"padding-top-15\"></div></div><div class=\"col-12 col-md-3\"><div class=\"card\"><div class=\"card-body\"><div class=\"card-text\"><label> DOI </label><div class=\"padding-left-15\"> <span class=\"doiBadge borderRadius-5 font-1p4rem\"> <a id=\"doiLink\" href=").f(ctx.getPath(false, ["data","dataciteLink"]),ctx,"h").w("> ").f(ctx.getPath(false, ["data","doi"]),ctx,"h").w(" </a></span> </div><label class=\"padding-top-5\"> Licence (for files) </label><div class=\"padding-left-15\"><p> <a href=\"https://creativecommons.org/licenses/by/4.0/\"> Creative Commons Attribution 4.0 </a> </p></div> </div></div></div></div></div><hr> <div id=\"metadata\"> </div><hr><div class=\"row\"><div class=\"col-12\"> <div class=\"card\" id=\"expReport\"><div class=\"card-header text-center\"><label>Experimental report </label></div></div></div></div><br><div class=\"row\"><div class=\"col-12\"><div class=\"card\"><div class=\"card-header text-center\"><label>Experimental data </label></div><div class=\"card-body padding10\"><p class=\"card-text\" >").f(ctx.getPath(false, ["data","accessMessage"]),ctx,"h",["s"]).w("</p></div><div class=\"card-body\"><div class=\"row\"><div class=\"col-1\"> </div><div class=\"col-10\">").h("eq",ctx,{"else":body_8,"block":body_9},{"key":ctx.getPath(false, ["data","resourceType"]),"value":ctx.getPath(false, ["constants","ES_RESOURCE_TYPE"])},"h").w(" <button type=\"submit\" class=\"btn btn-primary btn-lg btn-block\"> Access data </button></form></div><div class=\"col-1\"> </div></div></div></div> </div></div><hr><div class=\"row\"><div class=\"col-12\"><div class=\"myBorder-left\"><label class=\"greyGradientToRight padding-left-10 padding-right-20\"> Citation </label><div class=\"padding-left-25\"><p> Below is the recommended format for citing this work in a research publication.</p><div class=\"padding-left-25\"><cite> ").f(ctx.getPath(false, ["data","citation"]),ctx,"h",["s"]).w(" </cite></div></div></div> </div></div></div>");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.h("sep",ctx,{"block":body_2},{},"h").h("last",ctx,{"block":body_5},{},"h");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.x(ctx.getPath(true, ["givenName"]),ctx,{"else":body_3,"block":body_4},{});}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w(" ").f(ctx.getPath(true, ["name"]),ctx,"h").w(" ; ");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w(" ").f(ctx.getPath(true, ["givenName"]),ctx,"h").w(" ").f(ctx.getPath(true, ["familyName"]),ctx,"h").w(" ; ");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.x(ctx.getPath(true, ["givenName"]),ctx,{"else":body_6,"block":body_7},{});}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w(" ").f(ctx.getPath(true, ["name"]),ctx,"h").w(". ");}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.w(" ").f(ctx.getPath(true, ["givenName"]),ctx,"h").w(" ").f(ctx.getPath(true, ["familyName"]),ctx,"h").w(". ");}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.w("<form action=\"https://datahub.esrf.fr/public/").f(ctx.getPath(false, ["data","doi"]),ctx,"h").w("\" target=\"_blank\" method=\"post\">");}body_8.__dustBody=!0;function body_9(chk,ctx){return chk.w("<form action=\"https://icat.esrf.fr/#/browse/facility/ESRF/proposal/").f(ctx.getPath(false, ["data","proposalName"]),ctx,"h").w("/investigation/").f(ctx.getPath(false, ["data","investigationId"]),ctx,"h").w("/dataset\" target=\"_blank\">");}body_9.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("metadata_tpl",body_0);function body_0(chk,ctx){return chk.h("eq",ctx,{"block":body_1},{"key":ctx.getPath(false, ["data","resourceType"]),"value":ctx.getPath(false, ["constants","ES_RESOURCE_TYPE"])},"h").h("eq",ctx,{"block":body_17},{"key":ctx.getPath(false, ["data","resourceType"]),"value":ctx.getPath(false, ["constants","DC_RESOURCE_TYPE"])},"h").w(" ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("<div class=\"row\">").x(ctx.getPath(false, ["data","mergedProposalBeamlines"]),ctx,{"block":body_2},{}).w("</div><hr> <div class=\"row\"><div class=\"col-12\">").h("abstract",ctx,{"block":body_16},{"abstract":ctx.getPath(false, ["data","abstract"])},"h").w("</div></div>");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.x(ctx.getPath(false, ["data","mergedProposalBeamlines","0"]),ctx,{"block":body_3},{});}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("<div class=\"col-6 col-md\"><div class=\"myBorder-left\"><label> Proposal </label>").x(ctx.getPath(false, ["data","mergedProposalBeamlines","0","proposal"]),ctx,{"else":body_4,"block":body_5},{}).w("</div></div><div class=\"col-6 col-md\"><div class=\"myBorder-left\"><label> Publication year </label>").x(ctx.getPath(false, ["data","mintingYear"]),ctx,{"else":body_6,"block":body_7},{}).w("</div></div><div class=\"col-6 col-md\"><div class=\"myBorder-left\"><label> Beamline </label> ").x(ctx.getPath(false, ["data","mergedProposalBeamlines","0","beamline"]),ctx,{"else":body_8,"block":body_9},{}).w("</div></div><div class=\"col-6 col-md\"><div class=\"myBorder-left\"><label> Session date </label>").x(ctx.getPath(false, ["data","sessionDate"]),ctx,{"else":body_12,"block":body_13},{}).w("</div></div> <div class=\"col-12 col-md-4\"><div class=\"myBorder-left\"><label>Category </label>").x(ctx.getPath(false, ["data","proposalType"]),ctx,{"else":body_14,"block":body_15},{}).w("</div></div> ");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","mergedProposalBeamlines","0","proposal"]),ctx,"h").w("</div>");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","mintingYear"]),ctx,"h").w("</div>");}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.w("<div class=\"padding-left-15\">Not available</div>");}body_8.__dustBody=!0;function body_9(chk,ctx){return chk.h("eq",ctx,{"else":body_10,"block":body_11},{"key":ctx.getPath(false, ["data","mergedProposalBeamlines","0","beamlineUrl"]),"value":"noLink"},"h");}body_9.__dustBody=!0;function body_10(chk,ctx){return chk.w("<div class=\"padding-left-15\"><a href=\"").f(ctx.getPath(false, ["data","mergedProposalBeamlines","0","beamlineUrl"]),ctx,"h").w("\" target=\"_blank\"> ").f(ctx.getPath(false, ["data","mergedProposalBeamlines","0","beamline"]),ctx,"h").w(" </a></div>");}body_10.__dustBody=!0;function body_11(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","mergedProposalBeamlines","0","beamline"]),ctx,"h").w("</div>");}body_11.__dustBody=!0;function body_12(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_12.__dustBody=!0;function body_13(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","sessionDate"]),ctx,"h").w("</div>");}body_13.__dustBody=!0;function body_14(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_14.__dustBody=!0;function body_15(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","proposalType"]),ctx,"h").w("</div>");}body_15.__dustBody=!0;function body_16(chk,ctx){return chk.w(" ");}body_16.__dustBody=!0;function body_17(chk,ctx){return chk.w("<div class=\"row\"><div class=\"col-md-12 col-xl-8\">").h("abstract",ctx,{"block":body_18},{"abstract":ctx.getPath(false, ["data","abstract"])},"h").w("</br></div><div class=\"col-sm-6 col-xl-2\"><div class=\"myBorder-left\" style=\"margin-right:-15px\">").h("proposalBeamlineTable",ctx,{"block":body_19},{"mergedProposalBeamlines":ctx.getPath(false, ["data","mergedProposalBeamlines"])},"h").w("</div></div><div class=\"col-sm-6 col-xl-2\" ><div class=\"myBorder-left\"><label> Publication year </label>").x(ctx.getPath(false, ["data","mintingYear"]),ctx,{"else":body_20,"block":body_21},{}).w("</div></div></div>");}body_17.__dustBody=!0;function body_18(chk,ctx){return chk.w(" ");}body_18.__dustBody=!0;function body_19(chk,ctx){return chk.w(" ");}body_19.__dustBody=!0;function body_20(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_20.__dustBody=!0;function body_21(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","mintingYear"]),ctx,"h").w("</div>");}body_21.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("metadata_tpl",body_0);function body_0(chk,ctx){return chk.h("eq",ctx,{"block":body_1},{"key":ctx.getPath(false, ["data","resourceType"]),"value":ctx.getPath(false, ["constants","ES_RESOURCE_TYPE"])},"h").h("eq",ctx,{"block":body_17},{"key":ctx.getPath(false, ["data","resourceType"]),"value":ctx.getPath(false, ["constants","DC_RESOURCE_TYPE"])},"h").w(" ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("<div class=\"row\">").x(ctx.getPath(false, ["data","mergedProposalBeamlines"]),ctx,{"block":body_2},{}).w("</div><hr> <div class=\"row\"><div class=\"col-12\">").h("abstract",ctx,{"block":body_16},{"abstract":ctx.getPath(false, ["data","abstract"])},"h").w("</div></div>");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.x(ctx.getPath(false, ["data","mergedProposalBeamlines","0"]),ctx,{"block":body_3},{});}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("<div class=\"col-6 col-md\"><div class=\"myBorder-left\"><label> Proposal </label>").x(ctx.getPath(false, ["data","mergedProposalBeamlines","0","proposal"]),ctx,{"else":body_4,"block":body_5},{}).w("</div></div><div class=\"col-6 col-md\"><div class=\"myBorder-left\"><label> Publication year </label>").x(ctx.getPath(false, ["data","publiclyAccessibleYear"]),ctx,{"else":body_6,"block":body_7},{}).w("</div></div><div class=\"col-6 col-md\"><div class=\"myBorder-left\"><label> Beamline </label> ").x(ctx.getPath(false, ["data","mergedProposalBeamlines","0","beamline"]),ctx,{"else":body_8,"block":body_9},{}).w("</div></div><div class=\"col-6 col-md\"><div class=\"myBorder-left\"><label> Session date </label>").x(ctx.getPath(false, ["data","sessionDate"]),ctx,{"else":body_12,"block":body_13},{}).w("</div></div> <div class=\"col-12 col-md-4\"><div class=\"myBorder-left\"><label>Category </label>").x(ctx.getPath(false, ["data","proposalType"]),ctx,{"else":body_14,"block":body_15},{}).w("</div></div> ");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","mergedProposalBeamlines","0","proposal"]),ctx,"h").w("</div>");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","publiclyAccessibleYear"]),ctx,"h").w("</div>");}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.w("<div class=\"padding-left-15\">Not available</div>");}body_8.__dustBody=!0;function body_9(chk,ctx){return chk.h("eq",ctx,{"else":body_10,"block":body_11},{"key":ctx.getPath(false, ["data","mergedProposalBeamlines","0","beamlineUrl"]),"value":"noLink"},"h");}body_9.__dustBody=!0;function body_10(chk,ctx){return chk.w("<div class=\"padding-left-15\"><a href=\"").f(ctx.getPath(false, ["data","mergedProposalBeamlines","0","beamlineUrl"]),ctx,"h").w("\" target=\"_blank\"> ").f(ctx.getPath(false, ["data","mergedProposalBeamlines","0","beamline"]),ctx,"h").w(" </a></div>");}body_10.__dustBody=!0;function body_11(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","mergedProposalBeamlines","0","beamline"]),ctx,"h").w("</div>");}body_11.__dustBody=!0;function body_12(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_12.__dustBody=!0;function body_13(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","sessionDate"]),ctx,"h").w("</div>");}body_13.__dustBody=!0;function body_14(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_14.__dustBody=!0;function body_15(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","proposalType"]),ctx,"h").w("</div>");}body_15.__dustBody=!0;function body_16(chk,ctx){return chk.w(" ");}body_16.__dustBody=!0;function body_17(chk,ctx){return chk.w("<div class=\"row\"><div class=\"col-md-12 col-xl-8\">").h("abstract",ctx,{"block":body_18},{"abstract":ctx.getPath(false, ["data","abstract"])},"h").w("</br></div><div class=\"col-sm-6 col-xl-2\"><div class=\"myBorder-left\" style=\"margin-right:-15px\">").h("proposalBeamlineTable",ctx,{"block":body_19},{"mergedProposalBeamlines":ctx.getPath(false, ["data","mergedProposalBeamlines"])},"h").w("</div></div><div class=\"col-sm-6 col-xl-2\" ><div class=\"myBorder-left\"><label> Publication year </label>").x(ctx.getPath(false, ["data","mintingYear"]),ctx,{"else":body_20,"block":body_21},{}).w("</div></div></div>");}body_17.__dustBody=!0;function body_18(chk,ctx){return chk.w(" ");}body_18.__dustBody=!0;function body_19(chk,ctx){return chk.w(" ");}body_19.__dustBody=!0;function body_20(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_20.__dustBody=!0;function body_21(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","mintingYear"]),ctx,"h").w("</div>");}body_21.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("welcome_tpl",body_0);function body_0(chk,ctx){return chk.w(" <div class=\"container-fluid\"><div class=\"row\"><div class=\"col-12 flexCentered whiteFont\" style=\"color:#132577; font-size: 6.4rem; height: 200px; margin-top: 10px; margin-bottom: 10px; text-align: center;\">ESRF DOI Portal</div></div></div><div class=\"container-fluid\"><div class=\"row\"><div class=\"col-12 col-md-4\"><div class=\"padding10\"><div class=\"card-header text-center\"><h1 class=\"font-3p2rem\">About the portal</h1></div><div class=\"card-body padding10\">This page centralizes the <a href=\"http://www.esrf.eu/home/UsersAndScience/UserGuide/esrf-data-policy/doi.html\" target=\"_blank\"> DOI</a> services offered by the ESRF to access data stored at the facility as part of its data policy. Data referred to by ESRF DOIs are accessed via the ESRF data catalogue <a href=\"https://icat.esrf.fr\" target=\"_blank\"> icat.esrf.fr</a>.<p> In case you require a DOI for a subset of data please send an email with the following high level metadata - \"proposal\", \"title\", \"authors\", \"abstract\", \"datasets\" to datapolicy@esrf.fr </p></div></div></div><div class=\"col-12 col-md-4\"><div class=\"padding10\"><div class=\"card-header text-center \"><h1 class=\"font-3p2rem\">DOI resolver</h1></div><div class=\"card-body padding10\"><p>The search engine below only searches DOIs which have been minted at the ESRF. <br/> Use <a href=\"https://doi.org\">doi.org </a> search engine for other DOIs.</p><div class=\"row\"><div class=\"col-xl-9 padding-right-0\"><p> <input id=\"doiSearchBox\" class=\"form-control\" placeholder=\"10.15151/ESRF-ES-90632078\" type=\"text\" required/> </p><div class=\"text-danger\" id=\"error\"> </div> </div><div class=\"col searchButtonDiv\"> <input class=\"btn btn-primary\" type=\"submit\" value=\"Search\" onclick=\"searchDOI()\" /> </div></div><div class=\"row\"><div class=\"col\"><p> <a href=\"https://search.datacite.org/works?query=10.15151\"> List all ESRF DOIs </a> </p></div></div></div> </div></div><div class=\"col-12 col-md-4\"><div class=\"padding10\"><div class=\"card-header text-center\"><h1 class=\"font-3p2rem\">About DOI </h1></div><div class=\"card-body padding10\">The Digital Object Identifier (<a href=\"http://www.esrf.eu/home/UsersAndScience/UserGuide/esrf-data-policy/doi.html\">DOI</a>) is a code composed of digits and characters. It identifies data in a unique and permanent way thereby allowing data to be referenced worldwide. The DOI has two parts, namely the DOI prefix and the DOI suffix separated by a slash (\"/\"). The ESRF prefix is 10.15151 followed by a slash and the ESRF suffix. Currently the following suffix(es) are defined:</p><pre>ESRF-ES - for a session at the ESRF </pre>Refer to the <a href=\"http://www.esrf.eu/home/UsersAndScience/UserGuide/esrf-data-policy/doi/doi---concepts.html\">DOI concepts</a> page to find out what a session is.</div></div></div></div></div>");}body_0.__dustBody=!0;return body_0}(dust));
\ No newline at end of file
function DoiData(doi, dataciteLink, publisher, creator, publication_year) {
this.doi = doi;
this.dataciteLink = dataciteLink;
this.publisher = publisher;
this.creator = creator;
this.publiclyAccessibleYear = publication_year;
function DoiData() {
}
/**
......@@ -20,7 +15,8 @@ DoiData.prototype.getAccessibilityStatus = function (resourceType, sessionDate,
if (resourceType) {
if (resourceType === CONSTANTS.ES_RESOURCE_TYPE) {
if (publiclyAccessibleYear && sessionDate) {
var publiclyAvailableDate = moment(publiclyAccessibleYear, "YYYY");
// take day and month of sessionDate and year of publiclyAccessibleYear
var publiclyAvailableDate = moment(sessionDate).year(parseInt(publiclyAccessibleYear));
var now = moment();
if (now > publiclyAvailableDate) {
......@@ -29,7 +25,7 @@ DoiData.prototype.getAccessibilityStatus = function (resourceType, sessionDate,
return "Restricted access";
}
}
} else if (resourceType === CONSTANTS.DC_RESOURCE_TYPE){
} else if (resourceType === CONSTANTS.DC_RESOURCE_TYPE) {
return "Open access";
}
}
......
......@@ -40,10 +40,7 @@ DOIController.prototype.render = function (doi, data) {
} else {
// Extract data and fill doiData with it
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);
......@@ -53,6 +50,8 @@ DOIController.prototype.render = function (doi, data) {
doiData.creators = jsonExtractor.getCreators(data);
doiData.publiclyAccessibleYear = jsonExtractor.getPubliclyAccessibleYear(data);
console.log(doiData.publiclyAccessibleYear );
doiData.abstract = jsonExtractor.getAbstract(data);
doiData.investigationId = jsonExtractor.getInvestigationId(data);
doiData.resourceType = jsonExtractor.getResourceType(data);
......
......@@ -17,11 +17,11 @@
<div class="col-6 col-md">
<div class="myBorder-left">
<label> Publication year </label>
{?data.mintingYear}
<div class="padding-left-15">{data.mintingYear}</div>
{?data.publiclyAccessibleYear}
<div class="padding-left-15">{data.publiclyAccessibleYear}</div>
{:else}
<div class="padding-left-15"> Not available</div>
{/data.mintingYear}
{/data.publiclyAccessibleYear}
</div>
</div>
......
describe('DoiData', () => {
describe('getAccessibilityStatus', () => {
it('Returns open access when today is after publication date', () => {
let doiData = new DoiData();
let actualReourceType = CONSTANTS.ES_RESOURCE_TYPE;
let actualSessionDate = "2017-01-01"
let actualPubliclyAccessibleYear = "2018"
expect(doiData.getAccessibilityStatus(actualReourceType, actualSessionDate, actualPubliclyAccessibleYear)).toEqual("Open access");
})
it('Returns Restricted access when today is before publication date', () => {
let doiData = new DoiData();
let actualReourceType = CONSTANTS.ES_RESOURCE_TYPE;
let actualSessionDate = "2017-01-01"
let actualPubliclyAccessibleYear = "2020"
expect(doiData.getAccessibilityStatus(actualReourceType, actualSessionDate, actualPubliclyAccessibleYear)).toEqual("Restricted access");
})
})
})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment