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

Fix export of number + pubstate in OFFice XML #2514

Merged
merged 4 commits into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Redesigned journal abbreviations dialog.
- Redesigned error console.
- All file dialogs now use the native file selector of the OS. [#1711](https://github.com/JabRef/jabref/issues/1711)
- The MS-Office XML export now exports the field `volumes` and `pubstate`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing: This should be aligned with the other bullet points.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doen


### Fixed
- Repairs the handling of apostrophes in the LaTeX to unicode conversion. [#2500](https://github.com/JabRef/jabref/issues/2500)
- Fix import of journal title in ris format. [#2506](https://github.com/JabRef/jabref/issues/2506)

- We fixed the export of the `number` field in MS-Office XML export. [#2509](https://github.com/JabRef/jabref/issues/2509)
- The field `issue` is now always exported to the corresponding `issue` field in MS-Office XML.
### Removed


Expand Down
5 changes: 1 addition & 4 deletions src/main/java/net/sf/jabref/logic/msbib/MSBibConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class MSBibConverter {
private static final String MSBIB_PREFIX = "msbib-";
private static final String BIBTEX_PREFIX = "BIBTEX_";


public static MSBibEntry convert(BibEntry entry) {
MSBibEntry result = new MSBibEntry();

Expand Down Expand Up @@ -45,9 +44,7 @@ public static MSBibEntry convert(BibEntry entry) {
result.broadcastTitle = entry.getField(FieldName.TITLE).orElse(null);
}

if (!entry.getField(FieldName.ISSUE).isPresent()) {
result.number = entry.getField(FieldName.NUMBER).orElse(null);
}
result.number = entry.getField(FieldName.NUMBER).orElse(null);

if ("Patent".equalsIgnoreCase(entry.getType())) {
result.patentNumber = entry.getField(FieldName.NUMBER).orElse(null);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/net/sf/jabref/logic/msbib/MSBibEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ class MSBibEntry {
private static final Pattern DATE_PATTERN = Pattern
.compile("(\\d{1,2})\\s*[.,-/]\\s*(\\d{1,2})\\s*[.,-/]\\s*(\\d{2,4})");


public MSBibEntry() {
//empty
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/logic/msbib/MSBibMapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class MSBibMapping {
biblatexToMsBib.put(FieldName.BOOKTITLE, "BookTitle");
biblatexToMsBib.put("shorttitle", "ShortTitle");
biblatexToMsBib.put(FieldName.NOTE, "Comments");
biblatexToMsBib.put(FieldName.VOLUMES, "NumberVolumes");

//biblatexToMsBib.put(FieldName.BOOKTITLE, "ConferenceName");
//biblatexToMsBib.put(FieldName.PAGES, "Pages");
Expand All @@ -51,6 +52,7 @@ public class MSBibMapping {
biblatexToMsBib.put(FieldName.KEYWORDS, BIBTEX_PREFIX + "KeyWords");
biblatexToMsBib.put(FieldName.CROSSREF, BIBTEX_PREFIX + "CrossRef");
biblatexToMsBib.put(FieldName.HOWPUBLISHED, BIBTEX_PREFIX + "HowPublished");
biblatexToMsBib.put(FieldName.PUBSTATE, BIBTEX_PREFIX + "Pubstate");
biblatexToMsBib.put("affiliation", BIBTEX_PREFIX + "Affiliation");
biblatexToMsBib.put("contents", BIBTEX_PREFIX + "Contents");
biblatexToMsBib.put("copyright", BIBTEX_PREFIX + "Copyright");
Expand All @@ -61,7 +63,6 @@ public class MSBibMapping {
biblatexToMsBib.put(FieldName.KEY, BIBTEX_PREFIX + "Key");

// MSBib only fields
biblatexToMsBib.put(MSBIB_PREFIX + "numberofvolume", "NumberVolumes");
biblatexToMsBib.put(MSBIB_PREFIX + "periodical", "PeriodicalTitle");
biblatexToMsBib.put(MSBIB_PREFIX + FieldName.DAY, "Day");
biblatexToMsBib.put(MSBIB_PREFIX + "accessed", "Accessed");
Expand All @@ -79,7 +80,6 @@ public class MSBibMapping {
biblatexToMsBib.put(MSBIB_PREFIX + "productioncompany", "ProductionCompany");
}


public static String getBibLaTeXEntryType(String msbibType) {
final String defaultType = BibtexEntryTypes.MISC.getName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.xmlunit.diff.ElementSelectors;
import org.xmlunit.matchers.CompareMatcher;


@RunWith(Parameterized.class)
public class BibTeXMLExporterTestFiles {

Expand All @@ -50,7 +49,6 @@ public class BibTeXMLExporterTestFiles {
@Rule
public TemporaryFolder testFolder = new TemporaryFolder();


@Parameters(name = "{0}")
public static Collection<String> fileNames() throws IOException, URISyntaxException {
try (Stream<Path> stream = Files.list(Paths.get(BibTeXMLExporterTestFiles.class.getResource("").toURI()))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ @Unpublished{
msbib-day = {5},
msbib-distributor = {dist},
msbib-medium = {med},
msbib-numberofvolume = {10},
msbib-periodical = {peri},
msbib-productioncompany = {produktion},
msbib-recordingnumber = {record},
Expand All @@ -26,6 +25,7 @@ @Unpublished{
size = {1000},
sourcetype = {Interview},
timestamp = {2016.08.19},
volumes = {10}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, please align.

}

@Comment{jabref-meta: databaseType:biblatex;}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
% Encoding: UTF-8
@manual{raey,
author = {5},
journal = {Wirtschaftsinformatik},
Expand All @@ -12,3 +13,5 @@ @manual{raey
volume = {44},
year = {2002}
}

@Comment{jabref-meta: databaseType:bibtex;}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
% Encoding: UTF-8

@article{Orlowski;2011,
author = {Adam Czarnecki; Cezary Orłowski;},
title = {Application of Ontology In the ITIL Domain},
year = {2011},
publisher = {Oficyna Wydawnicza Politechniki Wrocławskiej},
pages = {99--108},
doi = {10.13140/2.1.3259.2169},
journal = {Information Systems Architecture and Technology: Service Oriented Networked Systems},
@Article{Orlowski;2011,
author = {Adam Czarnecki; Cezary Orłowski;},
title = {Application of Ontology In the ITIL Domain},
year = {2011},
pages = {99--108},
doi = {10.13140/2.1.3259.2169},
pubstate = {submitted},
journal = {Information Systems Architecture and Technology: Service Oriented Networked Systems},
publisher = {Oficyna Wydawnicza Politechniki Wrocławskiej},
}

@Comment{jabref-meta: databaseType:biblatex;}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml version="1.0" encoding="UTF-8"?>
<b:Sources xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" SelectedStyle="">
<b:Source>
<b:BIBTEX_Pubstate>submitted</b:BIBTEX_Pubstate>
<b:Year>2011</b:Year>
<b:BIBTEX_Entry>article</b:BIBTEX_Entry>
<b:SourceType>JournalArticle</b:SourceType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ @Article{
msbib-court = {court},
msbib-distributor = {dist},
msbib-medium = {med},
msbib-numberofvolume = {10},
msbib-periodical = {Besondere Turingmaschinen},
msbib-productioncompany = {produktion},
msbib-recordingnumber = {record},
Expand All @@ -20,6 +19,7 @@ @Article{
price = {10},
school = {Gymnasium Unterrieden},
size = {1000},
volumes = {10},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, please align.

}

@Comment{jabref-meta: databaseType:bibtex;}