Commit 46a1f6c0 authored by Audrey Hamelers's avatar Audrey Hamelers
Browse files
parent aff2eb95
Pipeline #12795 passed with stages
in 5 minutes and 14 seconds
......@@ -167,22 +167,24 @@ function createManifest(tmpPath, manuscript) {
const isPublisher = identity.meta && identity.meta.publisher
const journalNlmId = manuscript.journal['meta,nlmuniqueid']
const files = getNcbiFiles(manuscript)
let text = `<?xml version="1.0"?>\n <!DOCTYPE pnihms-xdata PUBLIC "-//PNIHMS-EXCHANGE//DTD pNIHMS Exchange DTD//EN" "pnihms_exchange.dtd">\n
<pnihms-xdata mid="${getFilesPrefix(
manuscript,
)}" pubmed-id="${pmId}" pmc-id="${pmcId}" create-date="${createdDate}" publish-date="${publishDate}" pub-pdf="${hasPubPdf}" nlm-journal-id="${journalNlmId}"`
let text = `<?xml version="1.0"?>\n<!DOCTYPE pnihms-xdata PUBLIC "-//PNIHMS-EXCHANGE//DTD pNIHMS Exchange DTD//EN" "pnihms_exchange.dtd">\n
<pnihms-xdata mid="${getFilesPrefix(
manuscript,
)}" pubmed-id="${pmId}" pmc-id="${pmcId}" create-date="${createdDate}" publish-date="${publishDate}" pub-pdf="${hasPubPdf}" nlm-journal-id="${journalNlmId}"`
if (isPublisher) {
text += ` submitter-name="${subUser.givenNames} ${
subUser.surname
}" submitter-login="${isPublisher}" submitter-authority="publisher"`
}
text += `> \n<blobs>\n ${files.map(file => {
const { numeric } = ncbiFileTypes.find(type => type.value === file.type)
const fileMd5 = getFileMd5(`${tmpPath}/${file.filename}`)
return `<blob md5="${fileMd5}" name="${
file.filename
}" type="${numeric}" />\n`
})}</blobs>\n
text += `> \n<blobs>\n${files
.map(file => {
const { numeric } = ncbiFileTypes.find(type => type.value === file.type)
const fileMd5 = getFileMd5(`${tmpPath}/${file.filename}`)
return ` <blob md5="${fileMd5}" name="${
file.filename
}" type="${numeric}" />`
})
.join('\n')}</blobs>\n
</pnihms-xdata>`
return new Promise((resolve, reject) => {
......
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