New patch: disable mrDlib feature
authorgregor herrmann <gregoa@debian.org>
Mon, 29 Oct 2012 18:30:23 +0000 (19:30 +0100)
committergregor herrmann <gregoa@debian.org>
Mon, 29 Oct 2012 20:17:46 +0000 (21:17 +0100)
until we have all dependencies in Debian.

Thanks: Oliver Kopp (upstream) for providing a Debian branch.

debian/patches/mrDlib.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/mrDlib.patch b/debian/patches/mrDlib.patch
new file mode 100644 (file)
index 0000000..c51728e
--- /dev/null
@@ -0,0 +1,1288 @@
+--- a/src/java/net/sf/jabref/ImportSettingsTab.java
++++ b/src/java/net/sf/jabref/ImportSettingsTab.java
+@@ -44,10 +44,8 @@
+       
+     private JRadioButton radioButtonXmp;
+       private JRadioButton radioButtonPDFcontent;
+-    private JRadioButton radioButtonMrDlib;
+     private JRadioButton radioButtonNoMeta;
+       private JRadioButton radioButtononlyAttachPDF;
+-      private JRadioButton radioButtonUpdateEmptyFields;
+       private JCheckBox useDefaultPDFImportStyle;
+       
+       private JTextField fileNamePattern;
+@@ -59,17 +57,12 @@
+         radioButtonNoMeta = new JRadioButton(Globals.lang("Create_blank_entry_linking_the_PDF"));
+         radioButtonXmp = new JRadioButton(Globals.lang("Create_entry_based_on_XMP_data"));
+         radioButtonPDFcontent = new JRadioButton(Globals.lang("Create_entry_based_on_content"));
+-        radioButtonMrDlib = new JRadioButton(Globals.lang("Create_entry_based_on_data_fetched_from")+" Mr.DLib");
+         radioButtononlyAttachPDF = new JRadioButton(Globals.lang("Only_attach_PDF"));
+-        radioButtonUpdateEmptyFields = new JRadioButton(Globals.lang("Update_empty_fields_with_data_fetched_from")
+-            +" Mr.DLib");
+         ButtonGroup bg = new ButtonGroup();
+         bg.add(radioButtonNoMeta);
+         bg.add(radioButtonXmp);
+         bg.add(radioButtonPDFcontent);
+-        bg.add(radioButtonMrDlib);
+         bg.add(radioButtononlyAttachPDF);
+-        bg.add(radioButtonUpdateEmptyFields);
+         useDefaultPDFImportStyle = new JCheckBox(Globals.lang("Always use this PDF import style (and do not ask for each import)"));
+               
+@@ -96,15 +89,9 @@
+               builder.append(radioButtonPDFcontent);
+         builder.nextLine();
+         builder.append(pan);
+-              builder.append(radioButtonMrDlib);
+-        builder.nextLine();
+-        builder.append(pan);
+               builder.append(radioButtononlyAttachPDF);
+         builder.nextLine();
+         builder.append(pan);
+-              builder.append(radioButtonUpdateEmptyFields);
+-        builder.nextLine();
+-        builder.append(pan);
+               builder.append(useDefaultPDFImportStyle);
+         builder.nextLine();
+               
+@@ -136,15 +123,9 @@
+               case ImportDialog.CONTENT:
+                       radioButtonPDFcontent.setSelected(true);
+                       break;
+-              case ImportDialog.MRDLIB:
+-                      radioButtonMrDlib.setSelected(true);
+-                      break;
+               case ImportDialog.ONLYATTACH:
+                       radioButtononlyAttachPDF.setSelected(true);
+                       break;
+-              case ImportDialog.UPDATEEMPTYFIELDS:
+-                      radioButtonUpdateEmptyFields.setSelected(true);
+-                      break;
+               default:
+                       // fallback
+                       radioButtonPDFcontent.setSelected(true);
+@@ -162,12 +143,9 @@
+                       style = ImportDialog.XMP;
+               else if (radioButtonPDFcontent.isSelected())
+                       style = ImportDialog.CONTENT;
+-              else if (radioButtonMrDlib.isSelected())
+-                      style = ImportDialog.MRDLIB;
+               else if (radioButtononlyAttachPDF.isSelected())
+                       style = ImportDialog.ONLYATTACH;
+-              else if (radioButtonUpdateEmptyFields.isSelected())
+-                      style = ImportDialog.UPDATEEMPTYFIELDS;
++              else throw new IllegalStateException();
+               Globals.prefs.putInt(PREF_IMPORT_DEFAULT_PDF_IMPORT_STYLE, style);
+               Globals.prefs.put(PREF_IMPORT_FILENAMEPATTERN, fileNamePattern.getText());
+       }
+--- a/src/java/spl/DocumentWrapper.java
++++ /dev/null
+@@ -1,272 +0,0 @@
+-package spl;\r
+-\r
+-import java.util.List;\r
+-\r
+-import org.sciplore.beans.Abstract;\r
+-import org.sciplore.beans.Author;\r
+-import org.sciplore.beans.Authors;\r
+-import org.sciplore.beans.Document;\r
+-import org.sciplore.formatter.Bean;\r
+-import org.sciplore.formatter.SimpleTypeElementBean;\r
+-\r
+-/**\r
+- * Created by IntelliJ IDEA.\r
+- * User: Christoph Arbeit\r
+- * Date: 10.09.2010\r
+- * Time: 20:02:51\r
+- * To change this template use File | Settings | File Templates.\r
+- */\r
+-public class DocumentWrapper {\r
+-\r
+-    Document xmlDocument;\r
+-\r
+-    public DocumentWrapper(Document xmlDocument) {\r
+-        this.xmlDocument = xmlDocument;\r
+-    }\r
+-\r
+-    public Document getXmlDocument() {\r
+-        return xmlDocument;\r
+-    }\r
+-\r
+-    public void setXmlDocument(Document xmlDocument) {\r
+-        this.xmlDocument = xmlDocument;\r
+-    }\r
+-\r
+-    public String getTitle(){\r
+-        if(this.hasTitle()){\r
+-            return xmlDocument.getTitle().getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasTitle(){\r
+-        return (xmlDocument.getTitle() != null && xmlDocument.getTitle().getValue() != null && !xmlDocument.getTitle().getValue().isEmpty());\r
+-    }\r
+-\r
+-    public String getAbstract(){\r
+-        if(this.hasAbstract()){\r
+-            return ((Abstract)xmlDocument.getAbstract()).getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasAbstract(){\r
+-        return (xmlDocument.getAbstract() != null && ((Abstract)xmlDocument.getAbstract()).getValue() != null && !((Abstract)xmlDocument.getAbstract()).getValue().isEmpty());\r
+-    }\r
+-\r
+-   public String getAuthors(String seperator){\r
+-        if(this.hasAuthors()){\r
+-              List<Bean> authors = xmlDocument.getAuthors().getCollection();\r
+-            authors = this.sortAuthors(authors);\r
+-            String value = "";\r
+-            int i = 1;\r
+-            for(Bean author : authors){\r
+-                if(i < authors.size()){\r
+-                    value = value + getNameComplete((Author)author);\r
+-                    value = value + " " + seperator + " ";\r
+-                }\r
+-                else{\r
+-                    value = value + getNameComplete((Author)author);\r
+-                }\r
+-                i++;\r
+-            }\r
+-            return value;\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasAuthors(){\r
+-        return (xmlDocument.getAuthors() != null && xmlDocument.getAuthors().getCollection() != null && !xmlDocument.getAuthors().getCollection().isEmpty());\r
+-    }\r
+-\r
+-    /* public String getKeyWords(){\r
+-        if(this.hasKeyWords()){\r
+-            List<XmlKeyword> keywords = xmlDocument.getKeywords().getKeywords();\r
+-            String value = "";\r
+-            int i = 1;\r
+-            for(XmlKeyword keyword : keywords){\r
+-                if(i < keywords.size()){\r
+-                    value = value + keyword.getValue();\r
+-                    value = value + ", ";\r
+-                }\r
+-                else{\r
+-                    value = value + keyword.getValue();\r
+-                }\r
+-                i++;\r
+-            }\r
+-            return value;\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasKeyWords(){\r
+-        return (xmlDocument.getKeywords() != null && xmlDocument.getKeywords().getKeywords() != null && !xmlDocument.getKeywords().getKeywords().isEmpty());\r
+-    }\r
+-*/\r
+-\r
+-    public String getDoi(){\r
+-        if(this.hasDoi()){\r
+-            return this.getSimpleTypeValue(xmlDocument.getDoi());\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasDoi(){\r
+-        return (xmlDocument.getDoi() != null && this.getSimpleTypeValue(xmlDocument.getDoi()) != null && !this.getSimpleTypeValue(xmlDocument.getDoi()).isEmpty());\r
+-    }\r
+-/*\r
+-    public String getPages(){\r
+-        if(this.hasPages()){\r
+-            return xmlDocument.getPages().getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasPages(){\r
+-        return (xmlDocument.getPages() != null && xmlDocument.getPages().getValue() != null && !xmlDocument.getPages().getValue().isEmpty());\r
+-    }\r
+-\r
+-    public String getVolume(){\r
+-        if(this.hasVolume()){\r
+-            return xmlDocument.getVolume().getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasVolume(){\r
+-        return (xmlDocument.getVolume() != null && xmlDocument.getVolume().getValue() != null && !xmlDocument.getVolume().getValue().isEmpty());\r
+-    }\r
+-\r
+-    public String getNumber(){\r
+-        if(this.hasNumber()){\r
+-            return xmlDocument.getNumber().getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasNumber(){\r
+-        return (xmlDocument.getNumber() != null && xmlDocument.getNumber().getValue() != null && !xmlDocument.getNumber().getValue().isEmpty());\r
+-    }\r
+-*/\r
+-    \r
+-    public String getYear(){\r
+-        if(this.hasYear()){\r
+-            return this.getSimpleTypeValue(xmlDocument.getYear());\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasYear(){\r
+-        return (this.getSimpleTypeValue(xmlDocument.getYear()) != null && !this.getSimpleTypeValue(xmlDocument.getYear()).isEmpty() && !this.getSimpleTypeValue(xmlDocument.getYear()).equalsIgnoreCase("null"));\r
+-    }\r
+-    \r
+-/*\r
+-     public String getMonth(){\r
+-        if(this.hasMonth()){\r
+-            return xmlDocument.getPublishdate().getMonth();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasMonth(){\r
+-        return (xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getMonth() != null && !xmlDocument.getPublishdate().getMonth().isEmpty());\r
+-    }\r
+-\r
+-    public String getDay(){\r
+-        if(this.hasDay()){\r
+-            return xmlDocument.getPublishdate().getDay();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasDay(){\r
+-        return (xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getDay() != null && !xmlDocument.getPublishdate().getDay().isEmpty());\r
+-    }\r
+-    \r
+-      /*\r
+-    public String getVenue() {\r
+-        if(this.hasVenue()){\r
+-            return xmlDocument.getVenue().getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasVenue(){\r
+-        return (xmlDocument.getVenue() != null && xmlDocument.getVenue().getValue() != null && !xmlDocument.getVenue().getValue().isEmpty());\r
+-    }*/\r
+-    \r
+-    private String getNameComplete(Author author){\r
+-      if(author == null) return "";\r
+-      String result = "";\r
+-      if(getSimpleTypeValue(author.getName_First()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_First()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Middle()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Middle()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last_Prefix()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last_Prefix()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last_Suffix()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last_Suffix()).trim() + " ";\r
+-      return result.trim();\r
+-    }\r
+-    \r
+-    private String getSimpleTypeValue(Bean bean){\r
+-      if(bean == null || !(bean instanceof SimpleTypeElementBean)) return null;\r
+-      SimpleTypeElementBean simpleTypeElementBean = (SimpleTypeElementBean)bean;\r
+-      if(simpleTypeElementBean.getValue() == null || simpleTypeElementBean.getValue().equalsIgnoreCase("null") || simpleTypeElementBean.getValue().length() <= 0) return null;\r
+-      return simpleTypeElementBean.getValue();\r
+-    }\r
+-    \r
+-    private List<Bean> sortAuthors(List<Bean> authors){\r
+-       boolean unsorted = true;\r
+-        Bean temp;\r
+-        \r
+-        while (unsorted){\r
+-               unsorted = false;\r
+-               for (int i = 0; i < authors.size() - 1; i++){\r
+-                       int rank = 99;\r
+-                       int otherRank = 99;\r
+-                       if(((Author)authors.get(i)).getRank() != null && !((Author)authors.get(i)).getRank().equalsIgnoreCase("null")){\r
+-                               rank = Integer.parseInt(((Author)authors.get(i)).getRank());\r
+-                       }                       \r
+-                       if(((Author)authors.get(i + 1)).getRank() != null && !((Author)authors.get(i + 1)).getRank().equalsIgnoreCase("null")){\r
+-                               otherRank = Integer.parseInt(((Author)authors.get(i + 1)).getRank());\r
+-                       }                       \r
+-                       \r
+-                       if (rank > otherRank) {                      \r
+-                 temp       = authors.get(i);\r
+-                 authors.set(i, authors.get(i + 1));\r
+-                 authors.set(i + 1, temp);                 \r
+-                 unsorted = true;\r
+-              }          \r
+-              }        \r
+-       } \r
+-      \r
+-      return authors;\r
+-   }\r
+-}\r
+--- a/src/java/spl/DocumentsWrapper.java
++++ /dev/null
+@@ -1,132 +0,0 @@
+-package spl;\r
+-\r
+-import java.util.ArrayList;\r
+-import java.util.List;\r
+-import java.util.Vector;\r
+-\r
+-import org.sciplore.beans.Author;\r
+-import org.sciplore.beans.Document;\r
+-import org.sciplore.beans.Year;\r
+-import org.sciplore.formatter.Bean;\r
+-import org.sciplore.formatter.SimpleTypeElementBean;\r
+-\r
+-/**\r
+- * Created by IntelliJ IDEA.\r
+- * User: Christoph Arbeit\r
+- * Date: 09.09.2010\r
+- * Time: 10:56:50\r
+- * To change this template use File | Settings | File Templates.\r
+- */\r
+-public class DocumentsWrapper {\r
+-\r
+-    Document xmlDocuments;\r
+-\r
+-    public DocumentsWrapper(Document documents) {\r
+-        this.xmlDocuments = documents;\r
+-    }\r
+-\r
+-    public Document getXmlDocuments() {\r
+-        return xmlDocuments;\r
+-    }\r
+-\r
+-    public void setXmlDocuments(Document xmlDocuments) {\r
+-        this.xmlDocuments = xmlDocuments;\r
+-    }\r
+-\r
+-    public List<Vector> getDocuments(){\r
+-        List<Vector> documents = new ArrayList<Vector>();\r
+-        //List<XmlDocument> xmlDocuments = this.xmlDocuments.getDocuments();\r
+-        //for(XmlDocument xmlDocument : xmlDocuments){\r
+-              Document xmlDocument = xmlDocuments;\r
+-            Vector<String> vector = new Vector<String>();\r
+-            if(xmlDocument.getTitle() != null){\r
+-                vector.add(xmlDocument.getTitle().getValue());\r
+-            }\r
+-            else{\r
+-                vector.add("");\r
+-            }\r
+-            if(xmlDocument.getAuthors() != null){\r
+-                List<Bean> authors = xmlDocument.getAuthors().getCollection();\r
+-                authors = this.sortAuthors(authors);\r
+-                String value = "";\r
+-                int i = 1;\r
+-                for(Bean author : authors){\r
+-                    if(i < authors.size()){\r
+-                        value = value + getNameComplete(((Author)author));\r
+-                        value = value + ", ";\r
+-                    }\r
+-                    else{\r
+-                        value = value + getNameComplete(((Author)author));\r
+-                    }\r
+-                    i++;\r
+-                }\r
+-                vector.add(value);\r
+-            }\r
+-            else{\r
+-                vector.add("");\r
+-            }\r
+-            if(xmlDocument.getYear() != null && ((Year)xmlDocument.getYear()).getValue() != null && !((Year)xmlDocument.getYear()).getValue().equalsIgnoreCase("null")){\r
+-                vector.add(((Year)xmlDocument.getYear()).getValue());\r
+-            }\r
+-            /*if(xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getYear() != null && !xmlDocument.getPublishdate().getYear().equalsIgnoreCase("null")){\r
+-                vector.add(xmlDocument.getPublishdate().getYear());\r
+-            }*/\r
+-            else{\r
+-                vector.add("");\r
+-            }\r
+-            documents.add(vector);\r
+-        //}\r
+-        return documents;\r
+-    }\r
+-    \r
+-    private String getNameComplete(Author author){\r
+-      if(author == null) return "";\r
+-      String result = "";\r
+-      if(getSimpleTypeValue(author.getName_First()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_First()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Middle()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Middle()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last_Prefix()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last_Prefix()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last_Suffix()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last_Suffix()).trim() + " ";\r
+-      return result.trim();\r
+-    }\r
+-    \r
+-    private String getSimpleTypeValue(Bean bean){\r
+-      if(bean == null || !(bean instanceof SimpleTypeElementBean)) return null;\r
+-      SimpleTypeElementBean simpleTypeElementBean = (SimpleTypeElementBean)bean;\r
+-      if(simpleTypeElementBean.getValue() == null || simpleTypeElementBean.getValue().equalsIgnoreCase("null") || simpleTypeElementBean.getValue().length() <= 0) return null;\r
+-      return simpleTypeElementBean.getValue();\r
+-    }\r
+-    \r
+-    private List<Bean> sortAuthors(List<Bean> authors){\r
+-       boolean unsorted = true;\r
+-         Bean temp;\r
+-         \r
+-         while (unsorted){\r
+-               unsorted = false;\r
+-               for (int i = 0; i < authors.size() - 1; i++){\r
+-                       int rank = 99;\r
+-                       int otherRank = 99;\r
+-                       if(((Author)authors.get(i)).getRank() != null && !((Author)authors.get(i)).getRank().equalsIgnoreCase("null")){\r
+-                               rank = Integer.parseInt(((Author)authors.get(i)).getRank());\r
+-                       }                       \r
+-                       if(((Author)authors.get(i + 1)).getRank() != null && !((Author)authors.get(i + 1)).getRank().equalsIgnoreCase("null")){\r
+-                               otherRank = Integer.parseInt(((Author)authors.get(i + 1)).getRank());\r
+-                       }                       \r
+-                       \r
+-                       if (rank > otherRank) {                      \r
+-                  temp       = authors.get(i);\r
+-                  authors.set(i, authors.get(i + 1));\r
+-                  authors.set(i + 1, temp);                 \r
+-                  unsorted = true;\r
+-               }          \r
+-              }        \r
+-        } \r
+-      \r
+-      return authors;\r
+-    }\r
+-}\r
+--- a/src/java/spl/PdfImporter.java
++++ b/src/java/spl/PdfImporter.java
+@@ -21,15 +21,9 @@
+ import net.sf.jabref.undo.UndoableInsertEntry;\r
+ import net.sf.jabref.util.XMPUtil;\r
\r
+-import org.sciplore.beans.Document;\r
+-\r
+ import spl.filter.PdfFileFilter;\r
+ import spl.gui.ImportDialog;\r
+-import spl.gui.MetaDataListDialog;\r
\r
+-import java.util.ArrayList;\r
+-import java.util.Arrays;\r
+-import java.util.List;\r
+ import java.util.Set;\r
\r
\r
+@@ -113,7 +107,6 @@
+               BibtexEntryType type;\r
+                 InputStream in = null;\r
+                 List<BibtexEntry> res = null;\r
+-              MetaDataListDialog metaDataListDialog;\r
+                 switch (choice) {\r
+                       case ImportDialog.XMP:\r
+                     //SplDatabaseChangeListener dataListener = new SplDatabaseChangeListener(frame, panel, entryTable, fileName);\r
+@@ -200,84 +193,9 @@
+                         panel.adjustSplitter();\r
+                     }\r
+                     break;\r
+-                      case ImportDialog.MRDLIB:\r
+-                    metaDataListDialog = new MetaDataListDialog(fileName, true);\r
+-                    Tools.centerRelativeToWindow(metaDataListDialog, frame);\r
+-                    metaDataListDialog.showDialog();\r
+-                    Document document = metaDataListDialog.getXmlDocuments();\r
+-                    if(document != null /*&& documents.getDocuments() != null && documents.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
+-                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();\r
+-                        if(selected > -1 /*&& selected < documents.getDocuments().size()*/){\r
+-                            //Document document = documents/*.getDocuments().get(selected)*/;\r
+-                            String id = Util.createNeutralId();\r
+-                            entry = new BibtexEntry(id);\r
+-                            if(fieldExists(document.getType())){\r
+-                                type = BibtexEntryType.getStandardType(document.getType());\r
+-                                if(type == null){\r
+-                                    type = BibtexEntryType.ARTICLE;\r
+-                                }\r
+-                                entry.setType(type);\r
+-                            }\r
+-                            else{\r
+-                                entry.setType(BibtexEntryType.ARTICLE);\r
+-                            }\r
+-                            ArrayList<BibtexEntry> list = new ArrayList<BibtexEntry>();\r
+-                            list.add(entry);\r
+-                            Util.setAutomaticFields(list, true, true, false);\r
+-                            //insertFields(entry.getRequiredFields(), entry, document);\r
+-                            insertFields(BibtexFields.getAllFieldNames(), entry, document);\r
+-                            //insertFields(entry.getOptionalFields(), entry, document);\r
+-                            panel.database().insertEntry(entry);\r
+-                            dfh = new DroppedFileHandler(frame, panel);\r
+-                            dfh.linkPdfToEntry(fileName, entryTable, entry);\r
+-                            LabelPatternUtil.makeLabel(panel.metaData(), panel.database(), entry);\r
+-                        }\r
+-                        else{\r
+-                            createNewBlankEntry(fileName);\r
+-                        }\r
+-                    }\r
+-                    else if(metaDataListDialog.getResult() == JOptionPane.CANCEL_OPTION ){\r
+-                        continue;\r
+-                    }\r
+-                    else if(metaDataListDialog.getResult() == JOptionPane.NO_OPTION ){\r
+-                        createNewBlankEntry(fileName);\r
+-                    }\r
+-                    else if(document == null /*|| document.getDocuments() == null || document.getDocuments().size() <= 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
+-                        createNewBlankEntry(fileName);\r
+-                    }\r
+-                    break;\r
+                       case ImportDialog.NOMETA:\r
+                     createNewBlankEntry(fileName);\r
+                     break;\r
+-                      case ImportDialog.UPDATEEMPTYFIELDS:\r
+-                    metaDataListDialog = new MetaDataListDialog(fileName, false);                   \r
+-                    Tools.centerRelativeToWindow(metaDataListDialog, frame);\r
+-                    metaDataListDialog.showDialog();\r
+-                    document = metaDataListDialog.getXmlDocuments();\r
+-                    if(document != null /*&& document.getDocuments() != null && document.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
+-                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();\r
+-                        if(selected > -1 /*&& selected < document.getDocuments().size()*/){\r
+-                            //XmlDocument document = documents.getDocuments().get(selected);\r
+-                            entry = entryTable.getEntryAt(dropRow);\r
+-                            if(fieldExists(document.getType())){\r
+-                                type = BibtexEntryType.getStandardType(document.getType());\r
+-                                if(type != null){\r
+-                                    entry.setType(type);\r
+-                                }\r
+-                            }\r
+-                            //insertFields(entry.getRequiredFields(), entry, document);\r
+-                            insertFields(BibtexFields.getAllFieldNames(), entry, document);\r
+-                            //insertFields(entry.getOptionalFields(), entry, document);\r
+-\r
+-                            dfh = new DroppedFileHandler(frame, panel);\r
+-                            dfh.linkPdfToEntry(fileName, entryTable, dropRow);\r
+-                        }\r
+-                    }\r
+-                    break;\r
+-                      case ImportDialog.ONLYATTACH:\r
+-                    dfh = new DroppedFileHandler(frame, panel);\r
+-                    dfh.linkPdfToEntry(fileName, entryTable, dropRow);\r
+-                    break;\r
+                 }\r
+             }\r
\r
+@@ -295,58 +213,6 @@
+         }\r
+     }\r
\r
+-    private void insertFields(String[] fields, BibtexEntry entry, Document xmlDocument) {\r
+-        DocumentWrapper document = new DocumentWrapper(xmlDocument);\r
+-        for(String field : fields){\r
+-            if(entry.getField(field) != null){\r
+-                continue;\r
+-            }\r
+-            if(field.equalsIgnoreCase("author")){\r
+-                entry.setField(field, document.getAuthors("and"));\r
+-            }\r
+-            if(field.equalsIgnoreCase("title")){\r
+-                entry.setField(field, document.getTitle());\r
+-            }\r
+-            if(field.equalsIgnoreCase("abstract")){\r
+-                entry.setField(field, document.getAbstract());\r
+-            }\r
+-            /*if(field.equalsIgnoreCase("keywords")){\r
+-                entry.setField(field, document.getKeyWords());\r
+-            }*/\r
+-            if(field.equalsIgnoreCase("doi")){\r
+-                entry.setField(field, document.getDoi());\r
+-            }\r
+-            /*if(field.equalsIgnoreCase("pages")){\r
+-                entry.setField(field, document.getPages());\r
+-            }\r
+-            if(field.equalsIgnoreCase("volume")){\r
+-                entry.setField(field, document.getVolume());\r
+-            }\r
+-            if(field.equalsIgnoreCase("number")){\r
+-                entry.setField(field, document.getNumber());\r
+-            }*/\r
+-            if(field.equalsIgnoreCase("year")){\r
+-                entry.setField(field, document.getYear());\r
+-            }\r
+-            /*if(field.equalsIgnoreCase("month")){\r
+-                entry.setField(field, document.getMonth());\r
+-            }\r
+-            if(field.equalsIgnoreCase("day")){\r
+-                entry.setField(field, document.getDay());\r
+-            }\r
+-            if(field.equalsIgnoreCase("booktitle")){\r
+-                entry.setField(field, document.getVenue());\r
+-            }\r
+-            if(field.equalsIgnoreCase("journal")){\r
+-                entry.setField(field, document.getVenue());\r
+-            }*/\r
+-        }\r
+-    }\r
+-\r
+-    private boolean fieldExists(String string) {\r
+-        return string != null && !string.isEmpty();\r
+-    }\r
+-\r
+     private BibtexEntry createNewEntry() {\r
\r
+         // Find out what type is wanted.\r
+--- a/src/java/spl/SplWebClient.java
++++ /dev/null
+@@ -1,196 +0,0 @@
+-package spl;\r
+-\r
+-import java.io.ByteArrayInputStream;\r
+-import java.io.File;\r
+-import java.io.FileInputStream;\r
+-import java.io.InputStream;\r
+-import java.io.UnsupportedEncodingException;\r
+-\r
+-import javax.ws.rs.core.MediaType;\r
+-import javax.xml.bind.JAXB;\r
+-\r
+-import org.sciplore.beans.Author;\r
+-import org.sciplore.beans.Document;\r
+-import org.sciplore.deserialize.creator.AuthorBeanCreator;\r
+-import org.sciplore.deserialize.creator.AuthorsBeanCreator;\r
+-import org.sciplore.deserialize.creator.DefaultStringCreator;\r
+-import org.sciplore.deserialize.creator.DocumentBeanCreator;\r
+-import org.sciplore.deserialize.creator.DocumentsBeanCreator;\r
+-import org.sciplore.deserialize.creator.ObjectCreator;\r
+-import org.sciplore.deserialize.creator.TitleBeanCreator;\r
+-import org.sciplore.deserialize.creator.YearBeanCreator;\r
+-import org.sciplore.deserialize.reader.ObjectCreatorMapper;\r
+-import org.sciplore.deserialize.reader.XmlResourceReader;\r
+-import org.sciplore.formatter.Bean;\r
+-import org.sciplore.formatter.SimpleTypeElementBean;\r
+-\r
+-import com.sun.jersey.api.client.Client;\r
+-import com.sun.jersey.api.client.ClientResponse;\r
+-import com.sun.jersey.api.client.WebResource;\r
+-import com.sun.jersey.multipart.FormDataMultiPart;\r
+-\r
+-/**\r
+- * Created by IntelliJ IDEA.\r
+- * User: Christoph Arbeit\r
+- * Date: 09.09.2010\r
+- * Time: 10:35:20\r
+- * To change this template use File | Settings | File Templates.\r
+- */\r
+-public class SplWebClient {\r
+-\r
+-    private static Client CLIENT = Client.create();\r
+-    static{\r
+-        CLIENT.setConnectTimeout(1000);\r
+-        CLIENT.setReadTimeout(70000);\r
+-    }\r
+-    private static WebResource WEBRESOURCE = CLIENT.resource( "http://api.mr-dlib.org/" );\r
+-    private static WebResource INTERNETRESOURCE = CLIENT.resource( "http://www.google.com" );\r
+-    //private static WebResource WEBRESOURCE = CLIENT.resource( "http://localhost:8080/rest/" );\r
+-\r
+-    public static Document metadata;\r
+-\r
+-    public static WebServiceStatus getMetaData(File file){\r
+-        try{\r
+-            if(isWebServiceAvailable() == false){\r
+-                if(isInternetAvailable()){\r
+-                    return  WebServiceStatus.WEBSERVICE_DOWN;\r
+-                }\r
+-                else{\r
+-                    return  WebServiceStatus.NO_INTERNET;\r
+-                }\r
+-            }\r
+-            if(isWebServiceOutDated()){\r
+-                return  WebServiceStatus.OUTDATED;\r
+-            }\r
+-            if(isMetaDataServiceAvailable() == false){\r
+-                return  WebServiceStatus.UNAVAILABLE;\r
+-            }\r
+-            FileInputStream fin = new FileInputStream(file);      \r
+-            byte[] data = new byte[(int)file.length()];          \r
+-            fin.read(data);           \r
+-            \r
+-            FormDataMultiPart formDataMultiPart = new FormDataMultiPart();            \r
+-            formDataMultiPart.field("file", data,  MediaType.APPLICATION_OCTET_STREAM_TYPE);            \r
+-            formDataMultiPart.field("source", "jabref",  MediaType.TEXT_PLAIN_TYPE);\r
+-            formDataMultiPart.field("filename", file.getName(), MediaType.TEXT_PLAIN_TYPE);\r
+-           \r
+-           \r
+-            ClientResponse response = WEBRESOURCE.path("documents").type(MediaType.MULTIPART_FORM_DATA_TYPE).post(ClientResponse.class, formDataMultiPart);\r
+-            //System.out.println(response.getEntity(String.class));\r
+-            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
+-                String entity = response.getEntity(String.class);\r
+-                byte[] bytes = new byte[0];\r
+-                try {\r
+-                    bytes = entity.getBytes("UTF-8");\r
+-                } catch (UnsupportedEncodingException e) {\r
+-                    return null;\r
+-                }\r
+-                InputStream is = new ByteArrayInputStream(bytes);\r
+-                if(is != null){\r
+-                      ObjectCreatorMapper resourceMapper = new ObjectCreatorMapper();\r
+-                      ObjectCreator stringCreator = new DefaultStringCreator();\r
+-                      // initialize Mapper    \r
+-                        resourceMapper.addCreator("documents", new DocumentsBeanCreator());\r
+-                        resourceMapper.addCreator("authors", new AuthorsBeanCreator());\r
+-                        resourceMapper.addCreator("document", new DocumentBeanCreator());\r
+-                        resourceMapper.addCreator("title", new TitleBeanCreator());\r
+-                        resourceMapper.addCreator("year", new YearBeanCreator());\r
+-                        resourceMapper.addCreator("author", new AuthorBeanCreator());\r
+-                        \r
+-                        resourceMapper.addCreator("name_first", stringCreator);\r
+-                        resourceMapper.addCreator("name_middle", stringCreator);\r
+-                        resourceMapper.addCreator("name_last", stringCreator);\r
+-                        resourceMapper.addCreator("name_last_prefix", stringCreator);\r
+-                        resourceMapper.addCreator("name_last_suffix", stringCreator);\r
+-                        \r
+-                        // initialize xml reader\r
+-                        XmlResourceReader<?> reader = new XmlResourceReader(resourceMapper);\r
+-                        \r
+-                        // parse given file -> create object tree\r
+-                        Document docs =  (Document)reader.parse(is);\r
+-                        for(Bean author : docs.getAuthors().getCollection()){\r
+-                                Author temp = (Author)author;\r
+-                                System.out.println(((SimpleTypeElementBean)temp.getName_Last()).getValue() + " " + temp.getRank());\r
+-                        }\r
+-                   // XmlDocuments documents = JAXB.unmarshal(is, XmlDocuments.class);\r
+-                    SplWebClient.metadata = docs;\r
+-                    return WebServiceStatus.OK;\r
+-                }\r
+-                else{\r
+-                    return WebServiceStatus.NO_METADATA;\r
+-                }\r
+-            }\r
+-            if(response.getClientResponseStatus() == ClientResponse.Status.SERVICE_UNAVAILABLE){\r
+-                return  WebServiceStatus.UNAVAILABLE;\r
+-            }\r
+-        }catch(Exception e){\r
+-            System.out.println(Tools.getStackTraceAsString(e));\r
+-            //Todo logging\r
+-        }\r
+-        return WebServiceStatus.NO_METADATA;\r
+-    }\r
+-\r
+-    public static boolean isWebServiceOutDated(){\r
+-        try{\r
+-            ClientResponse response =  WEBRESOURCE.path("service/versioncheck/" + Tools.WEBSERVICE_APP_ID + "/current").get(ClientResponse.class);\r
+-            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
+-                String entity = response.getEntity(String.class);\r
+-                byte[] bytes = entity.getBytes();\r
+-                InputStream is = new ByteArrayInputStream(bytes);\r
+-                if(is != null){\r
+-                    /*XmlApplication app = JAXB.unmarshal(is, XmlApplication.class);\r
+-                    if(app != null){\r
+-                        if(app.getVersion() != null && !app.getVersion().equalsIgnoreCase(Tools.WEBSERVICE_VERSION_SHORT)){\r
+-                            return true;\r
+-                        }\r
+-                    }*/\r
+-                }\r
+-            }\r
+-        }catch(Exception e){\r
+-            //Todo logging\r
+-        }\r
+-        return false;\r
+-    }\r
+-\r
+-    public static boolean isMetaDataServiceAvailable(){\r
+-        try{\r
+-            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);\r
+-            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
+-                String entity = response.getEntity(String.class);\r
+-                if(entity != null && entity.equalsIgnoreCase("false")){\r
+-                    return false;\r
+-                }\r
+-            }\r
+-        }catch(Exception e){\r
+-            //Todo logging\r
+-        }\r
+-        return true;\r
+-    }\r
+-\r
+-    public static boolean isWebServiceAvailable(){\r
+-        try{\r
+-            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);\r
+-        }catch(Exception e){\r
+-            return false;\r
+-        }\r
+-        return true;\r
+-    }\r
+-\r
+-    public static boolean isInternetAvailable(){\r
+-        try{\r
+-            ClientResponse response =  INTERNETRESOURCE.get(ClientResponse.class);\r
+-        }catch(Exception e){\r
+-            return false;\r
+-        }\r
+-        return true;\r
+-    }\r
+-\r
+-    public enum WebServiceStatus {\r
+-        OK,\r
+-        NO_METADATA,\r
+-        UNAVAILABLE,\r
+-        OUTDATED,\r
+-        WEBSERVICE_DOWN,\r
+-        NO_INTERNET\r
+-    }\r
+-}\r
+--- a/src/java/spl/gui/ImportDialog.java
++++ b/src/java/spl/gui/ImportDialog.java
+@@ -20,9 +20,7 @@
+       public final static int NOMETA = 0;\r
+       public final static int XMP = 1;\r
+       public final static int CONTENT = 2;\r
+-      public final static int MRDLIB = 3;\r
+       public final static int ONLYATTACH = 4;\r
+-      public final static int UPDATEEMPTYFIELDS = 5;\r
+       \r
+     private JPanel contentPane;\r
+     private JLabel labelSubHeadline;\r
+@@ -32,14 +30,10 @@
+       private JCheckBox useDefaultPDFImportStyle;\r
+     private JRadioButton radioButtonXmp;\r
+       private JRadioButton radioButtonPDFcontent;\r
+-    private JRadioButton radioButtonMrDlib;\r
+     private JRadioButton radioButtonNoMeta;\r
+     private JLabel labelHeadline;\r
+     private JLabel labelFileName;\r
+     private JRadioButton radioButtononlyAttachPDF;\r
+-    private JRadioButton radioButtonUpdateEmptyFields;\r
+-    private JLabel labelMrDlib1;\r
+-    private JLabel labelMrDlib2;\r
+     private int result;\r
+     private int dropRow;\r
+     private String fileName;\r
+@@ -71,15 +65,7 @@
+         radioButtonNoMeta = new JRadioButton(Globals.lang("Create_blank_entry_linking_the_PDF"));\r
+         radioButtonXmp = new JRadioButton(Globals.lang("Create_entry_based_on_XMP_data"));\r
+         radioButtonPDFcontent = new JRadioButton(Globals.lang("Create_entry_based_on_content"));\r
+-        radioButtonMrDlib = new JRadioButton(Globals.lang("Create_entry_based_on_data_fetched_from"));\r
+         radioButtononlyAttachPDF = new JRadioButton(Globals.lang("Only_attach_PDF"));\r
+-        radioButtonUpdateEmptyFields = new JRadioButton(Globals.lang("Update_empty_fields_with_data_fetched_from"));\r
+-        labelMrDlib1 = new JLabel("Mr._dLib");\r
+-        labelMrDlib1.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));\r
+-        labelMrDlib1.setForeground(new Color(-16776961));\r
+-        labelMrDlib2 = new JLabel("Mr._dLib");\r
+-        labelMrDlib2.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));\r
+-        labelMrDlib2.setForeground(new Color(-16776961));\r
+         buttonOK = new JButton(Globals.lang("Ok"));\r
+         buttonCancel = new JButton(Globals.lang("Cancel"));\r
+         checkBoxDoNotShowAgain = new JCheckBox(Globals.lang("Do not show this box again for this import"));\r
+@@ -89,12 +75,8 @@
+         b.append(radioButtonNoMeta, 3);\r
+         b.append(radioButtonXmp, 3);\r
+         b.append(radioButtonPDFcontent, 3);\r
+-        b.append(radioButtonMrDlib);\r
+-        b.append(labelMrDlib1);\r
+         b.appendSeparator(Globals.lang("Update_Existing_Entry"));\r
+         b.append(radioButtononlyAttachPDF, 3);\r
+-        b.append(radioButtonUpdateEmptyFields);\r
+-        b.append(labelMrDlib2);\r
+         b.nextLine();\r
+         b.append(checkBoxDoNotShowAgain);\r
+         b.append(useDefaultPDFImportStyle);\r
+@@ -114,8 +96,6 @@
+         //this.setText();\r
+         if (this.dropRow < 0) {\r
+             this.radioButtononlyAttachPDF.setEnabled(false);\r
+-            this.radioButtonUpdateEmptyFields.setEnabled(false);\r
+-            this.labelMrDlib2.setEnabled(false);\r
+         }\r
+         this.fileName = fileName;\r
+         String name = new File(this.fileName).getName();\r
+@@ -124,8 +104,6 @@
+         } else {\r
+             this.labelFileName.setText(new File(this.fileName).getName().substring(0, 33) + "...");\r
+         }\r
+-        this.labelMrDlib1.addMouseListener(new LabelLinkListener(this.labelMrDlib1, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));\r
+-        this.labelMrDlib2.addMouseListener(new LabelLinkListener(this.labelMrDlib2, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));\r
+         this.setTitle(LocalizationSupport.message("Import_Metadata_From_PDF"));\r
\r
+         setModal(true);\r
+@@ -136,9 +114,7 @@
+         bg.add(radioButtonNoMeta);\r
+         bg.add(radioButtonXmp);\r
+         bg.add(radioButtonPDFcontent);\r
+-        bg.add(radioButtonMrDlib);\r
+         bg.add(radioButtononlyAttachPDF);\r
+-        bg.add(radioButtonUpdateEmptyFields);\r
\r
+         buttonOK.addActionListener(new ActionListener() {\r
+             public void actionPerformed(ActionEvent e) {\r
+@@ -175,15 +151,9 @@
+               case CONTENT:\r
+                       radioButtonPDFcontent.setSelected(true);\r
+                       break;\r
+-              case MRDLIB:\r
+-                      radioButtonMrDlib.setSelected(true);\r
+-                      break;\r
+               case ONLYATTACH:\r
+                       radioButtononlyAttachPDF.setSelected(true);\r
+                       break;\r
+-              case UPDATEEMPTYFIELDS:\r
+-                      radioButtonUpdateEmptyFields.setSelected(true);\r
+-                      break;\r
+               default:\r
+                       // fallback\r
+                       radioButtonPDFcontent.setSelected(true);\r
+@@ -218,14 +188,10 @@
+               return XMP;\r
+       else if (radioButtonPDFcontent.isSelected())\r
+               return CONTENT;\r
+-      else if (radioButtonMrDlib.isSelected())\r
+-              return MRDLIB;\r
+       else if (radioButtonNoMeta.isSelected())\r
+               return NOMETA;\r
+       else if (radioButtononlyAttachPDF.isSelected())\r
+               return ONLYATTACH;\r
+-      else if (radioButtonUpdateEmptyFields.isSelected())\r
+-              return UPDATEEMPTYFIELDS;\r
+       else throw new IllegalStateException();\r
+     }\r
\r
+--- a/src/java/spl/gui/MetaDataListDialog.java
++++ /dev/null
+@@ -1,314 +0,0 @@
+-package spl.gui;\r
+-\r
+-\r
+-import java.awt.BorderLayout;\r
+-import java.awt.CardLayout;\r
+-import java.awt.Color;\r
+-import java.awt.Component;\r
+-import java.awt.Dimension;\r
+-import java.awt.Font;\r
+-import java.awt.event.ActionEvent;\r
+-import java.awt.event.ActionListener;\r
+-import java.awt.event.KeyEvent;\r
+-import java.awt.event.WindowAdapter;\r
+-import java.awt.event.WindowEvent;\r
+-import java.io.File;\r
+-import java.io.IOException;\r
+-import java.util.List;\r
+-import java.util.Vector;\r
+-\r
+-import javax.swing.BorderFactory;\r
+-import javax.swing.ImageIcon;\r
+-import javax.swing.JButton;\r
+-import javax.swing.JComponent;\r
+-import javax.swing.JDialog;\r
+-import javax.swing.JLabel;\r
+-import javax.swing.JOptionPane;\r
+-import javax.swing.JPanel;\r
+-import javax.swing.JScrollPane;\r
+-import javax.swing.JTable;\r
+-import javax.swing.KeyStroke;\r
+-import javax.swing.ListSelectionModel;\r
+-import javax.swing.SwingWorker;\r
+-import javax.swing.table.DefaultTableModel;\r
+-\r
+-import net.sf.jabref.Globals;\r
+-import net.sf.jabref.MetaData;\r
+-import net.sf.jabref.Util;\r
+-\r
+-import org.sciplore.beans.Document;\r
+-\r
+-import spl.DocumentsWrapper;\r
+-import spl.SplWebClient;\r
+-import spl.listener.LabelLinkListener;\r
+-import spl.localization.LocalizationSupport;\r
+-\r
+-import com.jgoodies.forms.builder.ButtonBarBuilder2;\r
+-\r
+-public class MetaDataListDialog extends JDialog {\r
+-    private JPanel contentPane;\r
+-    private JTable tableMetadata;\r
+-    private JButton buttonOK;\r
+-    private JButton buttonCancel;\r
+-    private JScrollPane scrollPane;\r
+-    private JPanel panelWait;\r
+-    private JLabel labelFetch;\r
+-    private JLabel iconLabel;\r
+-    private JButton blankButton;\r
+-    private JLabel labelLogo;\r
+-    private JButton moreInformationButton;\r
+-    private JPanel panelMetadata;\r
+-    private DefaultTableModel tableModel;\r
+-    private int result;\r
+-    private Document xmlDocuments;\r
+-    private String fileName;\r
+-    private SplWebClient.WebServiceStatus webserviceStatus;\r
+-    private Component thisDialog;\r
+-    private boolean showBlankButton;\r
+-    private CardLayout cardLayou = new CardLayout();\r
+-\r
+-    public MetaDataListDialog(String fileName, boolean showBlankButton) {\r
+-        $$$setupUI$$$();\r
+-        this.showBlankButton = showBlankButton;\r
+-        this.thisDialog = this;\r
+-        this.fileName = fileName;\r
+-        this.labelLogo.addMouseListener(new LabelLinkListener(this.labelLogo, "www.mr-dlib.org"));\r
+-        this.setTitle(LocalizationSupport.message("Mr._dLib_Metadata_Entries_Associated_With_PDF_File"));\r
+-        this.tableMetadata.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
+-        setContentPane(contentPane);\r
+-        pack();\r
+-        setModal(true);\r
+-        getRootPane().setDefaultButton(buttonOK);\r
+-\r
+-        buttonOK.addActionListener(new ActionListener() {\r
+-            public void actionPerformed(ActionEvent e) {\r
+-                onOK();\r
+-            }\r
+-        });\r
+-\r
+-        buttonCancel.addActionListener(new ActionListener() {\r
+-            public void actionPerformed(ActionEvent e) {\r
+-                onCancel();\r
+-            }\r
+-        });\r
+-\r
+-        blankButton.addActionListener(new ActionListener() {\r
+-            public void actionPerformed(ActionEvent e) {\r
+-                onBlank();\r
+-            }\r
+-        });\r
+-\r
+-        moreInformationButton.addActionListener(new ActionListener() {\r
+-            public void actionPerformed(ActionEvent e) {\r
+-                onInfo();\r
+-            }\r
+-        });\r
+-\r
+-        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);\r
+-        addWindowListener(new WindowAdapter() {\r
+-            public void windowClosing(WindowEvent e) {\r
+-                onCancel();\r
+-            }\r
+-        });\r
+-\r
+-        contentPane.registerKeyboardAction(new ActionListener() {\r
+-            public void actionPerformed(ActionEvent e) {\r
+-                onCancel();\r
+-            }\r
+-        }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);\r
+-\r
+-        cardLayou.show(panelMetadata, "panelWait");\r
+-        //this.scrollPane.setVisible(false);\r
+-        //this.blankButton.setVisible(false);\r
+-        this.moreInformationButton.setVisible(true);\r
+-        this.setSize(616, 366);\r
+-    }\r
+-\r
+-    private void onInfo() {\r
+-        try {\r
+-            Util.openExternalViewer(new MetaData(), "http://www.mr-dlib.org/docs/jabref_metadata_extraction_alpha.php", "url");\r
+-        } catch (IOException exc) {\r
+-            exc.printStackTrace();\r
+-        }\r
+-    }\r
+-\r
+-    private void onBlank() {\r
+-        this.result = JOptionPane.NO_OPTION;\r
+-        dispose();\r
+-    }\r
+-\r
+-    private void onOK() {\r
+-        this.result = JOptionPane.OK_OPTION;\r
+-        dispose();\r
+-    }\r
+-\r
+-    private void onCancel() {\r
+-        this.result = JOptionPane.CANCEL_OPTION;\r
+-        dispose();\r
+-    }\r
+-\r
+-    public void showDialog() {\r
+-        SwingWorker worker = new SwingWorker<Void, Void>() {\r
+-            @Override\r
+-            public Void doInBackground() {\r
+-                System.out.println("Starting Webclient...");\r
+-                webserviceStatus = SplWebClient.getMetaData(new File(fileName));\r
+-                return null;\r
+-            }\r
+-\r
+-            @Override\r
+-            public void done() {\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.OK) {\r
+-                    xmlDocuments = SplWebClient.metadata;\r
+-                    if (xmlDocuments != null /*&& xmlDocuments.getDocuments() != null && xmlDocuments.getDocuments().size() > 0*/) {\r
+-                        DocumentsWrapper documents = new DocumentsWrapper(xmlDocuments);\r
+-                        List<Vector> vectorList = documents.getDocuments();\r
+-                        for (Vector vector : vectorList) {\r
+-                            tableModel.addRow(vector);\r
+-                        }\r
+-\r
+-                        tableMetadata.getSelectionModel().setSelectionInterval(0, 0);\r
+-                        cardLayou.show(panelMetadata, "scrollPane");\r
+-                        //panelWait.setVisible(false);\r
+-                        //scrollPane.setVisible(true);\r
+-                        moreInformationButton.setVisible(true);\r
+-                    } else {\r
+-                        iconLabel.setVisible(false);\r
+-                        labelFetch.setText(LocalizationSupport.message("No_metadata_found."));\r
+-                        blankButton.setVisible(showBlankButton);\r
+-                    }\r
+-                }\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_METADATA) {\r
+-                    iconLabel.setVisible(false);\r
+-                    labelFetch.setText(LocalizationSupport.message("No_metadata_found."));\r
+-                    blankButton.setVisible(showBlankButton);\r
+-                }\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.UNAVAILABLE) {\r
+-                    iconLabel.setVisible(false);\r
+-                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_unavailable."));\r
+-                    blankButton.setVisible(showBlankButton);\r
+-                }\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.OUTDATED) {\r
+-                    iconLabel.setVisible(false);\r
+-                    labelFetch.setText(LocalizationSupport.message("The_Mr._dLib_web_service_version_you_trying_to_access_is_outdated."));\r
+-                    blankButton.setVisible(showBlankButton);\r
+-                    JOptionPane.showMessageDialog(thisDialog, LocalizationSupport.message("This_JabRef_version_is_trying_to_access_an_old_version_of_Mr._dLib's_webservice_that_is_not_working_any_more.\\nPlease_visit_http://jabref.sourceforge.net_or_http://www.mr-dlib.org_for_more_information_and_updates.\\n\\n\\n"), LocalizationSupport.message("Web_Service_Version_Outdated"), JOptionPane.INFORMATION_MESSAGE);\r
+-                }\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.WEBSERVICE_DOWN) {\r
+-                    iconLabel.setVisible(false);\r
+-                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_down._Please_try_again_later."));\r
+-                    blankButton.setVisible(showBlankButton);\r
+-                }\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_INTERNET) {\r
+-                    iconLabel.setVisible(false);\r
+-                    labelFetch.setText(LocalizationSupport.message("No_Internet_Connection."));\r
+-                    blankButton.setVisible(showBlankButton);\r
+-                    JOptionPane.showMessageDialog(thisDialog, LocalizationSupport.message("You_are_not_connected_to_the_Internet._To_access_Mr._dLib_web_service_an_internet_connection_is_needed."), LocalizationSupport.message("No_Internet_Connection."), JOptionPane.INFORMATION_MESSAGE);\r
+-                }\r
+-            }\r
+-        };\r
+-        worker.execute();\r
+-        this.pack();\r
+-        this.setVisible(true);\r
+-    }\r
+-\r
+-    public Document getXmlDocuments() {\r
+-        return xmlDocuments;\r
+-    }\r
+-\r
+-    private void createUIComponents() {\r
+-        this.tableModel = new MyTableModel();\r
+-        this.tableModel.addColumn(LocalizationSupport.message("Title"));\r
+-        this.tableModel.addColumn(LocalizationSupport.message("Author(s)"));\r
+-        this.tableModel.addColumn(LocalizationSupport.message("Published_Year"));\r
+-        this.tableMetadata = new JTable(this.tableModel);\r
+-    }\r
+-\r
+-    public JTable getTableMetadata() {\r
+-        return tableMetadata;\r
+-    }\r
+-\r
+-    public int getResult() {\r
+-        return result;\r
+-    }\r
+-\r
+-    public JButton getBlankButton() {\r
+-        return blankButton;\r
+-    }\r
+-\r
+-    private void $$$setupUI$$$() {\r
+-        createUIComponents();\r
+-        contentPane = new JPanel();\r
+-        contentPane.setLayout(new BorderLayout());\r
+-        labelLogo = new JLabel();\r
+-        labelLogo.setIcon(new ImageIcon(getClass().getResource("/spl/gui/mrdlib header.png")));\r
+-        labelLogo.setText("");\r
+-        contentPane.add(labelLogo, BorderLayout.NORTH);\r
+-        panelMetadata = new JPanel();\r
+-        panelMetadata.setLayout(cardLayou);\r
+-\r
+-\r
+-        panelMetadata.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null));\r
+-        scrollPane = new JScrollPane();\r
+-        scrollPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), null));\r
+-        tableMetadata.setAutoCreateRowSorter(false);\r
+-        tableMetadata.setEnabled(true);\r
+-        tableMetadata.setFillsViewportHeight(true);\r
+-        tableMetadata.setShowVerticalLines(true);\r
+-        scrollPane.setViewportView(tableMetadata);\r
+-        panelMetadata.add(scrollPane, "scrollPane");\r
+-        panelWait = new JPanel();\r
+-        panelWait.setLayout(new BorderLayout());\r
+-        panelWait.setBackground(new Color(-1));\r
+-        panelMetadata.add(panelWait, "panelWait");\r
+-        panelWait.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), null));\r
+-        iconLabel = new JLabel();\r
+-        iconLabel.setBackground(new Color(-1));\r
+-        iconLabel.setHorizontalAlignment(0);\r
+-        iconLabel.setHorizontalTextPosition(11);\r
+-        iconLabel.setIcon(new ImageIcon(getClass().getResource("/spl/gui/ajax-loader.gif")));\r
+-        iconLabel.setText("");\r
+-        panelWait.add(iconLabel, BorderLayout.CENTER);\r
+-        labelFetch = new JLabel();\r
+-        labelFetch.setHorizontalAlignment(JLabel.CENTER);\r
+-        labelFetch.setFont(new Font(labelFetch.getFont().getName(), labelFetch.getFont().getStyle(), 13));\r
+-        labelFetch.setText(Globals.lang("Fetching Metadata..."));\r
+-        panelWait.add(labelFetch, BorderLayout.SOUTH);\r
+-\r
+-        cardLayou.show(panelMetadata, "panelWait");\r
+-        panelMetadata.setPreferredSize(new Dimension(400, 200));\r
+-        contentPane.add(panelMetadata, BorderLayout.CENTER);\r
+-\r
+-        buttonOK = new JButton(Globals.lang("Ok"));\r
+-        buttonCancel = new JButton(Globals.lang("Cancel"));\r
+-        moreInformationButton = new JButton(Globals.lang("More information"));\r
+-        ButtonBarBuilder2 bb = new ButtonBarBuilder2();\r
+-        bb.addGlue();\r
+-        bb.addButton(moreInformationButton);\r
+-        bb.addButton(buttonOK);\r
+-        bb.addButton(buttonCancel);\r
+-        bb.addGlue();\r
+-        blankButton = new JButton();\r
+-        blankButton.setText("");\r
+-        contentPane.add(bb.getPanel(), BorderLayout.SOUTH);\r
+-        iconLabel.setLabelFor(scrollPane);\r
+-\r
+-\r
+-    }\r
+-\r
+-    /**\r
+-     * @noinspection ALL\r
+-     */\r
+-    public JComponent $$$getRootComponent$$$() {\r
+-        return contentPane;\r
+-    }\r
+-\r
+-    public class MyTableModel extends DefaultTableModel {\r
+-\r
+-        @Override\r
+-        public boolean isCellEditable(int row, int column) {\r
+-            return false;\r
+-        }\r
+-    }\r
+-\r
+-}\r
index 1910d20..a9d094f 100644 (file)
@@ -1 +1,2 @@
 02_libs.patch
+mrDlib.patch