Commit 9804b28b authored by Maxime Chaillet's avatar Maxime Chaillet Committed by Chaillet Maxime

use karma to test the app. display the proposal and beamline in a table.

parent 459a58d1
RewriteEngine On
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
......
......@@ -7,26 +7,29 @@
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Using grunt-wiredep, the proper js files from bower components are included below -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/dustjs-linkedin/dist/dust-full.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/dustjs-helpers/dist/dust-helpers.min.js"></script>
<script src="bower_components/lodash/lodash.js"></script>
<script src="bower_components/moment/moment.js"></script>
<!-- endbower -->
<!-- Using grunt-include-source, the proper js files created by us (not minified) are included below -->
<script src="src/author.js"></script>
<script src="src/beamlineurl.js"></script>
<script src="src/citation.js"></script>
<script src="src/constants.js"></script>
<script src="src/doicontroller.js"></script>
<script src="src/doiData.js"></script>
<script src="src/doiview.js"></script>
<script src="src/event.js"></script>
<script src="src/experimentalreportcontroller.js"></script>
<script src="src/jsonextractor.js"></script>
<script src="src/metadataTableHelper.js"></script>
<!-- Using grunt-wiredep, the proper js files from bower components are included below -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/dustjs-linkedin/dist/dust-full.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/dustjs-helpers/dist/dust-helpers.min.js"></script>
<script src="bower_components/lodash/lodash.js"></script>
<script src="bower_components/moment/moment.js"></script>
<!-- endbower -->
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
......
......@@ -7,12 +7,13 @@
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Using grunt-include-source, the proper js files created by us (not minified) are included below -->
<!-- include: "type": "js", "files": "src/*.js" -->
<!-- Using grunt-wiredep, the proper js files from bower components are included below -->
<!-- bower:js -->
<!-- endbower -->
<!-- Using grunt-include-source, the proper js files created by us (not minified) are included below -->
<!-- include: "type": "js", "files": "src/*.js" -->
<!-- bower:css -->
<!-- endbower -->
......
......@@ -72,4 +72,4 @@
</div>
</footer>
</body>
</html>
\ No newline at end of file
</html>
// Karma configuration
// Generated on Thu Oct 11 2018 23:09:22 GMT+0200 (CEST)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine', 'browserify'],
// list of files / patterns to load in the browser
files: [
'src/jsonextractor.js',
'src/constants.js',
'tests/jsonExtractor.test.js',
'bower_components/lodash/lodash.js'
],
// list of files / patterns to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'tests/jsonExtractor.test.js': [ 'browserify' ]
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
// web server port
port: 9876,
// 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,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Firefox'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}
This source diff could not be displayed because it is too large. You can view the blob instead.
function Author(){}function Citation(e){this.isBuildable=!!(e&&e.creator&&0!==e.creator.length&&e.date_registered&&e.title&&e.publisher&&e.doi)}function DOIController(e){var t=this;this.doiServer="https://data.datacite.org/",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.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(e){}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("the author list for the citation could not be generated."),""},DOIController.prototype.isValidDOIData=function(e){return _.keysIn(e).length>3&&_.find(_.keysIn(e),function(e){return"title"===e}).length>0},DOIController.prototype.getData=function(e){var t=this;this.view.setDOIInTopBanner(e),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){if(r)if(t.isValidDOIData(r)){var n=new DoiData;n.title=r.title,n.doi=r.doi.toUpperCase(),n.dataciteLink=t.doiServer+e,n.publisher=r.publisher,n.creator=r.creator;var i=new JsonExtractor;if(n.mintingYear=i.getMintingYear(r),n.sessionDate=i.getSessionDate(r),n.publiclyAccessibleYear=r.publication_year,n.proposalType=i.getFieldFromSubject(r.subject,"Proposal Type Description"),n.proposalNumber=i.getFieldFromSubject(r.subject,"Proposal"),t.experimentalReportController.requestFilenameList(n.proposalNumber),n.beamline=i.getFieldFromSubject(r.subject,"instrument"),n.investigationId=i.extractInvestigationId(r),n.accessibility=n.getAccessibilityStatus(n.sessionDate,n.publiclyAccessibleYear),n.accessMessage=t.view.setDataAccessMessage(n),n.citation=t.createCitation(r),n.resourceTypeGeneral=i.getResourceTypeGeneral(r),n.resourceType=i.getResourceType(r),r.date_collected){var a=moment(r.date_collected);n.beamlineUrl=t.getBeamlineUrl(n.beamline,a)}else n.beamlineUrl="noLink";t.view.renderDOIData(n)}else t.view.renderError("Not Found",t.origin)}).fail(function(e,r,n){t.view.renderError(e,n,t.origin),t.view.setLoading(!1)}):t.view.renderError("Bad Prefix",t.origin)},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){for(var r=0;r<BEAMLINEURL.length;r++){var n=moment(BEAMLINEURL[r].startDate),i=moment(BEAMLINEURL[r].endDate);if(BEAMLINEURL[r].name.toLowerCase()===e.toLowerCase()&&t>=n&&t<=i)return BEAMLINEURL[r].url}return null},DOIController.prototype.createCitation=function(e){var t=new Citation(e);if(t.isBuildable){return t.getAuthorsForCitation(e.creator)+" ("+moment(e.date_registered).year()+"). "+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){if(t&&e){var r=moment(t,"YYYY"),n=moment();if(n>r)return"Open access";if(n<=r)return"Restricted 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},function(r,n){$("#"+t.mainPanelId).html(n),t.isDOIAlreadyRendered=!0,t.renderBadges(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},function(e,r){$("#"+t.badgePanelId).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},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.requestFilenameList=function(e){var t=this;if(e){aroundHyphenRegExp=new RegExp(/^(.*)-(.*)/);var r=aroundHyphenRegExp.exec(e)[1],n=aroundHyphenRegExp.exec(e)[2];r&&n&&$.ajax({type:"GET",timeout:this.timeout,url:this.server,data:{categoryCode:r,categoryCounter:n},dataType:"json",success:function(e){t.onSuccess.notify(e)},error:function(e){t.onError.notify(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.extractInvestigationId=function(e){return RegExp(/\/\w*-*[Ee][Ss][Rr][Ff]-[Ee][Ss]-(\d+)$/).exec(e.doi)[1]},JsonExtractor.prototype.getFieldFromSubject=function(e,t){if(e&&e[0])for(var r=0;r<e[0].length;r++)if(e[0][r].subject_scheme===t)return e[0][r].text;return null},JsonExtractor.prototype.getMintingYear=function(e){return e&&e.date_registered&&null!=e.date_registered?moment(e.date_registered).year():null},JsonExtractor.prototype.getSessionDate=function(e){return e&&e.date_collected&&null!=e.date_collected?moment(e.date_collected).format("YYYY-M-D"):null},JsonExtractor.prototype.getResourceTypeGeneral=function(e){return e&&e.resource_type_general?e.resource_type_general:null},JsonExtractor.prototype.getResourceType=function(e){return e&&e.resource_type?e.resource_type:null};
\ No newline at end of file
function Author(){}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"}];function Citation(e){this.isBuildable=!!(e&&e.creator&&0!==e.creator.length&&e.date_registered&&e.title&&e.publisher&&e.doi)}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("the author list for the citation could not be generated."),""};var CONSTANTS={ES_RESOURCE_TYPE:"experimental session resource type",DC_RESOURCE_TYPE:"dataset collection resource type"};function DOIController(e){var r=this;this.doiServer="https://api.test.datacite.org/",this.acceptedPrefix=["10.5072","10.15151"],this.view=e,this.experimentalReportController=new ExperimentalReportController,this.experimentalReportController.onSuccess.attach(function(e,t){r.view.renderExperimentalReportData(t)}),this.experimentalReportController.onError.attach(function(e,t){console.log("Error when retrieving fileList from SMIS."),r.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(e){}function proposalBeamLineTable(e,t,r,n){return e.write('<table class="table table-striped">'),e.write(" <thead>"),e.write("<tr>"),e.write('<th scope="col">First</th>'),e.write('<th scope="col">Last</th>'),e.write("</tr>"),e.write("</thead>"),e.write("<tbody>"),e.write("<tr>"),e.write("<td>Mark</td>"),e.write("<td>Otto</td>"),e.write("</tr>"),e.write("</tbody>"),e.write("</table>"),e.render(r,t)}DOIController.prototype.isValidDOIData=function(e){return 3<_.keysIn(e).length&&0<_.find(_.keysIn(e),function(e){return"title"===e}).length},DOIController.prototype.getData=function(i){var a=this;this.view.setDOIInTopBanner(i),this.hasAcceptedPrefix(i)?$.ajax({headers:{Accept:"application/vnd.datacite.datacite+json"},type:"GET",timeout:15e3,url:this.doiServer+i,beforeSend:function(e){a.view.setLoading("Retrieving data from Server"),e.setRequestHeader("Authorization","Basic "+btoa("DATACITE.ESRF:datacyte1"))},complete:function(){a.view.setLoading(!1)}}).done(function(e){if(e)if(a.isValidDOIData(e)){var t=new DoiData;t.title=e.title,t.doi=e.doi.toUpperCase(),t.dataciteLink=a.doiServer+i,t.publisher=e.publisher,t.creator=e.creator;var r=new JsonExtractor;if(t.mintingYear=r.getMintingYear(e),t.sessionDate=r.getSessionDate(e),t.publiclyAccessibleYear=e.publication_year,t.proposalType=r.getFieldFromSubject(e.subject,"Proposal Type Description"),t.proposalName=r.getFieldFromSubject(e.subject,"Proposal"),a.experimentalReportController.requestFilenameList(t.proposalName),t.beamline=r.getFieldFromSubject(e.subject,"Instrument"),t.investigationId=r.extractInvestigationId(e),t.resourceType=r.getResourceType(e),t.accessibility=t.getAccessibilityStatus(t.resourceType,t.sessionDate,t.publiclyAccessibleYear),t.accessMessage=a.view.setDataAccessMessage(t),t.citation=a.createCitation(e),t.resourceTypeGeneral=r.getResourceTypeGeneral(e),t.DC_RESOURCE_TYPE=CONSTANTS.DC_RESOURCE_TYPE,t.ES_RESOURCE_TYPE=CONSTANTS.ES_RESOURCE_TYPE,e.date_collected){var n=moment(e.date_collected);t.beamlineUrl=a.getBeamlineUrl(t.beamline,n)}else t.beamlineUrl="noLink";a.view.renderDOIData(t)}else a.view.renderError("Not Found",a.origin)}).fail(function(e,t,r){a.view.renderError(e,r,a.origin),a.view.setLoading(!1)}):a.view.renderError("Bad Prefix",a.origin)},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){for(var r=0;r<BEAMLINEURL.length;r++){var n=moment(BEAMLINEURL[r].startDate),i=moment(BEAMLINEURL[r].endDate);if(BEAMLINEURL[r].name.toLowerCase()===e.toLowerCase()&&n<=t&&t<=i)return BEAMLINEURL[r].url}return null},DOIController.prototype.createCitation=function(e){var t=new Citation(e);return t.isBuildable?t.getAuthorsForCitation(e.creator)+" ("+moment(e.date_registered).year()+"). "+e.title+". "+e.publisher+" (ESRF). <a href='https://doi.esrf.fr/"+e.doi+"'> doi:"+e.doi.toUpperCase()+"</a>":"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(r,"YYYY"),i=moment();if(n<i)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 r=this;this.isDOIAlreadyRendered?dust.render("experimentalreport_tpl",{data:e},function(e,t){$("#"+r.reportPanelId).html(t)}):this.reportExperimentFileNames=e}},DOIView.prototype.renderDOIData=function(r){var n=this;dust.render("landingpage_tpl",{data:r},function(e,t){$("#"+n.mainPanelId).html(t),n.isDOIAlreadyRendered=!0,n.renderBadges(r),n.renderMetadata(r),n.failedRecievingExpReport?n.renderErrorForExperimentalReport():n.reportExperimentFileNames&&n.renderExperimentalReportData(n.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 r=this;dust.render("badges_tpl",{data:e},function(e,t){$("#"+r.badgePanelId).html(t)})}},DOIView.prototype.renderMetadata=function(e){if(e){var r=this;dust.render("metadata_tpl",{data:e},function(e,t){$("#"+r.metadataDivId).html(t)})}},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},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.requestFilenameList=function(e){var t=this;if(e){aroundHyphenRegExp=new RegExp(/^(.*)-(.*)/);var r=aroundHyphenRegExp.exec(e)[1],n=aroundHyphenRegExp.exec(e)[2];r&&n&&$.ajax({type:"GET",timeout:this.timeout,url:this.server,data:{categoryCode:r,categoryCounter:n},dataType:"json",success:function(e){t.onSuccess.notify(e)},error:function(e){t.onError.notify(e)}})}else t.onError.notify("Proposal is null")},ExperimentalReportController.prototype.openFileInNewTab=function(t){if(t)try{window.open("ftp://www.esrf.eu/pub/UserReports/"+t,"_blank")}catch(e){alert("The requested file "+t+" could not be downloaded.")}},JsonExtractor.prototype.extractInvestigationId=function(e){RegExp(/\/\w*-*[Ee][Ss][Rr][Ff]-[Ee][Ss]-(\d+)$/);return"investigationId"},JsonExtractor.prototype.getFieldFromSubject=function(e,t){if(e&&e[0])for(var r=new RegExp("^"+t,"i"),n=0;n<e[0].length;n++)if(r.test(e[0][n].subject_scheme)&&e[0][n].text)return _.split(e[0][n].text,",");return null},JsonExtractor.prototype.getMintingYear=function(e){return e&&e.date_registered&&null!=e.date_registered?moment(e.date_registered).year():null},JsonExtractor.prototype.getSessionDate=function(e){return e&&e.date_collected&&null!=e.date_collected?moment(e.date_collected).format("YYYY-M-D"):null},JsonExtractor.prototype.getResourceTypeGeneral=function(e){return e&&e.resource_type_general?e.resource_type_general:null},JsonExtractor.prototype.getResourceType=function(e){if(e&&e.resource_type){if("Experiment Session"===e.resource_type)return CONSTANTS.ES_RESOURCE_TYPE;if("Datacollection"===e.resource_type)return CONSTANTS.DC_RESOURCE_TYPE}return null},dust.helpers.proposalBeamLineTable=proposalBeamLineTable;
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
(function(dust){dust.register("badges_tpl",body_0);function body_0(chk,ctx){return chk.w("<div class=\"row margin-left-0 margin-right-0\">").h("eq",ctx,{"block":body_1},{"key":ctx.getPath(false, ["data","resourceType"]),"value":"Experiment Session"},"h").w(" <div class=\"col\"> </div>").h("eq",ctx,{"block":body_2},{"key":ctx.getPath(false, ["data","resourceTypeGeneral"]),"value":"Dataset"},"h").h("eq",ctx,{"block":body_3},{"key":ctx.getPath(false, ["data","accessibility"]),"value":"Open access"},"h").h("eq",ctx,{"block":body_4},{"key":ctx.getPath(false, ["data","accessibility"]),"value":"Restricted access"},"h").w("</div>");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("<div class=\"col-auto padding-right-2 padding-left-2\"><span class=\"badge badge-secondary font-1p4rem \" > Session </span></div> ");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("<div class=\"col-auto padding-right-2 padding-left-2\"><span class=\"badge badge-secondary font-1p4rem\"> Dataset </span></div>");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("<div class=\"col-auto padding-right-2 padding-left-2\"><span class=\"badge badge-success font-1p4rem \"> Open access </span></div>");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("<div class=\"col-auto padding-right-2 padding-left-2\"><span class=\"badge badge-warning font-1p4rem \"> Restricted access </span></div>");}body_4.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("badges_tpl",body_0);function body_0(chk,ctx){return chk.w("<div class=\"row margin-left-0 margin-right-0\">").h("eq",ctx,{"block":body_1},{"key":ctx.getPath(false, ["data","resourceType"]),"value":ctx.getPath(false, ["CONSTANTS","ES_RESOURCE_TYPE"])},"h").w(" ").h("eq",ctx,{"block":body_2},{"key":ctx.getPath(false, ["data","resourceType"]),"value":ctx.getPath(false, ["CONSTANTS","DC_RESOURCE_TYPE"])},"h").w(" <div class=\"col\"> </div>").h("eq",ctx,{"block":body_3},{"key":ctx.getPath(false, ["data","resourceTypeGeneral"]),"value":"Dataset"},"h").h("eq",ctx,{"block":body_4},{"key":ctx.getPath(false, ["data","accessibility"]),"value":"Open access"},"h").h("eq",ctx,{"block":body_5},{"key":ctx.getPath(false, ["data","accessibility"]),"value":"Restricted access"},"h").w("</div>");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("<div class=\"col-auto padding-right-2 padding-left-2\"><span class=\"badge badge-secondary font-1p4rem \" > Session </span></div>");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("<div class=\"col-auto padding-right-2 padding-left-2\"><span class=\"badge badge-secondary font-1p4rem \" > Collection </span></div>");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("<div class=\"col-auto padding-right-2 padding-left-2\"><span class=\"badge badge-secondary font-1p4rem\"> Dataset </span></div>");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("<div class=\"col-auto padding-right-2 padding-left-2\"><span class=\"badge badge-success font-1p4rem \"> Open access </span></div>");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("<div class=\"col-auto padding-right-2 padding-left-2\"><span class=\"badge badge-warning font-1p4rem \"> Restricted access </span></div>");}body_5.__dustBody=!0;return body_0}(dust));
(function(dust){dust.register("doinotfound_tpl",body_0);function body_0(chk,ctx){return chk.w("<div class=\"container-fluid \" style=\"color:black;\"><div class=\"row\"><div class=\"col-3\"> </div><div class=\"col-6 lightRedBackground text-center rounded\"> <p> ").f(ctx.get(["message"], false),ctx,"h",["s"]).w(" </p> </div></div><div class=\"col-3\"> </div></div> ");}body_0.__dustBody=!0;return body_0}(dust));
(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","creator"]),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 class=\"row\"><div class=\"col\"><div class=\"myBorder-left\"><label> Proposal </label>").x(ctx.getPath(false, ["data","proposalNumber"]),ctx,{"else":body_8,"block":body_9},{}).w("</div></div><div class=\"col\"><div class=\"myBorder-left\"><label> Publication year </label>").x(ctx.getPath(false, ["data","mintingYear"]),ctx,{"else":body_10,"block":body_11},{}).w("</div></div><div class=\"col\"><div class=\"myBorder-left\"><label> Beamline </label> ").x(ctx.getPath(false, ["data","beamline"]),ctx,{"else":body_12,"block":body_13},{}).w("</div></div><div class=\"col\"><div class=\"myBorder-left\"><label> Session date </label>").x(ctx.getPath(false, ["data","sessionDate"]),ctx,{"else":body_16,"block":body_17},{}).w("</div></div> <div class=\"col-4\"><div class=\"myBorder-left\"><label>Category </label>").x(ctx.getPath(false, ["data","proposalType"]),ctx,{"else":body_18,"block":body_19},{}).w("</div></div> </div><hr><div class=\"row\"><div class=\"col-12\"><div class=\"myBorder-left\"><label> Abstract </label><div class=\"padding-left-15\">There is no abstract for this session.</div></div> </div></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\"><form action=\"https://icat.esrf.fr/#/browse/facility/ESRF/proposal/").f(ctx.getPath(false, ["data","proposalNumber"]),ctx,"h").w("/investigation/").f(ctx.getPath(false, ["data","investigationId"]),ctx,"h").w("/dataset\" target=\"_blank\"><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("<div class=\"padding-left-15\"> Not available</div>");}body_8.__dustBody=!0;function body_9(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","proposalNumber"]),ctx,"h").w("</div>");}body_9.__dustBody=!0;function body_10(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_10.__dustBody=!0;function body_11(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","mintingYear"]),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.h("eq",ctx,{"else":body_14,"block":body_15},{"key":ctx.getPath(false, ["data","beamlineUrl"]),"value":"noLink"},"h");}body_13.__dustBody=!0;function body_14(chk,ctx){return chk.w("<div class=\"padding-left-15\"><a href=\"").f(ctx.getPath(false, ["data","beamlineUrl"]),ctx,"h").w("\" target=\"_blank\"> ").f(ctx.getPath(false, ["data","beamline"]),ctx,"h").w(" </a></div>");}body_14.__dustBody=!0;function body_15(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","beamline"]),ctx,"h").w("</div>");}body_15.__dustBody=!0;function body_16(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_16.__dustBody=!0;function body_17(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","sessionDate"]),ctx,"h").w("</div>");}body_17.__dustBody=!0;function body_18(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_18.__dustBody=!0;function body_19(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","proposalType"]),ctx,"h").w("</div>");}body_19.__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","creator"]),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 class=\"row\" id=\"metadata\"></div><hr><div class=\"row\"><div class=\"col-12\"><div class=\"myBorder-left\"><label> Abstract </label><div class=\"padding-left-15\">There is no abstract for this session.</div></div> </div></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\"><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\"><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;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, ["data","ES_RESOURCE_TYPE"])},"h").w(" ").h("eq",ctx,{"block":body_14},{"key":ctx.getPath(false, ["data","resourceType"]),"value":ctx.getPath(false, ["data","DC_RESOURCE_TYPE"])},"h").w(" ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("<div class=\"col\"><div class=\"myBorder-left\"><label> Proposal </label>").x(ctx.getPath(false, ["data","proposalName"]),ctx,{"else":body_2,"block":body_3},{}).w("</div></div><div class=\"col\"><div class=\"myBorder-left\"><label> Publication year </label>").x(ctx.getPath(false, ["data","mintingYear"]),ctx,{"else":body_4,"block":body_5},{}).w("</div></div><div class=\"col\"><div class=\"myBorder-left\"><label> Beamline </label> ").x(ctx.getPath(false, ["data","beamline"]),ctx,{"else":body_6,"block":body_7},{}).w("</div></div><div class=\"col\"><div class=\"myBorder-left\"><label> Session date </label>").x(ctx.getPath(false, ["data","sessionDate"]),ctx,{"else":body_10,"block":body_11},{}).w("</div></div> <div class=\"col-4\"><div class=\"myBorder-left\"><label>Category </label>").x(ctx.getPath(false, ["data","proposalType"]),ctx,{"else":body_12,"block":body_13},{}).w("</div></div> ");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","proposalName"]),ctx,"h").w("</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","mintingYear"]),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.h("eq",ctx,{"else":body_8,"block":body_9},{"key":ctx.getPath(false, ["data","beamlineUrl"]),"value":"noLink"},"h");}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.w("<div class=\"padding-left-15\"><a href=\"").f(ctx.getPath(false, ["data","beamlineUrl"]),ctx,"h").w("\" target=\"_blank\"> ").f(ctx.getPath(false, ["data","beamline"]),ctx,"h").w(" </a></div>");}body_8.__dustBody=!0;function body_9(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","beamline"]),ctx,"h").w("</div>");}body_9.__dustBody=!0;function body_10(chk,ctx){return chk.w("<div class=\"padding-left-15\"> Not available</div>");}body_10.__dustBody=!0;function body_11(chk,ctx){return chk.w("<div class=\"padding-left-15\">").f(ctx.getPath(false, ["data","sessionDate"]),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","proposalType"]),ctx,"h").w("</div>");}body_13.__dustBody=!0;function body_14(chk,ctx){return chk.w("<div class=\"container-fluid\"><div class=\"row\"><div class=\"col-sm-3\"><div class=\"myBorder-left\">").h("proposalBeamLineTable",ctx,{"block":body_15},{"proposals":ctx.getPath(false, ["data","proposalName"]),"beamlines":ctx.getPath(false, ["data","beamline"])},"h").w("</div></div><div class=\"col-sm-9\">le reste</div></div></div>");}body_14.__dustBody=!0;function body_15(chk,ctx){return chk;}body_15.__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;\">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 padding-left-0\"> <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
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli 'grunt-insert',
1 verbose cli '--save' ]
2 info using npm@1.4.21
3 info using node@v0.10.29
4 warn package.json doi-landing-page@0.0.0 No description
5 warn package.json doi-landing-page@0.0.0 No README data
6 verbose readDependencies using package.json deps
7 verbose cache add [ 'grunt-insert', null ]
8 verbose cache add name=undefined spec="grunt-insert" args=["grunt-insert",null]
9 verbose parsed url { protocol: null,
9 verbose parsed url slashes: null,
9 verbose parsed url auth: null,
9 verbose parsed url host: null,
9 verbose parsed url port: null,
9 verbose parsed url hostname: null,
9 verbose parsed url hash: null,
9 verbose parsed url search: null,
9 verbose parsed url query: null,
9 verbose parsed url pathname: 'grunt-insert',
9 verbose parsed url path: 'grunt-insert',
9 verbose parsed url href: 'grunt-insert' }
10 silly lockFile 6a16fb4d-grunt-insert grunt-insert
11 verbose lock grunt-insert /users/demariaa/.npm/6a16fb4d-grunt-insert.lock
12 silly lockFile 6a16fb4d-grunt-insert grunt-insert
13 silly lockFile 6a16fb4d-grunt-insert grunt-insert
14 verbose addNamed [ 'grunt-insert', '' ]
15 verbose addNamed [ null, '*' ]
16 silly lockFile e2629ca7-grunt-insert grunt-insert@
17 verbose lock grunt-insert@ /users/demariaa/.npm/e2629ca7-grunt-insert.lock
18 silly addNameRange { name: 'grunt-insert', range: '*', hasData: false }
19 verbose request where is /grunt-insert
20 verbose request registry https://registry.npmjs.org/
21 verbose request id b08254c7f12aca69
22 verbose url raw /grunt-insert
23 verbose url resolving [ 'https://registry.npmjs.org/', './grunt-insert' ]
24 verbose url resolved https://registry.npmjs.org/grunt-insert
25 verbose request where is https://registry.npmjs.org/grunt-insert
26 info trying registry request attempt 1 at 15:07:13
27 verbose etag "52aa504a-1a9d"
28 http GET https://registry.npmjs.org/grunt-insert
29 http 304 https://registry.npmjs.org/grunt-insert
30 silly registry.get cb [ 304,
30 silly registry.get { date: 'Wed, 13 Dec 2017 14:07:14 GMT',
30 silly registry.get via: '1.1 varnish',
30 silly registry.get 'cache-control': 'max-age=300',
30 silly registry.get etag: '"52aa504a-1a9d"',
30 silly registry.get age: '35',
30 silly registry.get connection: 'keep-alive',
30 silly registry.get 'x-served-by': 'cache-cdg8721-CDG',
30 silly registry.get 'x-cache': 'HIT',
30 silly registry.get 'x-cache-hits': '1',
30 silly registry.get 'x-timer': 'S1513174034.009346,VS0,VE1',
30 silly registry.get vary: 'Accept-Encoding, Accept' } ]
31 verbose etag https://registry.npmjs.org/grunt-insert from cache
32 silly addNameRange number 2 { name: 'grunt-insert', range: '*', hasData: true }
33 silly addNameRange versions [ 'grunt-insert', [ '0.1.0' ] ]
34 verbose addNamed [ 'grunt-insert', '0.1.0' ]
35 verbose addNamed [ '0.1.0', '0.1.0' ]
36 silly lockFile 59aac559-grunt-insert-0-1-0 grunt-insert@0.1.0
37 verbose lock grunt-insert@0.1.0 /users/demariaa/.npm/59aac559-grunt-insert-0-1-0.lock
38 silly lockFile 59aac559-grunt-insert-0-1-0 grunt-insert@0.1.0
39 silly lockFile 59aac559-grunt-insert-0-1-0 grunt-insert@0.1.0
40 silly lockFile e2629ca7-grunt-insert grunt-insert@
41 silly lockFile e2629ca7-grunt-insert grunt-insert@
42 silly resolved [ { name: 'grunt-insert',
42 silly resolved description: 'Insert code from one file into another.',
42 silly resolved version: '0.1.0',
42 silly resolved homepage: 'https://github.com/grunt-insert',
42 silly resolved author:
42 silly resolved { name: 'Jamie Popkin',
42 silly resolved email: 'popkinj@littleearth.ca',
42 silly resolved url: 'http://littleearth.ca' },
42 silly resolved repository: { type: 'git', url: 'git://github.com/grunt-insert' },
42 silly resolved bugs: { url: 'https://github.com/grunt-insert/issues' },
42 silly resolved licenses: [ [Object] ],
42 silly resolved main: 'Gruntfile.js',
42 silly resolved engines: { node: '>= 0.8.0' },
42 silly resolved scripts: { test: 'grunt test' },
42 silly resolved devDependencies:
42 silly resolved { 'grunt-contrib-jshint': '~0.6.0',
42 silly resolved 'grunt-contrib-clean': '~0.4.0',
42 silly resolved 'grunt-contrib-nodeunit': '~0.2.0',
42 silly resolved grunt: '~0.4.1' },
42 silly resolved peerDependencies: { grunt: '~0.4.1' },
42 silly resolved keywords: [ 'gruntplugin', 'insert', 'build', 'merge', 'concatenate' ],
42 silly resolved readme: '# grunt-insert\n\n> Insert code from one file into another.\n\nUseful when you want to build a single file containing everything it needs for initial rendering. Such as on mobile, where the number of requests directly effects user experience.\nAt the moment it only overwrites the destination file. So be careful to consider that in the build process.\n\n## Getting Started\nThis plugin requires Grunt `~0.4.1`\n\nIf you haven\'t used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you\'re familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-insert --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks(\'grunt-insert\');\n```\n\n## The "insert" task\n\n### Overview\nIn your project\'s Gruntfile, add a section named `insert` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n insert: {\n options: {\n // Task-specific options go here.\n },\n your_target: {\n // Target-specific file lists and/or options go here.\n },\n },\n});\n```\n\n### Options\n\n**This doesn\'t exist yet.**\n#### options.backup\nType: `Boolean`\nDefault value: false\n\nAll for a backup file to be written for each build. It stores the original file before any and all injections.\n\n### Usage Examples\n\n#### Default Options\nIn this example the javascript is contained in a separate file for development purposes. Then stuffed in the *script* tag of the html file.\n\n```js\ngrunt.initConfig({\n insert: {\n options: {},\n\t main: {\n\t\tsrc: "lib/js/stuff.js",\n\t\tdest: "dist/html/index.html",\n\t\tmatch: "//Stuff it here"\n\t},\n },\n});\n```\n\nThen in the destination file ,*index.html*, make sure you place the *match* string wherever you want source code to be placed. It could look something like this\n```html\n<!doctype html>\n<html>\n\t<head>\n\t\t<script>\n\t\t\t//Stuff it here\n\t\t</script>\n\t</head>\n\t<body>\n\t\tBlah blah.\n\t</body>\n</html>\n```\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n_(Nothing yet)_\n',
42 silly resolved readmeFilename: 'README.md',
42 silly resolved _id: 'grunt-insert@0.1.0',
42 silly resolved dist:
42 silly resolved { shasum: '3b2d2b1728db73a3c173f27ae15c0e7034be3221',
42 silly resolved tarball: 'https://registry.npmjs.org/grunt-insert/-/grunt-insert-0.1.0.tgz' },
42 silly resolved _from: 'grunt-insert@',
42 silly resolved _npmVersion: '1.3.1',
42 silly resolved _npmUser: { name: 'popkinj', email: 'popkinj@littleearth.ca' },
42 silly resolved maintainers: [ [Object] ],
42 silly resolved directories: {},
42 silly resolved _shasum: '3b2d2b1728db73a3c173f27ae15c0e7034be3221',
42 silly resolved _resolved: 'https://registry.npmjs.org/grunt-insert/-/grunt-insert-0.1.0.tgz' } ]
43 info install grunt-insert@0.1.0 into /opt2/apache-tomcat-7.0.67/webapps/doi-landing-page
44 info installOne grunt-insert@0.1.0
45 verbose node_modules/grunt-insert unbuild
46 info preuninstall grunt-insert@0.1.0
47 info uninstall grunt-insert@0.1.0
48 verbose true,/opt2/apache-tomcat-7.0.67/webapps/doi-landing-page/node_modules,/opt2/apache-tomcat-7.0.67/webapps/doi-landing-page/node_modules unbuild grunt-insert@0.1.0
49 info postuninstall grunt-insert@0.1.0
50 verbose tar unpack /users/demariaa/.npm/grunt-insert/0.1.0/package.tgz
51 silly lockFile 5e01aa29-g-page-node-modules-grunt-insert tar:///opt2/apache-tomcat-7.0.67/webapps/doi-landing-page/node_modules/grunt-insert
52 verbose lock tar:///opt2/apache-tomcat-7.0.67/webapps/doi-landing-page/node_modules/grunt-insert /users/demariaa/.npm/5e01aa29-g-page-node-modules-grunt-insert.lock
53 silly lockFile ae01df02-m-grunt-insert-0-1-0-package-tgz tar:///users/demariaa/.npm/grunt-insert/0.1.0/package.tgz
54 verbose lock tar:///users/demariaa/.npm/grunt-insert/0.1.0/package.tgz /users/demariaa/.npm/ae01df02-m-grunt-insert-0-1-0-package-tgz.lock
55 silly gunzTarPerm modes [ '755', '644' ]
56 silly gunzTarPerm extractEntry package.json
57 silly gunzTarPerm extractEntry .npmignore
58 silly gunzTarPerm extractEntry README.md
59 silly gunzTarPerm extractEntry Gruntfile.js
60 silly gunzTarPerm extractEntry .jshintrc
61 silly gunzTarPerm extractEntry LICENSE-MIT
62 silly gunzTarPerm extractEntry tasks/insert.js
63 silly gunzTarPerm extractEntry test/injector_test.js
64 silly gunzTarPerm extractEntry test/expected/custom_options
65 silly gunzTarPerm extractEntry test/expected/default_options
66 silly gunzTarPerm extractEntry test/fixtures/123
67 silly gunzTarPerm extractEntry test/fixtures/testing
68 silly lockFile 5e01aa29-g-page-node-modules-grunt-insert tar:///opt2/apache-tomcat-7.0.67/webapps/doi-landing-page/node_modules/grunt-insert
69 silly lockFile 5e01aa29-g-page-node-modules-grunt-insert tar:///opt2/apache-tomcat-7.0.67/webapps/doi-landing-page/node_modules/grunt-insert
70 silly lockFile ae01df02-m-grunt-insert-0-1-0-package-tgz tar:///users/demariaa/.npm/grunt-insert/0.1.0/package.tgz
71 silly lockFile ae01df02-m-grunt-insert-0-1-0-package-tgz tar:///users/demariaa/.npm/grunt-insert/0.1.0/package.tgz
72 info preinstall grunt-insert@0.1.0
73 verbose readDependencies using package.json deps
74 verbose readDependencies using package.json deps
75 silly resolved []
76 verbose about to build /opt2/apache-tomcat-7.0.67/webapps/doi-landing-page/node_modules/grunt-insert
77 info build /opt2/apache-tomcat-7.0.67/webapps/doi-landing-page/node_modules/grunt-insert
78 verbose linkStuff [ false,
78 verbose linkStuff false,
78 verbose linkStuff false,
78 verbose linkStuff '/opt2/apache-tomcat-7.0.67/webapps/doi-landing-page/node_modules' ]
79 info linkStuff grunt-insert@0.1.0
80 verbose linkBins grunt-insert@0.1.0
81 verbose linkMans grunt-insert@0.1.0
82 verbose rebuildBundles grunt-insert@0.1.0
83 info install grunt-insert@0.1.0
84 info postinstall grunt-insert@0.1.0
85 verbose readDependencies using package.json deps
86 verbose already installed skipping grunt@~0.4.1 /opt2/apache-tomcat-7.0.67/webapps/doi-landing-page
87 silly resolved []
88 error peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements!
88 error peerinvalid Peer grunt-contrib-jshint@1.1.0 wants grunt@>=0.4.0
88 error peerinvalid Peer grunt-dustjs@1.4.0 wants grunt@>=0.4.0
88 error peerinvalid Peer grunt-wiredep@3.0.1 wants grunt@>=0.4.0
88 error peerinvalid Peer grunt-insert@0.1.0 wants grunt@~0.4.1
89 error System Linux 4.8.0-0.bpo.2-amd64
90 error command "/usr/bin/nodejs" "/usr/bin/npm" "install" "grunt-insert" "--save"
91 error cwd /opt2/apache-tomcat-7.0.67/webapps/doi-landing-page
92 error node -v v0.10.29
93 error npm -v 1.4.21
94 error code EPEERINVALID
95 verbose exit [ 1, true ]
{
"name": "doi-landing-page",
"jest": {
"rootDir": "tests"
},
"version": "0.0.0",
"description": "",
"main": "Gruntfile.js",
"dependencies": {
"grunt": "^1.0.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-uglify": "^3.2.1",
"grunt-contrib-watch": "^1.0.0",
"grunt-dust": "^0.9.4",
"grunt-dustjs": "^1.4.0",
"grunt-wiredep": "^3.0.1"
},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-cssmin": "^2.2.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-include-source": "^1.1.0",
"grunt-plato": "^1.4.0",
"jest": "^23.6.0"
},
"scripts": {
"test": "jest --watchAll"
},
"repository": {
"type": "git",
"url": "git@gitlab.esrf.fr:icat/doi-landing-page.git"
},
"author": "",
"license": "ISC"
}
\ No newline at end of file
"name": "doi-landing-page",
"version": "0.0.0",
"description": "",
"main": "Gruntfile.js",
"dependencies": {
"grunt": "^1.0.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-uglify": "^3.2.1",
"grunt-contrib-watch": "^1.0.0",
"grunt-dust": "^0.9.4",
"grunt-dustjs": "^1.4.0",
"grunt-wiredep": "^3.0.1"
},
"devDependencies": {
"browserify": "^16.2.3",
"grunt": "^1.0.1",
"grunt-contrib-cssmin": "^2.2.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-include-source": "^1.1.0",
"grunt-plato": "^1.4.0",
"jasmine-core": "^3.2.1",
"karma": "^3.0.0",
"karma-browserify": "^5.3.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.1.0",
"karma-jasmine": "^1.1.2",
"watchify": "^3.11.0"
},
"scripts": {
"test": "./node_modules/jest/bin/jest.js"
},
"repository": {
"type": "git",
"url": "git@gitlab.esrf.fr:icat/doi-landing-page.git"
},
"author": "",
"license": "ISC"
}
var CONSTANTS = {
ES_RESOURCE_TYPE : "experimental session resource type",
DC_RESOURCE_TYPE : "dataset collection resource type"
};
//module.exports = CONSTANTS;
......@@ -3,6 +3,7 @@ function DoiData() {
}
/**
* Get the accessibility status
* @param {string} resourceType the resource type for this DOI
* @param {string} sessionDate The timeStamp the experiment was started
* @param {string} publiclyAccessibleYear The year the data will be publicly accesssible.
* @return {string}
......@@ -10,19 +11,24 @@ function DoiData() {
* "Restricted access" : the data is still under embargo. Only accessible to experimental team members
*
* */
DoiData.prototype.getAccessibilityStatus = function( sessionDate, publiclyAccessibleYear ) {
DoiData.prototype.getAccessibilityStatus = function (resourceType, sessionDate, publiclyAccessibleYear) {
if (resourceType) {
if (resourceType === CONSTANTS.ES_RESOURCE_TYPE) {
if (publiclyAccessibleYear && sessionDate) {
var publiclyAvailableDate = moment(publiclyAccessibleYear, "YYYY");
var now = moment();