Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ms Office Export patent author as inventor #7831

Merged
merged 1 commit into from
Jun 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

### Changed

- The export to MS Office XML now exports the author field as `Inventor` if the bibtex entry type is `patent` [#7830](https://github.com/JabRef/jabref/issues/7830)
- We changed the EndNote importer to import the field `label` to the corresponding bibtex field `endnote-label` [forum#2734](https://discourse.jabref.org/t/importing-endnote-label-field-to-jabref-from-xml-file/2734)
- The keywords added via "Manage content selectors" are now displayed in alphabetical order. [#3791](https://github.com/JabRef/jabref/issues/3791)
- We improved the "Find unlinked files" dialog to show import results for each file. [#7209](https://github.com/JabRef/jabref/pull/7209)
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/jabref/logic/msbib/MSBibConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ public static MSBibEntry convert(BibEntry entry) {
result.publicationTitle = entry.getLatexFreeField(StandardField.TITLE).orElse(null);
}

entry.getField(StandardField.AUTHOR).ifPresent(authors -> result.authors = getAuthors(entry, authors, StandardField.AUTHOR));
if (entry.getType().equals(IEEETranEntryType.Patent)) {
entry.getField(StandardField.AUTHOR).ifPresent(authors -> result.inventors = getAuthors(entry, authors, StandardField.AUTHOR));
} else {
entry.getField(StandardField.AUTHOR).ifPresent(authors -> result.authors = getAuthors(entry, authors, StandardField.AUTHOR));
}
entry.getField(StandardField.EDITOR).ifPresent(editors -> result.editors = getAuthors(entry, editors, StandardField.EDITOR));
entry.getField(StandardField.TRANSLATOR).ifPresent(translator -> result.translators = getAuthors(entry, translator, StandardField.EDITOR));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static void insertReferenceToPageNumberOfReferenceMark(XTextDocument doc,
try {
// specify that the source is a reference mark (could also be a footnote,
// bookmark or sequence field)
xFieldProps.setPropertyValue("ReferenceFieldSource", Short.valueOf(ReferenceFieldSource.REFERENCE_MARK));
xFieldProps.setPropertyValue("ReferenceFieldSource", Short.valueOf(ReferenceFieldSource.REFERENCE_MARK));
} catch (UnknownPropertyException ex) {
throw new java.lang.IllegalStateException("The created GetReference does not have property"
+ " 'ReferenceFieldSource'");
Expand All @@ -72,7 +72,7 @@ public static void insertReferenceToPageNumberOfReferenceMark(XTextDocument doc,

try {
// We want the reference displayed as page number
xFieldProps.setPropertyValue("ReferenceFieldPart", Short.valueOf(ReferenceFieldPart.PAGE));
xFieldProps.setPropertyValue("ReferenceFieldPart", Short.valueOf(ReferenceFieldPart.PAGE));
} catch (UnknownPropertyException ex) {
throw new java.lang.IllegalStateException("The created GetReference does not have property"
+ " 'ReferenceFieldPart'");
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/org/jabref/logic/exporter/MsBibPatent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<b:Title>The Vampire hunter</b:Title>
<b:Tag>Lincoln1978</b:Tag>
<b:Author>
<b:Author>
<b:Inventor>
<b:NameList>
<b:Person>
<b:Last>Lincoln</b:Last>
<b:First>Abraham</b:First>
</b:Person>
</b:NameList>
</b:Author>
</b:Inventor>
</b:Author>
<b:PatentNumber>12345677</b:PatentNumber>
</b:Source>
Expand Down