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

New Sorting/Export preferences #1

Merged
merged 20 commits into from
Mar 12, 2014
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
bin
build.number
build/
nbproject/private/
src/resource/build.properties
src/windows/nsis/dist/
.gradle
jabref-launch4j.tmp
user.properties
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
# JabRef

JabRef is a graphical application for managing bibliographical data.

* Homepage: http://jabref.sourceforge.net/
* Development page: https://sourceforge.net/projects/jabref/
* Main git repository: `git://git.code.sf.net/p/jabref/code` / https://sourceforge.net/p/jabref/code/ci/master/tree/
* Development page: https://github.com/JabRef
* Main git repository: https://github.com/JabRef/jabref

This repository has been generated out of the old git repository at sourceforge.
The folder `jabref` of the old repository is now this repositry.
Although that changed **all** git commit ids, the advantage is to have a clean separation between plugins, the homepage and the code of JabRef.

### Bug tracker

The github tracker is the main bug tracker.

However, the "old" trackers at sourceforge still remain intact.

* Bugs: https://sourceforge.net/p/jabref/bugs/
* Feature Requests: https://sourceforge.net/p/jabref/feature-requests/

Do *not* file patches using https://sourceforge.net/p/jabref/patches/.
Just fork JabRef and create a pull request.

### Next Steps

There is a github mirror at https://github.com/JabRef/jabref. This repository is a rewrite of the original repository containing the `jabref` folder only. Although this changes **all** git commit ids, the advantage is to have a clean separation between plugins, the homepage and the code of JabRef.
* Change build system from `ant` to `gradle` to get rid of the binaries in the repository.
* Migrate the sourceforge wiki to github
* Fix bugs listed at https://sourceforge.net/p/jabref/bugs/.
6 changes: 3 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->

<!-- some version information -->
<property name="jabref.version" value="2.10dev" />
<property name="jabref.version.full" value="2.10.0.1" /> <!-- a version number with 4 places. Required by launch4j -->
<property name="jabref.year" value="2013" />
<property name="jabref.version" value="2.10" />
<property name="jabref.version.full" value="2.10.0.5" /> <!-- a version number with 4 places. Required by launch4j -->
<property name="jabref.year" value="2014" />
<property name="jabref.placeholder.version" value="@version@" />
<property name="jabref.placeholder.year" value="@year@" />
<!-- used by replace task -->
Expand Down
33 changes: 33 additions & 0 deletions src/help/RevisionHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,39 @@
<body>

<h1>Revision history</h1>
<h3>Version 2.10 (March 11th, 2014)</h3>
<div class="version_desc">
<ul>
<li>Made IEEEXploreFetcher author parsing work again.</li>
<li>Added a few more characters in the HTML/Unicode to LaTeX conversion.</li>
<li>Find unlinked files tool doesn't always use PDF content importer any more,
but the dialog opened when a file is dropped into JabRef</li>
<li>Uninstaller doesn't delete whole directory any more. Fixes bugs <a href="https://sourceforge.net/p/jabref/bugs/1142">1142</a>, <a href="https://sourceforge.net/p/jabref/bugs/1175">1175</a>, <a href="https://sourceforge.net/p/jabref/bugs/1212">1212</a>.</li>
</ul>
</div>

<h3>Version 2.10 beta 3 (February 12th, 2014)</h3>
<div class="version_desc">
<ul>
<li>Fix GoogleScholarFetcher (<a href="https://sourceforge.net/p/jabref/patches/207">patch 207</a>)</li>
<li>Line breaks in BibTeX fields (e.g., abstract and review) are now kept.</li>
<li>Fixed completeness indicator in main table for entries with crossrefs and either/or required fields.</li>
<li>Fixed [shorttitle] and [veryshorttitle] key generator markers, so they remove punctuation as described in the documentation.</li>
</ul>
</div>

<h3>Version 2.10 beta 2 (June 19th, 2013)</h3>
<div class="version_desc">
<ul>
<li>Patched Windows install script to avoid wrong placement of Start menu items.</li>
<li>Reintroduced right-click on type label in entry editor to change entry type.</li>
<li>Fixed compatibility issue with OpenOffice plugin.</li>
<li>Added Russian as language.</li>
<li>Fix for <a href="https://sourceforge.net/p/jabref/bugs/1160">bug 1160</a>: Certain DOI references with &ldquo;&lt;&rdquo; characters are not processed correctly (by Jonathan Powell).</li>
<li>Fix for <a href="https://sourceforge.net/p/jabref/bugs/1153">bug 1153</a>: Bug in user-specific file paths stored in @comment (by Thomas Arildsen).</li>
</ul>
</div>

<h3>2.10 beta</h3>
<ul>
<li>Applied fix for JStor fetcher (<a href="https://sourceforge.net/p/jabref/patches/202">patch 202</a> by Nicolas Brouard)</li>
Expand Down
52 changes: 26 additions & 26 deletions src/images/splash-release.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/java/net/sf/jabref/BibtexFields.java
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,19 @@ public static String[] getAllFieldNames()
{
return runtime.PUBLIC_FIELDS ;
}

/** returns an string-array with only private fieldnames */
public static String[] getAllPrivateFieldNames(){
Vector<String> pFields = new Vector<String>() ;
for (BibtexSingleField sField : runtime.fieldSet.values()){
if (sField.isPrivate()) {
pFields.add( sField.getFieldName() );
}
}
return pFields.toArray(new String[pFields.size()]);

}


/** returns the fieldname of the entry at index t */
public static String getFieldName( int t )
Expand Down
2 changes: 1 addition & 1 deletion src/java/net/sf/jabref/imports/GoogleScholarFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class GoogleScholarFetcher implements PreviewEntryFetcher {
final static String SEARCH_URL = URL_START+"/scholar?q="+QUERY_MARKER
+"&amp;hl=en&amp;btnG=Search";

final static Pattern BIBTEX_LINK_PATTERN = Pattern.compile("<a href=\"([^\"]*)\">[A-Za-z ]*BibTeX");
final static Pattern BIBTEX_LINK_PATTERN = Pattern.compile("<a href=\"([^\"]*)\"[^>]*>[A-Za-z ]*BibTeX");
final static Pattern TITLE_START_PATTERN = Pattern.compile("<div class=\"gs_ri\">");
final static Pattern LINK_PATTERN = Pattern.compile("<h3 class=\"gs_rt\"><a href=\"([^\"]*)\">");
final static Pattern TITLE_END_PATTERN = Pattern.compile("<div class=\"gs_fl\">");
Expand Down
14 changes: 13 additions & 1 deletion src/java/net/sf/jabref/imports/HTMLConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class HTMLConverter implements LayoutFormatter {
{"180", "acute", "\\{\\\\'\\{\\}\\}"}, // acute accent = spacing acute,
// U+00B4 ISOdia
{"181", "micro", "\\$\\\\mu\\$"}, // micro sign, U+00B5 ISOnum
{"", "mu", "\\$\\\\mu\\$"}, // micro sign, U+00B5 ISOnum
{"182", "para", "\\{\\\\P\\}"}, // pilcrow sign = paragraph sign,
// U+00B6 ISOnum
{"183", "middot", "\\$\\\\cdot\\$"}, // middle dot = Georgian comma
Expand Down Expand Up @@ -418,13 +419,14 @@ public class HTMLConverter implements LayoutFormatter {
// U+22A5 ISOtech
{"8901", "sdot", "\\$\\\\cdot\\$"}, // dot operator, U+22C5 ISOamsb
/* dot operator is NOT the same character as U+00B7 middle dot */
/* Miscellaneous Technical */
{"8968", "lceil", "\\$\\\\lceil\\$"}, // left ceiling = apl upstile,
// U+2308 ISOamsc
{"8969", "rceil", "\\$\\\\rceil\\$"}, // right ceiling, U+2309 ISOamsc
{"8970", "lfloor", "\\$\\\\lfloor\\$"}, // left floor = apl downstile,
// U+230A ISOamsc
{"8971", "rfloor", "\\$\\\\rfloor\\$"}, // right floor, U+230B ISOamsc

/* Miscellaneous Technical */
{"9001", "lang", "\\$\\\\langle\\$"}, // left-pointing angle bracket = bra,
// U+2329 ISOtech
/* lang is NOT the same character as U+003C 'less than'
Expand Down Expand Up @@ -557,6 +559,8 @@ public class HTMLConverter implements LayoutFormatter {
{"", "imath", "\\{\\\\i\\}"}, // Small i without the dot
{"321", "Lstrok", "\\{\\\\L\\}"}, // upper case l with stroke
{"322", "lstrok", "\\{\\\\l\\}"}, // lower case l with stroke
{"348", "Scirc", "\\{\\\\\\^\\{S\\}\\}"}, // upper case S with circumflex
{"349", "scirc", "\\{\\\\\\^\\{s\\}\\}"}, // lower case s with circumflex
{"370", "Uogon", "\\{\\\\k\\{U\\}\\}"}, // capital U with ogonek
{"371", "uogon", "\\{\\\\k\\{u\\}\\}"}, // small u with ogonek
{"381", "Zcaron", "\\{\\\\v\\{Z\\}\\}"}, // capital Z with caron
Expand Down Expand Up @@ -590,12 +594,15 @@ public class HTMLConverter implements LayoutFormatter {
{"8198", "", "\\\\hspace\\{0.167em\\}"}, // Six-Per-Em Space
{"8208", "hyphen", "-"}, // Hyphen
{"8229", "nldr", "\\.\\."}, // Double dots - en leader
{"8450", "complexes", "\\$\\\\mathbb\\{C\\}\\$"}, // double struck capital C -- requires e.g. amsfonts
{"8451", "", "\\$\\\\deg\\$\\{C\\}"}, // Degree Celsius
{"8459", "Hscr", "\\$\\\\mathcal\\{H\\}\\$"}, // script capital H -- possibly use \mathscr
{"8460", "Hfr", "\\$\\\\mathbb\\{H\\}\\$"}, // black letter capital H -- requires e.g. amsfonts
{"8466", "Lscr", "\\$\\\\mathcal\\{L\\}\\$"}, // script capital L -- possibly use \mathscr
{"8467", "ell", "\\{\\\\ell\\}"}, // script small l
{"8469", "naturals", "\\$\\\\mathbb\\{N\\}\\$"}, // double struck capital N -- requires e.g. amsfonts
{"8474", "Qopf", "\\$\\\\mathbb\\{Q\\}\\$"}, // double struck capital Q -- requires e.g. amsfonts
{"8477", "reals", "\\$\\\\mathbb\\{R\\}\\$"}, // double struck capital R -- requires e.g. amsfonts
{"8486", "", "\\$\\{\\\\Omega\\}\\$"}, // Omega
{"8491", "angst", "\\{\\\\AA\\}"}, // Angstrom
{"8496", "Escr", "\\$\\\\mathcal\\{E\\}\\$"}, // script capital E
Expand Down Expand Up @@ -631,6 +638,11 @@ public class HTMLConverter implements LayoutFormatter {
{"8883", "vrtri", "\\$\\\\triangleright\\$"}, // Right triangle
{"8896", "xwedge", "\\$\\\\bigwedge\\$"}, // Big wedge
{"8897", "xvee", "\\$\\\\bigvee\\$"}, // Big vee
{"8942", "vdots", "\\$\\\\vdots\\$"}, // vertical ellipsis U+22EE
{"8943", "cdots", "\\$\\\\cdots\\$"}, // midline horizontal ellipsis U+22EF
/*{"8944", "", "\\$\\\\ddots\\$"}, // up right diagonal ellipsis U+22F0 */
{"8945", "ddots", "\\$\\\\ddots\\$"}, // down right diagonal ellipsis U+22F1

{"9426", "circledc", "\\{\\\\copyright\\}"}, // circled small letter C
{"9633", "square", "\\$\\\\square\\$"}, // White square
{"9651", "xutri", "\\$\\\\bigtriangleup\\$"}, // White up-pointing big triangle
Expand Down
22 changes: 19 additions & 3 deletions src/java/net/sf/jabref/imports/IEEEXploreFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public class IEEEXploreFetcher implements EntryFetcher {

Pattern ieeeArticleNumberPattern = Pattern.compile("<a href=\".*arnumber=(\\d+).*\">");

Pattern authorPattern = Pattern.compile("<span id=\"preferredName\" class=\"(.*)\">");
// Common words in IEEE Xplore that should always be

public IEEEXploreFetcher() {
Expand All @@ -111,7 +112,8 @@ public IEEEXploreFetcher() {

fieldPatterns.put("title", "<a\\s*href=[^<]+>\\s*(.+)\\s*</a>");
//fieldPatterns.put("author", "</h3>\\s*(.+)");
fieldPatterns.put("author", "(?s)</h3>\\s*(.+)</br>");
//fieldPatterns.put("author", "(?s)</h3>\\s*(.+)</br>");
// fieldPatterns.put("author", "<span id=\"preferredName\" class=\"(.+)\">");
fieldPatterns.put("volume", "Volume:\\s*([A-Za-z-]*\\d+)");
fieldPatterns.put("number", "Issue:\\s*(\\d+)");
//fieldPatterns.put("part", "Part (\\d+),&nbsp;(.+)");
Expand Down Expand Up @@ -390,7 +392,7 @@ private BibtexEntry cleanup(BibtexEntry entry) {
}

// clean up author
String author = (String)entry.getField("author");
/* String author = (String)entry.getField("author");
if (author != null) {
if (author.indexOf("a href=") >= 0) { // Author parsing failed because it was empty
entry.setField("author",""); // Maybe not needed anymore due to another change
Expand All @@ -406,7 +408,7 @@ private BibtexEntry cleanup(BibtexEntry entry) {
author = author.replaceAll("[ ,;]+$", "");
entry.setField("author", author);
}
}
}*/
// clean up month
String month = (String)entry.getField("month");
if ((month != null) && (month.length() > 0)) {
Expand Down Expand Up @@ -702,6 +704,20 @@ private BibtexEntry parseNextEntry(String allText, int startIndex) {
}
}
}

Matcher authorMatcher = authorPattern.matcher(text);
// System.out.println(text);
StringBuffer authorNames = new StringBuffer("");
int authorCount=0;
while(authorMatcher.find()) {
if(authorCount >= 1) {
authorNames.append(" and ");
}
authorNames.append(htmlConverter.format(authorMatcher.group(1)));
//System.out.println(authorCount + ": " + authorMatcher.group(1));
authorCount++;
}
entry.setField("author",authorNames.toString());
if (entry.getField("author") == null || entry.getField("author").startsWith("a href") ||
entry.getField("author").startsWith("Topic(s)")) { // Fix for some documents without authors
entry.setField("author","");
Expand Down
4 changes: 2 additions & 2 deletions src/java/net/sf/jabref/sql/SQLUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.util.ListIterator;

import net.sf.jabref.BibtexFields;
import net.sf.jabref.Globals;

/**
*
Expand Down Expand Up @@ -62,6 +61,7 @@ public static void refreshFields() {
allFields.clear();
}
uniqueInsert(allFields, BibtexFields.getAllFieldNames());
uniqueInsert(allFields, BibtexFields.getAllPrivateFieldNames());
}

/**
Expand Down Expand Up @@ -108,12 +108,12 @@ private static ArrayList<String> uniqueInsert(ArrayList<String> list,
if (array != null) {
for (int i = 0; i < array.length; i++) {
if (!list.contains(array[i]))
if (!array[i].equals("#"))
list.add(array[i]);
}
}
return list;
}

/**
* Generates DML specifying table columns and their datatypes. The output of
* this routine should be used within a CREATE TABLE statement.
Expand Down
Loading