I recently worked on migrating a journal from an older self-coded platform to OJS3. Our editors would like to import all the older issues into our new OJS3-journal. So I was looking into the corresponding entry in the admin guide and the sample files provided there.
I couldn’t find any info on how to attach a cover image to an article in the sample files. However, the XML schema for OJS defines an element named cover (cf. lines 171-180):
Now I’m not the fittest when it comes to XML but I don’t quite get what the first element in the sequence does and what it should look like, but I understand it is required, right?
I tried to export already published articles that have cover images but the resulting XML didn’t feature them. And as expected, when I imported the XML file again, the articles where without covers.
Could you please give me an example of a well-formatted, OJS3-importable XML file of an article with a cover image (or an issue with many articles that each has a cover image) would look like? That would be really great!
Thanks for your reply and opening the GitHub Issue, @bozana !
Do you know if there is any further documentation on the import/export formats? The admin guide and the example files don’t really provide a lot of information on what the single elements do and how they should be used to achieve desired results (such as the cover element, but also, for example, seq elements and attributes).
Thankfully, the XML-import is not too strict and I managed to generate well(-enough)-formed and importable issue-files in a pretty straight-forward way
However, my institution’s OJS installation didn’t respond well to neither a <covers> nor <cover> sub-element of <article>. This is the error message the system returns multiple times (once for each article in the issue, I guess): Element '{http://pkp.sfu.ca}cover': This element is not expected. Expected is one of ( {http://pkp.sfu.ca}abstract, {http://pkp.sfu.ca}coverage, {http://pkp.sfu.ca}type, {http://pkp.sfu.ca}source, {http://pkp.sfu.ca}rights, {http://pkp.sfu.ca}licenseUrl, {http://pkp.sfu.ca}copyrightHolder, {http://pkp.sfu.ca}copyrightYear, {http://pkp.sfu.ca}keywords, {http://pkp.sfu.ca}agencies ).
I believe this is due to this installation’s native XML import/export plugin not yet featuring article covers, am I right?
Since I am only a journal manager in a multi-journal university-wide OJS installation to which I have no access, I wanted to ask:
if you can give an estimate on when the changes proposed in your GitHub issue will be released in an updated version - or is it possible to update only the native XML import/export plugin to feature article-covers? If so, I could ask the installation administrators to apply the plugin update, which can probably more easily do than an entire system update.
if you know of any other way to mass-import article-covers to already existing articles.
Hello @1Name,
I have worked out a working XML-file that imports external HTML-file along with their dependant images. Issue covers however is a problem, as they are only allowed in as a base64-encoded embed inside your XML-file.
Would you be interested in this?
In theory, without know your exact structure, you could export all of your articles into HTML and place images into a separate folder. Then link HTML as submission files, and images as supplementary files. All of them need a separate galley for import to work properly.
Th issue covers could be converted into base64 in you write up some sort of application in python / php / C# to build your XML-file. I use a custom XSD to generate a C# class that builds my XML, and then I use a Base64 conversion at the last step, as this generates a rather big load of text into the XML-file.
This is an example on how to convert an image to Base64,