Skip to content

Commit

Permalink
Merge branch 'master' into directoryRenamePattern
Browse files Browse the repository at this point in the history
* master:
  Always use https for help files (JabRef#1615)
  Resolves JabRef#1613 Use Jabref default icon for uninstaller for now (JabRef#1616)
  Added more fields and fixed some issues (JabRef#1617)
  • Loading branch information
Siedlerchr committed Jul 23, 2016
2 parents 2134d98 + 0684f55 commit 4a5eaae
Show file tree
Hide file tree
Showing 25 changed files with 177 additions and 137 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Try to double click the `jar` file or execute the following command:

## Documentation

JabRef comes with an [online help](http://help.jabref.org/), accessed by pressing `F1` or clicking on a question mark icon.
JabRef comes with an [online help](https://help.jabref.org/), accessed by pressing `F1` or clicking on a question mark icon.
The help is are probably not exhaustive enough to satisfy everyone yet, but it should help sort out the most important issues about using the program.
If you choose languages other than English, some or all help pages may appear in your chosen languages.

Expand Down
7 changes: 5 additions & 2 deletions jabref.install4j
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</files>
<launchers>
<launcher name="JabRef" id="23" customizedId="" external="false" excludeFromMenu="false" unixMode="755" menuName="" icnsFile="./src/main/resources/icons/jabref.icns" customMacBundleIdentifier="false" macBundleIdentifier="" swtApp="false" fileset="" macBundleBinary="JavaApplicationStub" addMacEntitlements="false" macEntitlementsFile="" useCustomMacosExecutableName="false" customMacosExecutableName="">
<executable name="JabRef" type="1" iconSet="true" iconFile="./src/main/resources/icons/jabref.ico" executableDir="" redirectStderr="true" stderrFile="error.log" stderrMode="overwrite" redirectStdout="false" stdoutFile="output.log" stdoutMode="overwrite" failOnStderrOutput="true" executableMode="1" changeWorkingDirectory="true" workingDirectory="." singleInstance="false" serviceStartType="2" serviceDependencies="" serviceDescription="" jreLocation="" executionLevel="asInvoker" checkConsoleParameter="false" globalSingleInstance="false" singleInstanceActivate="true" dpiAware="false">
<executable name="JabRef" type="1" iconSet="true" iconFile="./src/main/resources/icons/jabref.ico" executableDir="" redirectStderr="true" stderrFile="error.log" stderrMode="overwrite" redirectStdout="false" stdoutFile="output.log" stdoutMode="overwrite" failOnStderrOutput="true" executableMode="1" changeWorkingDirectory="true" workingDirectory="." singleInstance="false" serviceStartType="2" serviceDependencies="" serviceDescription="" jreLocation="" executionLevel="asInvoker" checkConsoleParameter="true" globalSingleInstance="false" singleInstanceActivate="true" dpiAware="false">
<versionInfo include="true" fileVersion="${compiler:versionFourDots}" fileDescription="${compiler:sys.fullName}" legalCopyright="${compiler:sys.fullName}" internalName="${compiler:sys.fullName}" productName="" />
</executable>
<splashScreen show="false" width="0" height="0" bitmapFile="" windowsNative="false" textOverlay="false">
Expand Down Expand Up @@ -97,10 +97,13 @@
<customAttributes />
</autoUpdate>
<applications>
<application name="" id="installer" customizedId="" beanClass="com.install4j.runtime.beans.applications.InstallerApplication" enabled="true" commentSet="false" comment="" actionElevationType="none" fileset="" customIcnsFile="" customIcoFile="" macEntitlementsFile="" automaticLauncherIntegration="false" launchMode="startupFirstWindow" launchInNewProcess="false" launchSchedule="updateSchedule" allLaunchers="true">
<application name="" id="installer" customizedId="" beanClass="com.install4j.runtime.beans.applications.InstallerApplication" enabled="true" commentSet="false" comment="" actionElevationType="none" fileset="" customIcnsFile="./src/main/resources/icons/jabref.icns" customIcoFile="./src/main/resources/icons/jabref.ico" macEntitlementsFile="" automaticLauncherIntegration="false" launchMode="startupFirstWindow" launchInNewProcess="false" launchSchedule="updateSchedule" allLaunchers="true">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.applications.InstallerApplication">
<void property="useCustomIcon">
<boolean>true</boolean>
</void>
<void property="watermark">
<boolean>false</boolean>
</void>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sf/jabref/external/WriteXMPAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void run() {
List<File> files = new ArrayList<>();

// First check the (legacy) "pdf" field:
entry.getFieldOptional("pdf").ifPresent(pdf ->
entry.getFieldOptional(FieldName.PDF).ifPresent(pdf ->
FileUtil.expandFilename(pdf, panel.getBibDatabaseContext().getFileDirectory("pdf"))
.ifPresent(files::add));
// Then check the "file" field:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void actionPerformed(ActionEvent actionEvent) {
List<File> files = new ArrayList<>();

// First check the (legacy) "pdf" field:
entry.getFieldOptional("pdf").ifPresent(pdf -> FileUtil
entry.getFieldOptional(FieldName.PDF).ifPresent(pdf -> FileUtil
.expandFilename(pdf, panel.getBibDatabaseContext().getFileDirectory("pdf")).ifPresent(files::add));

// Then check the "file" field:
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/net/sf/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2059,10 +2059,6 @@ public void action() {

private class OpenURLAction implements BaseAction {

private static final String PS_FIELD = "ps";
private static final String PDF_FIELD = "pdf";


@Override
public void action() {
final List<BibEntry> bes = mainTable.getSelectedEntries();
Expand All @@ -2089,8 +2085,8 @@ public void action() {
for (int i = 0; i < tm.getRowCount(); i++) {
FileListEntry flEntry = tm.getEntry(i);
if (FieldName.URL.equalsIgnoreCase(flEntry.type.get().getName())
|| PS_FIELD.equalsIgnoreCase(flEntry.type.get().getName())
|| PDF_FIELD.equalsIgnoreCase(flEntry.type.get().getName())) {
|| FieldName.PS.equalsIgnoreCase(flEntry.type.get().getName())
|| FieldName.PDF.equalsIgnoreCase(flEntry.type.get().getName())) {
entry = flEntry;
break;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/sf/jabref/gui/FindUnlinkedFilesDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
import net.sf.jabref.model.EntryTypes;
import net.sf.jabref.model.database.BibDatabase;
import net.sf.jabref.model.entry.EntryType;
import net.sf.jabref.model.entry.FieldName;
import net.sf.jabref.preferences.JabRefPreferences;

import com.jgoodies.forms.builder.ButtonBarBuilder;
Expand Down Expand Up @@ -997,7 +998,7 @@ public void mousePressed(MouseEvent e) {
try {
JabRefDesktop.openExternalViewer(
JabRefGUI.getMainFrame().getCurrentBasePanel().getBibDatabaseContext(),
fnw.file.getAbsolutePath(), "pdf");
fnw.file.getAbsolutePath(), FieldName.PDF);
} catch (IOException e1) {
LOGGER.info("Error opening file", e1);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/sf/jabref/gui/GUIGlobals.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static void init() {
JLabel label;
label = new JLabel(IconTheme.JabRefIcon.PDF_FILE.getSmallIcon());
label.setToolTipText(Localization.lang("Open") + " PDF");
GUIGlobals.TABLE_ICONS.put("pdf", label);
GUIGlobals.TABLE_ICONS.put(FieldName.PDF, label);

label = new JLabel(IconTheme.JabRefIcon.WWW.getSmallIcon());
label.setToolTipText(Localization.lang("Open") + " URL");
Expand All @@ -109,15 +109,15 @@ public static void init() {

label = new JLabel(IconTheme.JabRefIcon.WWW.getSmallIcon());
label.setToolTipText(Localization.lang("Open") + " ArXiv URL");
GUIGlobals.TABLE_ICONS.put("eprint", label);
GUIGlobals.TABLE_ICONS.put(FieldName.EPRINT, label);

label = new JLabel(IconTheme.JabRefIcon.DOI.getSmallIcon());
label.setToolTipText(Localization.lang("Open") + " DOI " + Localization.lang("web link"));
GUIGlobals.TABLE_ICONS.put(FieldName.DOI, label);

label = new JLabel(IconTheme.JabRefIcon.FILE.getSmallIcon());
label.setToolTipText(Localization.lang("Open") + " PS");
GUIGlobals.TABLE_ICONS.put("ps", label);
GUIGlobals.TABLE_ICONS.put(FieldName.PS, label);

label = new JLabel(IconTheme.JabRefIcon.FOLDER.getSmallIcon());
label.setToolTipText(Localization.lang("Open folder"));
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/net/sf/jabref/gui/desktop/JabRefDesktop.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void openExternalViewer(BibDatabaseContext databaseContext, String
String initialFieldName) throws IOException {
String link = initialLink;
String fieldName = initialFieldName;
if ("ps".equals(fieldName) || "pdf".equals(fieldName)) {
if (FieldName.PS.equals(fieldName) || FieldName.PDF.equals(fieldName)) {
// Find the default directory for this field type:
List<String> dir = databaseContext.getFileDirectory(fieldName);

Expand All @@ -90,10 +90,10 @@ public static void openExternalViewer(BibDatabaseContext databaseContext, String
String[] split = file.get().getName().split("\\.");
if (split.length >= 2) {
if ("pdf".equalsIgnoreCase(split[split.length - 1])) {
fieldName = "pdf";
fieldName = FieldName.PDF;
} else if ("ps".equalsIgnoreCase(split[split.length - 1])
|| ((split.length >= 3) && "ps".equalsIgnoreCase(split[split.length - 2]))) {
fieldName = "ps";
fieldName = FieldName.PS;
}
}
} else if (FieldName.DOI.equals(fieldName)) {
Expand All @@ -103,7 +103,7 @@ public static void openExternalViewer(BibDatabaseContext databaseContext, String
}
// should be opened in browser
fieldName = FieldName.URL;
} else if ("eprint".equals(fieldName)) {
} else if (FieldName.EPRINT.equals(fieldName)) {
fieldName = FieldName.URL;

// Check to see if link field already contains a well formated URL
Expand All @@ -121,15 +121,15 @@ public static void openExternalViewer(BibDatabaseContext databaseContext, String
// In BasePanel.java, the exception is catched and a text output to the frame
// throw e;
}
} else if ("ps".equals(fieldName)) {
} else if (FieldName.PS.equals(fieldName)) {
try {
NATIVE_DESKTOP.openFile(link, "ps");
NATIVE_DESKTOP.openFile(link, FieldName.PS);
} catch (IOException e) {
LOGGER.error("An error occured on the command: " + link, e);
}
} else if ("pdf".equals(fieldName)) {
} else if (FieldName.PDF.equals(fieldName)) {
try {
NATIVE_DESKTOP.openFile(link, "pdf");
NATIVE_DESKTOP.openFile(link, FieldName.PDF);
} catch (IOException e) {
LOGGER.error("An error occured on the command: " + link, e);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sf/jabref/gui/help/HelpAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void setHelpFile(HelpFile urlPart) {

@Override
public void actionPerformed(ActionEvent e) {
String url = "http://help.jabref.org/" + Globals.prefs.get(JabRefPreferences.LANGUAGE) + "/" + helpPage.getPageName();
String url = "https://help.jabref.org/" + Globals.prefs.get(JabRefPreferences.LANGUAGE) + "/" + helpPage.getPageName();
JabRefDesktop.openBrowserShowPopup(url);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class MainTableFormat implements TableFormat<BibEntry> {
// These values are also used to put a heading into the table; see getColumnName(int)
private static final List<String> URL_FIRST = Arrays.asList(FieldName.URL, FieldName.DOI);
private static final List<String> DOI_FIRST = Arrays.asList(FieldName.DOI, FieldName.URL);
private static final List<String> ARXIV = Collections.singletonList("eprint");
private static final List<String> ARXIV = Collections.singletonList(FieldName.EPRINT);

private final BibDatabase database;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sf/jabref/importer/OAI2Handler.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void endElement(String uri, String localName, String qualifiedName) throw
if ("error".equals(qualifiedName)) {
throw new RuntimeException(content);
} else if ("id".equals(qualifiedName)) {
entry.setField("eprint", content);
entry.setField(FieldName.EPRINT, content);
} else if ("keyname".equals(qualifiedName)) {
keyname = content;
} else if ("forenames".equals(qualifiedName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException {
} else if ("UR".equals(entry.getKey()) || "AT".equals(entry.getKey())) {
String s = entry.getValue().toString().trim();
hm.put(s.startsWith("http://") || s.startsWith("ftp://") ? FieldName.URL
: "pdf", entry.getValue().toString());
: FieldName.PDF, entry.getValue().toString());
} else if ("C1".equals(entry.getKey())) {
comments.add("Custom1: "
+ entry.getValue());
Expand All @@ -180,7 +180,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException {
comments.add("Custom6: "
+ entry.getValue());
} else if ("DE".equals(entry.getKey())) {
hm.put("annote", entry
hm.put(FieldName.ANNOTE, entry
.getValue().toString());
} else if ("CA".equals(entry.getKey())) {
comments.add("Categories: "
Expand All @@ -190,7 +190,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException {
+ entry.getValue());
} else if ("SE".equals(entry.getKey()))
{
hm.put("chapter", entry
hm.put(FieldName.CHAPTER, entry
.getValue().toString());
//else if (entry.getKey().equals("AC"))
// hm.put("",entry.getValue().toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public ParserResult importEntries(String text) {
e.setField(FieldName.NUMBER, parser.getElementText());
} else if (FieldName.DOI.equals(ln)
|| FieldName.INSTITUTION.equals(ln)
|| "location".equals(ln)
|| FieldName.LOCATION.equals(ln)
|| FieldName.NUMBER.equals(ln)
|| FieldName.NOTE.equals(ln)
|| FieldName.TITLE.equals(ln)
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/sf/jabref/logic/cleanup/CleanupWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import net.sf.jabref.logic.journals.JournalAbbreviationLoader;
import net.sf.jabref.model.FieldChange;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.model.entry.FieldName;
import net.sf.jabref.preferences.JabRefPreferences;

public class CleanupWorker {
Expand Down Expand Up @@ -62,7 +63,7 @@ private List<CleanupJob> determineCleanupActions(CleanupPreset preset) {
List<CleanupJob> jobs = new ArrayList<>();

if (preset.isCleanUpUpgradeExternalLinks()) {
jobs.add(new UpgradePdfPsToFileCleanup(Arrays.asList("pdf", "ps")));
jobs.add(new UpgradePdfPsToFileCleanup(Arrays.asList(FieldName.PDF, FieldName.PS)));
}
if (preset.isCleanUpDOI()) {
jobs.add(new DoiCleanup());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public Document getDOMrepresentation() {
addTableCell(result, row, getField(e, FieldName.NOTE));
addTableCell(result, row, getField(e, FieldName.URL));
addTableCell(result, row, getField(e, FieldName.BOOKTITLE));
addTableCell(result, row, getField(e, "chapter"));
addTableCell(result, row, getField(e, FieldName.CHAPTER));
addTableCell(result, row, getField(e, FieldName.EDITION));
addTableCell(result, row, getField(e, FieldName.SERIES));
addTableCell(result, row, getField(e, FieldName.EDITOR));//new AuthorLastFirst().format(getField(e, FieldName.EDITOR_FIELD)));
Expand All @@ -180,7 +180,7 @@ public Document getDOMrepresentation() {
addTableCell(result, row, getField(e, FieldName.INSTITUTION));
addTableCell(result, row, getField(e, FieldName.ORGANIZATION));
addTableCell(result, row, getField(e, FieldName.SCHOOL));
addTableCell(result, row, getField(e, "annote"));
addTableCell(result, row, getField(e, FieldName.ANNOTE));
addTableCell(result, row, getField(e, "assignee"));
addTableCell(result, row, getField(e, "day"));
addTableCell(result, row, getField(e, "dayfiled"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ public Document getDOMrepresentation() {
addTableCell(result, row, new GetOpenOfficeType().format(e.getType()));
addTableCell(result, row, getField(e, FieldName.ADDRESS));
addTableCell(result, row, getField(e, "assignee"));
addTableCell(result, row, getField(e, "annote"));
addTableCell(result, row, getField(e, FieldName.ANNOTE));
addTableCell(result, row, getField(e, FieldName.AUTHOR));//new AuthorLastFirst().format(getField(e, FieldName.AUTHOR_FIELD)));
addTableCell(result, row, getField(e, FieldName.BOOKTITLE));
addTableCell(result, row, getField(e, "chapter"));
addTableCell(result, row, getField(e, FieldName.CHAPTER));
addTableCell(result, row, getField(e, "day"));
addTableCell(result, row, getField(e, "dayfiled"));
addTableCell(result, row, getField(e, FieldName.EDITION));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sf/jabref/logic/msbib/MSBibMapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class MSBibMapping {
bibtexToMSBib.put(FieldName.BOOKTITLE, "BookTitle");
//bibtexToMSBib.put(FieldName.BOOKTITLE, "ConferenceName");
//bibtexToMSBib.put(FieldName.PAGES, "Pages");
bibtexToMSBib.put("chapter", "ChapterNumber");
bibtexToMSBib.put(FieldName.CHAPTER, "ChapterNumber");
bibtexToMSBib.put(FieldName.JOURNAL, "JournalName");
bibtexToMSBib.put(FieldName.NUMBER, "Issue");
bibtexToMSBib.put(FieldName.SCHOOL, "Department");
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/net/sf/jabref/logic/xmp/XMPUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public static Optional<BibEntry> getBibtexEntryFromDublinCore(XMPSchemaDublinCor
*/
List<String> publishers = dcSchema.getPublishers();
if ((publishers != null) && !publishers.isEmpty()) {
entry.setField("publishers", String.join(" and ", publishers));
entry.setField(FieldName.PUBLISHER, String.join(" and ", publishers));
}

/**
Expand Down Expand Up @@ -667,7 +667,7 @@ private static void writeToDCSchema(XMPSchemaDublinCore dcSchema,
*
* Bibtex-Fields used: author
*/
if ("author".equals(field)) {
if (FieldName.AUTHOR.equals(field)) {
String authors = resolvedEntry.getField(field);
AuthorList list = AuthorList.parse(authors);

Expand Down Expand Up @@ -1009,7 +1009,7 @@ private static void writeDocumentInformation(PDDocument document,

if (useXmpPrivacyFilter && filters.contains(field)) {
// erase field instead of adding it
if ("author".equals(field)) {
if (FieldName.AUTHOR.equals(field)) {
di.setAuthor(null);
} else if (FieldName.TITLE.equals(field)) {
di.setTitle(null);
Expand All @@ -1023,7 +1023,7 @@ private static void writeDocumentInformation(PDDocument document,
continue;
}

if ("author".equals(field)) {
if (FieldName.AUTHOR.equals(field)) {
di.setAuthor(resolvedEntry.getField(FieldName.AUTHOR));
} else if (FieldName.TITLE.equals(field)) {
di.setTitle(resolvedEntry.getField(FieldName.TITLE));
Expand Down
Loading

0 comments on commit 4a5eaae

Please sign in to comment.