Skip to content

Commit

Permalink
Merge 8c9dd83 into 0818875
Browse files Browse the repository at this point in the history
  • Loading branch information
oscargus committed Jan 13, 2016
2 parents 0818875 + 8c9dd83 commit 2667819
Show file tree
Hide file tree
Showing 28 changed files with 27 additions and 90 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ to [sourceforge feature requests](https://sourceforge.net/p/jabref/features/) by
### Changed

### Fixed
- Fixed [#666](https://github.com/JabRef/jabref/issues/666): MS Office 2007 export is working again

### Removed

- Fixed [#627](https://github.com/JabRef/jabref/issues/627): The pdf field is removed from the export formats, use the file field



Expand Down Expand Up @@ -45,9 +46,6 @@ to [sourceforge feature requests](https://sourceforge.net/p/jabref/features/) by

### Fixed
- Changes in customized entry types are now directly reflected in the table when clicking "Apply" or "OK"
- Fixed [#593](https://github.com/JabRef/jabref/issues/593): Reference list generation works for OpenOffice/LibreOffice again
- Fixed [#545](https://github.com/JabRef/jabref/issues/545): ACM fetcher works again
- Fixed [#598](https://github.com/JabRef/jabref/issues/598): Use default file icon for custom external file types
- Fixed [#608](https://github.com/JabRef/jabref/issues/608): Export works again
- Fixed [#417](https://github.com/JabRef/jabref/issues/417): Table now updates when switching groups
- Fixed [#534](https://github.com/JabRef/jabref/issues/534): No OpenOffice setup panel in preferences
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/net/sf/jabref/exporter/ExportFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void performExport(final BibDatabase database,
// Set a global field, so all layouts have access to the custom name formatters:
Globals.prefs.customExportNameFormatters = readFormatterFile(lfFileName);

ArrayList<String> missingFormatters = new ArrayList<>(1);
List<String> missingFormatters = new ArrayList<>(1);

// Print header
try (Reader reader = getReader(lfFileName + ".begin.layout")) {
Expand Down Expand Up @@ -235,7 +235,9 @@ public void performExport(final BibDatabase database,
}
if (defLayout != null) {
missingFormatters.addAll(defLayout.getMissingFormatters());
LOGGER.warn(defLayout.getMissingFormatters());
if (!missingFormatters.isEmpty()) {
LOGGER.warn(missingFormatters);
}
}
HashMap<String, Layout> layouts = new HashMap<>();
Layout layout;
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/net/sf/jabref/exporter/MSBibExportFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,9 @@ public void performExport(final BibDatabase database, final MetaData metaData, f
} catch (Exception e) {
throw new Error(e);
}
}
try {
finalizeSaveSession(ss);
} catch (SaveException ex) {
} catch (Exception ex) {
throw new IOException(ex.getMessage());
} catch (Exception e) {
throw new IOException(e.getMessage());
}
}
}
28 changes: 12 additions & 16 deletions src/main/java/net/sf/jabref/exporter/ModsExportFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,21 @@ public void performExport(final BibDatabase database, final MetaData metaData,
final String file,
final Charset encoding, Set<String> keySet) throws IOException {
SaveSession ss = getSaveSession(StandardCharsets.UTF_8, new File(file));
VerifyingWriter ps = ss.getWriter();
MODSDatabase md = new MODSDatabase(database, keySet);
try (VerifyingWriter ps = ss.getWriter()) {
MODSDatabase md = new MODSDatabase(database, keySet);

try {
DOMSource source = new DOMSource(md.getDOMrepresentation());
StreamResult result = new StreamResult(ps);
Transformer trans = TransformerFactory.newInstance().newTransformer();
trans.setOutputProperty(OutputKeys.INDENT, "yes");
trans.transform(source, result);
} catch (Exception e) {
throw new Error(e);
}

try {
try {
DOMSource source = new DOMSource(md.getDOMrepresentation());
StreamResult result = new StreamResult(ps);
Transformer trans = TransformerFactory.newInstance().newTransformer();
trans.setOutputProperty(OutputKeys.INDENT, "yes");
trans.transform(source, result);
} catch (Exception e) {
throw new Error(e);
}
finalizeSaveSession(ss);
} catch (SaveException ex) {
} catch (Exception ex) {
throw new IOException(ex.getMessage());
} catch (Exception e) {
throw new IOException(e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,16 @@ private static void exportOpenDocumentSpreadsheet(File file, BibDatabase databas
private static void exportOpenDocumentSpreadsheetXML(File tmpFile, BibDatabase database, Set<String> keySet) {
OpenDocumentRepresentation od = new OpenDocumentRepresentation(database, keySet);

try {
try (Writer ps = new OutputStreamWriter(new FileOutputStream(tmpFile), StandardCharsets.UTF_8)) {

DOMSource source = new DOMSource(od.getDOMrepresentation());
StreamResult result = new StreamResult(ps);
Transformer trans = TransformerFactory.newInstance().newTransformer();
trans.setOutputProperty(OutputKeys.INDENT, "yes");
trans.transform(source, result);
}
try (Writer ps = new OutputStreamWriter(new FileOutputStream(tmpFile), StandardCharsets.UTF_8)) {

DOMSource source = new DOMSource(od.getDOMrepresentation());
StreamResult result = new StreamResult(ps);
Transformer trans = TransformerFactory.newInstance().newTransformer();
trans.setOutputProperty(OutputKeys.INDENT, "yes");
trans.transform(source, result);
} catch (Exception e) {
throw new Error(e);
}

}

private static void addResourceFile(String name, String resource, ZipOutputStream out) throws IOException {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/resource/layout/bibtexml.layout
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
\begin{url} <bibtex:url>\format[XMLChars]{\url}</bibtex:url>\end{url}
\begin{doi} <bibtex:doi>\format[XMLChars]{\doi}</bibtex:doi>\end{doi}
\begin{eid} <bibtex:eid>\format[XMLChars]{\eid}</bibtex:eid>\end{eid}
\begin{pdf} <bibtex:pdf>\format[ResolvePDF,XMLChars]{\pdf}</bibtex:pdf>\end{pdf}
\begin{type} <bibtex:type>\format[XMLChars]{\type}</bibtex:type>\end{type}
\begin{crossref} <bibtex:crossref>\format[XMLChars]{\crossref}</bibtex:crossref>\end{crossref}
\begin{annote} <bibtex:annote>\format[XMLChars]{\annote}</bibtex:annote>\end{annote}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 article
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 book
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 booklet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 inbook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 incollection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 inproceedings
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/resource/layout/endnote/EndNote.layout
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 \entrytype
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 manual
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 mastersthesis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 misc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 phdthesis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 proceedings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 techreport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
%*
%L
%M
\format[ResolvePDF,WrapContent(%1 ,)]{\pdf}
\format[FileLink(pdf),WrapContent(%1 ,)]{\file}
%2 \comment
%3 unpublished
Expand Down
6 changes: 0 additions & 6 deletions src/main/resources/resource/layout/html.book.layout
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
</div>
\end{file}

\begin{pdf}
<div class="bibtex_pdf">
<a href="\format[ResolvePDF]{\pdf}">pdf</a>
</div>
\end{pdf}

\begin{url}
<div class="bibtex_url">
<a href="\url">url</a>
Expand Down
6 changes: 0 additions & 6 deletions src/main/resources/resource/layout/html.inbook.layout
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
</div>
\end{file}

\begin{pdf}
<div class="bibtex_pdf">
<a href="\format[ResolvePDF]{\pdf}">pdf</a>
</div>
\end{pdf}

\begin{url}
<div class="bibtex_url">
<a href="\url">url</a>
Expand Down
6 changes: 0 additions & 6 deletions src/main/resources/resource/layout/html.inproceedings.layout
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
</div>
\end{file}

\begin{pdf}
<div class="bibtex_pdf">
<a href="\format[ResolvePDF]{\pdf}">pdf</a>
</div>
\end{pdf}

\begin{url}
<div class="bibtex_url">
<a href="\url">url</a>
Expand Down
6 changes: 0 additions & 6 deletions src/main/resources/resource/layout/html.layout
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
</div>
\end{file}

\begin{pdf}
<div class="bibtex_pdf">
<a href="\format[ResolvePDF]{\pdf}">pdf</a>
</div>
\end{pdf}

\begin{url}
<div class="bibtex_url">
<a href="\url">url</a>
Expand Down
6 changes: 0 additions & 6 deletions src/main/resources/resource/layout/html.mastersthesis.layout
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
</div>
\end{file}

\begin{pdf}
<div class="bibtex_pdf">
<a href="\format[ResolvePDF]{\pdf}">pdf</a>
</div>
\end{pdf}

\begin{url}
<div class="bibtex_url">
<a href="\url">url</a>
Expand Down
6 changes: 0 additions & 6 deletions src/main/resources/resource/layout/html.phdthesis.layout
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
</div>
\end{file}

\begin{pdf}
<div class="bibtex_pdf">
<a href="\format[ResolvePDF]{\pdf}">pdf</a>
</div>
\end{pdf}

\begin{url}
<div class="bibtex_url">
<a href="\url">url</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
\format[GetOpenOfficeType]{\bibtextype},"\begin{isbn}\isbn\end{isbn}","\bibtexkey","\format[AuthorLastFirst,AuthorAndsReplacer]{\author}","\format[RemoveBrackets,RemoveWhitespace]{\title}","\journal",\volume,\number,"\month","\pages",\year,"\address","\note","\url","\booktitle","\chapter","\edition","\series","\format[AuthorLastFirst,AuthorAndsReplacer]{\editor}","\publisher","\begin{reporttype}\reporttype\end{reporttype}","\howpublished","\institution","\organization","\school","\annote","\format[Replace(\n, )]{\abstract}","\comment","\keywords","\format[ResolvePDF]{\pdf}","\key"
\format[GetOpenOfficeType]{\bibtextype},"\begin{isbn}\isbn\end{isbn}","\bibtexkey","\format[AuthorLastFirst,AuthorAndsReplacer]{\author}","\format[RemoveBrackets,RemoveWhitespace]{\title}","\journal",\volume,\number,"\month","\pages",\year,"\address","\note","\url","\booktitle","\chapter","\edition","\series","\format[AuthorLastFirst,AuthorAndsReplacer]{\editor}","\publisher","\begin{reporttype}\reporttype\end{reporttype}","\howpublished","\institution","\organization","\school","\annote","\format[Replace(\n, )]{\abstract}","\comment","\keywords","\format[FileLink(pdf)]{\file}","\key"

0 comments on commit 2667819

Please sign in to comment.