Skip to content

Commit 05fe7b0

Browse files
Merge branch 'rct-173' into 'main'
Add XML file to convert on export. See merge request plos/editorial_manager_transfer_service!5
2 parents ed84112 + 5bad272 commit 05fe7b0

1 file changed

Lines changed: 214 additions & 0 deletions

File tree

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
{% load settings text %}{# A template for encoding an submission.models.Article as JATS 1.2 #}{# Context: `article` `body` `include_declaration` `answer_fields` #}
2+
{% if include_declaration %}
3+
<?xml version="1.0" encoding="UTF-8"?>
4+
<!DOCTYPE article SYSTEM "JATS-archivearticle1-mathml3.dtd">
5+
{% endif %}
6+
{% if validation_error %}<!-- {{ validation_error }} -->{% endif %}
7+
<article
8+
article-type="{{ article.jats_article_type|default:'research-article' }}"
9+
dtd-version="1.2d1"
10+
xml:lang="{{ article.iso639_1_lang_code }}"
11+
xmlns:xlink="http://www.w3.org/1999/xlink"
12+
>
13+
<front>
14+
<journal-meta>
15+
<journal-id journal-id-type="publisher">{{ article.license.text }}</journal-id>
16+
<journal-title-group>
17+
<journal-title>{{ article.journal.name }}</journal-title>
18+
</journal-title-group>
19+
</journal-meta>
20+
<article-meta>
21+
<article-id pub-id-type="manuscript">{{ article.pk }}</article-id>
22+
{% if article.get_doi %}
23+
<article-id pub-id-type="doi">{{ article.get_doi }}</article-id>
24+
{% endif %}
25+
<article-categories>
26+
{% if article.section.jats_article_type %}
27+
<subj-group subj-group-type="Article Type">
28+
{% for item in article.section %}
29+
<subject id="atype-{{ item.id }}">{{ item.jats_article_type }}</subject>
30+
{% endfor %}
31+
</subj-group>
32+
{% endif %}
33+
{% if article.section.name %}
34+
<subj-group subj-group-type="Category">
35+
{% for item in article.section %}
36+
<subject>{{ item.name }}</subject>
37+
{% endfor %}
38+
</subj-group>
39+
{% endif %}
40+
</article-categories>
41+
<title-group>
42+
<article-title>{{ article.title }}</article-title>
43+
</title-group>
44+
<contrib-group>
45+
{% for item in article.frozen_authors_for_jats_contribs %}
46+
{% with author=item.author affiliations=item.affiliations %}
47+
<contrib contrib-type="author"{% if author.is_correspondence_author %} corresp="yes"{% endif %}>
48+
{% if author.order %}
49+
<role content-type="{{ author.order }}"/>
50+
{% endif %}
51+
{% if article.journal|setting:'use_credit' and author.credits.exists %}
52+
{% for credit_record in author.credits %}
53+
<role vocab="CRediT" vocab-term="{{ credit_record.get_role_display }}"/>
54+
{% endfor %}
55+
{% endif %}
56+
<name>
57+
<surname>{{ author.last_name }}</surname>
58+
<given-names>{{ author.given_names }}</given-names>
59+
{% if author.name_prefix %}
60+
<prefix>{{ author.name_prefix }}</prefix>
61+
{% endif %}
62+
</name>
63+
{% if author.orcid %}
64+
<contrib-id contrib-id-type="orcid"{% if author.orcid_uri %}
65+
authenticated="true"{% endif %}>{{ author.orcid }}
66+
</contrib-id>
67+
{% endif %}
68+
{% if author.email %}
69+
<email>{{ author.email }}</email>
70+
{% endif %}
71+
{% for affiliation in affiliations %}
72+
<xref ref-type="aff" rid="aff{{ forloop.parentloop.counter }}-{{ forloop.counter }}"/>
73+
{% endfor %}
74+
</contrib>
75+
{% if author.is_corporate %}
76+
<contrib contrib-type="author">
77+
<collab>{{ author.corporate_name }}</collab>
78+
</contrib>
79+
{% endif %}
80+
81+
{% for affiliation in affiliations %}
82+
<aff id="aff{{ forloop.parentloop.counter }}-{{ forloop.counter }}">
83+
{% if affiliation.organization.uri %}
84+
<institution-wrap>
85+
<institution>{{ affiliation.organization.name }}</institution>
86+
{% if affiliation.organization.ror_id %}
87+
<institution-id institution-id-type="ROR">
88+
{{ affiliation.organization.uri }}
89+
</institution-id>
90+
{% endif %}
91+
</institution-wrap>
92+
{% else %}
93+
<institution>{{ affiliation.organization.name }}</institution>
94+
{% endif %}
95+
{% if affiliation.organization.title %}
96+
<institution
97+
content-type="position">{{ affiliation.organization.title }}</institution>
98+
{% endif %}
99+
{% if affiliation.organization.department %}
100+
<institution
101+
content-type="dept">{{ affiliation.organization.department }}</institution>
102+
{% endif %}
103+
{% for addrline in affiliation.organization.location %}
104+
<addr-line content-type="addrline{{ forloop.counter }}">{{ addrline }}</addr-line>
105+
{% endfor %}
106+
{% if affiliation.organization.country %}
107+
<country specific-use="us">{{ affiliation.organization.country }}</country>
108+
{% endif %}
109+
</aff>
110+
{% endfor %}
111+
{% endwith %}
112+
{% endfor %}
113+
</contrib-group>
114+
{% if article.has_manuscript_file %}
115+
<ext-link specific-use="Manuscript" xlink:href="{{ article.pk }}.docx" xlink:title="Manuscript"/>
116+
{% endif %}
117+
{% if article.url %}
118+
<ext-link ext-link-type="uri" xlink:href="{{ article.url }}" xlink:title="Research dataset 1"/>
119+
{% endif %}
120+
121+
{% if article.date_submitted or article.date_accepted %}
122+
<history>
123+
{% if article.date_submitted %}
124+
<date date-type="received" iso-8601-date="{{ article.date_submitted|date:" Y-m-d" }}">
125+
<day>{{ article.date_submitted|date:"d" }}</day>
126+
<month>{{ article.date_submitted|date:"m" }}</month>
127+
<year>{{ article.date_submitted|date:"Y" }}</year>
128+
</date>
129+
{% endif %}
130+
{% if article.date_accepted %}
131+
<date date-type="accepted" iso-8601-date="{{ article.date_accepted|date:" Y-m-d" }}">
132+
<day>{{ article.date_accepted|date:"d" }}</day>
133+
<month>{{ article.date_accepted|date:"m" }}</month>
134+
<year>{{ article.date_accepted|date:"Y" }}</year>
135+
</date>
136+
{% endif %}
137+
</history>
138+
{% endif %}
139+
<abstract>{{ article.get_clean_abstract }}</abstract>
140+
{% if article.keywords.exists %}
141+
<kwd-group xml:lang="en">
142+
{% for keyword in article.keywords.all %}
143+
<kwd>{{ keyword.word }}</kwd>
144+
{% endfor %}
145+
</kwd-group>
146+
{% endif %}
147+
{% if article.funders.exists() %}
148+
<funding-group>
149+
{% for funder in article.funders.all %}
150+
<award-group>
151+
<funding-source>{{ funder.name }}
152+
{% if funder.fundref_id %}
153+
<named-content content-type="funder-id">{{ funder.fundref_id }}</named-content>
154+
{% endif %}
155+
</funding-source>
156+
{% if funder.funding_id %}
157+
<award-id>{{ funder.funding_id }}</award-id>
158+
{% endif %}
159+
{% if forloop.counter == 1 %}
160+
{% for author in article.frozen_authors_for_jats_contribs %}
161+
{% if author.is_correspondence_author and author.orcid %}
162+
<principal-award-recipient>
163+
<contrib-id contrib-id-type="orcid">{{ author.orcid }}</contrib-id>
164+
<name>
165+
<surname>{{ author.last_name }}</surname>
166+
<given-names>{{ author.given_names }}</given-names>
167+
</name>
168+
</principal-award-recipient>
169+
{% endif %}
170+
{% endfor %}
171+
{% endif %}
172+
</award-group>
173+
{% endfor %}
174+
</funding-group>
175+
{% endif %}
176+
177+
{% if article.data_figure_files.exists() %}
178+
<counts>
179+
<fig-count count="{{ article.data_figure_files.all().count() }}"/>
180+
</counts>
181+
{% endif %}
182+
{% if answer_fields %}
183+
<custom-meta-group>
184+
{% for field in answer_fields %}
185+
<custom-meta id="ques_{{ forloop.counter }}" specific-use="question">
186+
<meta-name>{{ field.field.name }}</meta-name>
187+
<meta-value>{{ field.answer }}</meta-value>
188+
</custom-meta>
189+
{% endfor %}
190+
</custom-meta-group>
191+
{% endif %}
192+
</article-meta>
193+
</front>
194+
{% if body %}
195+
<body>
196+
{% if article.data_figure_files %}
197+
{% for figure in article.data_figure_files %}
198+
<fig fig-type="color figure" specific-use="High_res_figure">
199+
<label>Figure {{ forloop.counter }}</label>
200+
<graphic xlink:href="{{ figure.name() }}"/>
201+
</fig>
202+
{% endfor %}
203+
{% endif %}
204+
205+
{% if article.supplementary_files %}
206+
{% for suppFile in article.supplementary_files %}
207+
<supplementary-material specific-use="supplementary_file" xlink:href="{{ suppFile }}">
208+
<label>Video {{ forloop.counter }}</label>
209+
</supplementary-material>
210+
{% endfor %}
211+
{% endif %}
212+
</body>
213+
{% endif %}
214+
</article>

0 commit comments

Comments
 (0)