Drop fix-headless-bibtex-output.diff, refresh other patches.
authorgregor herrmann <gregoa@debian.org>
Tue, 19 May 2015 18:31:17 +0000 (20:31 +0200)
committergregor herrmann <gregoa@debian.org>
Tue, 19 May 2015 18:31:17 +0000 (20:31 +0200)
debian/patches/debian_libs.patch
debian/patches/fix-headless-bibtex-output.diff [deleted file]
debian/patches/generated_JabRefPlugin.java.patch
debian/patches/mrDlib_jayatana.patch
debian/patches/series

index 737032d..a44b825 100644 (file)
@@ -3,24 +3,24 @@ Forwarded: not needed
 Author: Gerardo Curiel <gerardo@sophie.gerardo.com.ve>,
  Philip Rinn <rinni@gmx.net>
 Reviewed-by: gregor herrmann <gregoa@debian.org>
 Author: Gerardo Curiel <gerardo@sophie.gerardo.com.ve>,
  Philip Rinn <rinni@gmx.net>
 Reviewed-by: gregor herrmann <gregoa@debian.org>
-Last-Update: 2013-01-01
+Last-Update: 2015-05-19
 
 --- a/build.xml
 +++ b/build.xml
 
 --- a/build.xml
 +++ b/build.xml
-@@ -76,8 +76,10 @@
-       <property name="help.dir" value="${src.dir}/help" />
-       <property name="extensions.dir" value="${src.dir}/extensions" />
-       <property name="layout.dir" value="${src.dir}/resource/layout" />
+@@ -71,8 +71,10 @@
+       <property name="help.dir" value="${resources.dir}/help" />
+       <property name="extensions.dir" value="${resources.dir}/extensions" />
+       <property name="layout.dir" value="${resources.dir}/resource/layout" />
 -      <property name="lib.dir" value="lib" />
 -      <property name="buildlib.dir" value="buildlib" />
 +      <property name="lib.dir" value="/usr/share/java" />
 +      <property name="oo.dir" value="/usr/lib/libreoffice/program/classes" />
 +      <property name="ure.dir" value="/usr/lib/ure/share/java" />
 +      <property name="buildlib.dir" value="/usr/share/java" />
 -      <property name="lib.dir" value="lib" />
 -      <property name="buildlib.dir" value="buildlib" />
 +      <property name="lib.dir" value="/usr/share/java" />
 +      <property name="oo.dir" value="/usr/lib/libreoffice/program/classes" />
 +      <property name="ure.dir" value="/usr/lib/ure/share/java" />
 +      <property name="buildlib.dir" value="/usr/share/java" />
-       <property name="tests.dir" value="${src.dir}/tests" />
  
        <property name="osxbin.dir" value="osx" />
  
        <property name="osxbin.dir" value="osx" />
-@@ -102,33 +104,35 @@
+@@ -96,36 +98,37 @@
  
        <fileset id="jarsFileset" dir="${lib.dir}">
                <include name="antlr.jar" />
  
        <fileset id="jarsFileset" dir="${lib.dir}">
                <include name="antlr.jar" />
@@ -28,12 +28,15 @@ Last-Update: 2013-01-01
 -        <include name="jgoodies-common-1.4.0.jar" />
 -              <include name="jgoodies-looks-2.5.2.jar" />
 -              <include name="jgoodies-forms-1.6.0.jar" />
 -        <include name="jgoodies-common-1.4.0.jar" />
 -              <include name="jgoodies-looks-2.5.2.jar" />
 -              <include name="jgoodies-forms-1.6.0.jar" />
--              <include name="jayatana-1.2.4.jar" />
 +              <include name="antlr3.jar" />
 +              <include name="antlr3.jar" />
-+              <include name="antlr3-runtime.jar" />
 +        <include name="jgoodies-common.jar" />
 +              <include name="jgoodies-looks.jar" />
 +              <include name="jgoodies-forms.jar" />
 +        <include name="jgoodies-common.jar" />
 +              <include name="jgoodies-looks.jar" />
 +              <include name="jgoodies-forms.jar" />
+         <include name="jgoodies/jgoodies-uif-lite.jar" />
+-        <include name="jna-4.1.0.jar" />
++        <include name="jna.jar" />
+         <include name="ritopt/ritopt-0.2.1-bin.jar" />
+-              <include name="jayatana-1.2.4.jar" />
                <include name="spin.jar" />
 -              <include name="glazedlists-1.8.0_java15.jar" />
 +              <include name="glazedlists.jar" />
                <include name="spin.jar" />
 -              <include name="glazedlists-1.8.0_java15.jar" />
 +              <include name="glazedlists.jar" />
@@ -76,27 +79,15 @@ Last-Update: 2013-01-01
      </fileset>
  
      <!-- Done by MrDlib -->
      </fileset>
  
      <!-- Done by MrDlib -->
-@@ -151,14 +155,15 @@
+@@ -146,6 +149,7 @@
          <!-- Done by MrDlib -->
                <fileset refid="jarsFileset" />
          <fileset refid="ooFileset" />
 +        <fileset refid="ureFileset" />
        </path>
  
          <!-- Done by MrDlib -->
                <fileset refid="jarsFileset" />
          <fileset refid="ooFileset" />
 +        <fileset refid="ureFileset" />
        </path>
  
-       <!-- Classpath for running the code generator -->
-       <path id="codegenerator">
--              <pathelement location="${lib.dir}/plugin/JPFCodeGenerator.jar" />
--              <pathelement location="${lib.dir}/plugin/jpf.jar" />
--              <pathelement location="${lib.dir}/plugin/jpf-boot.jar" />
--              <pathelement location="${lib.dir}/plugin/velocity-dep-1.5.jar" />
-+              <pathelement location="${lib.dir}/JPFCodeGenerator.jar" />
-+              <pathelement location="${lib.dir}/jpf.jar" />
-+              <pathelement location="${lib.dir}/jpf-boot.jar" />
-+              <pathelement location="${lib.dir}/velocity.jar" />
-       </path>
-       <!-- Classpath for tests -->
-@@ -238,7 +243,7 @@
+       <target name="run" depends="build">
+@@ -188,7 +192,7 @@
        </target>
  
        <!-- Jars up project -->
        </target>
  
        <!-- Jars up project -->
@@ -105,12 +96,12 @@ Last-Update: 2013-01-01
                <mkdir dir="${build.lib}" />
  
                <mkdir dir="${build.tmp}" />
                <mkdir dir="${build.lib}" />
  
                <mkdir dir="${build.tmp}" />
-@@ -645,8 +650,6 @@
-               </jalopy>
-       </target>
+@@ -510,8 +514,6 @@
+          Auxiliary targets
+         +++++++++++++++++++++++++++++++++++++++++++++++++-->
  
 -      <taskdef name="jarbundler" classpath="${buildlib.dir}/jarbundler-2.2.0.jar" classname="net.sourceforge.jarbundler.JarBundler" />
 -
  
 -      <taskdef name="jarbundler" classpath="${buildlib.dir}/jarbundler-2.2.0.jar" classname="net.sourceforge.jarbundler.JarBundler" />
 -
-       <target name="compresssrc">
-               <!-- clone current repo into tmp dir. Reason: we want to have a clean src.zip, but do not want to execute "git clean -xdf" to allow developers having some temporary files (and user.properties) -->
-               <mkdir dir="${temp.dir}"/>
+       <macrodef name="compresssrc">
+         <attribute name="git-core-autocrlf" />
+         <attribute name="temp-dir" />
diff --git a/debian/patches/fix-headless-bibtex-output.diff b/debian/patches/fix-headless-bibtex-output.diff
deleted file mode 100644 (file)
index 41c0710..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Description: fix headless BibTeX output
-Origin: vendor
-Bug: http://sourceforge.net/p/jabref/bugs/1228/
-Bug-Debian: https://bugs.debian.org/723100
-Forwarded: http://sourceforge.net/p/jabref/bugs/1228/
-Author: Vincent Fourmond <fourmond@debian.org>
-Reviewed-by: gregor herrmann <gregoa@debian.org>
-Last-Update: 2014-05-07
-
---- a/src/java/net/sf/jabref/BibtexEntry.java
-+++ b/src/java/net/sf/jabref/BibtexEntry.java
-@@ -105,13 +105,13 @@
-         }
-         String suffix = "";
--              if (JabRef.jrf.prefs.getBoolean(JabRefPreferences.WRITEFIELD_ADDSPACES)) {
-+              if (JabRefPreferences.getInstance().getBoolean(JabRefPreferences.WRITEFIELD_ADDSPACES)) {
-                       for (int i = maxFieldLength - field.length(); i > 0; i--)
-                               suffix += " ";
-               }
-               String res;
--              if (JabRef.jrf.prefs.getBoolean(JabRefPreferences.WRITEFIELD_CAMELCASENAME)) {
-+              if (JabRefPreferences.getInstance().getBoolean(JabRefPreferences.WRITEFIELD_CAMELCASENAME)) {
-                       if (tagDisplayNameMap.containsKey(field.toLowerCase())) {
-                               res = tagDisplayNameMap.get(field.toLowerCase()) + suffix;
-                       } else {
index a246437..831c854 100644 (file)
@@ -2,10 +2,10 @@ Description: file was removed in 2.9.1 but doesn't get generated either ...
 Origin: vendor
 Forwarded: info via mail
 Author: gregor herrmann <gregoa@debian.org>
 Origin: vendor
 Forwarded: info via mail
 Author: gregor herrmann <gregoa@debian.org>
-Last-Update: 2013-01-01
+Last-Update: 2015-05-19
 
 --- /dev/null
 
 --- /dev/null
-+++ b/src/java/net/sf/jabref/plugin/core/generated/_JabRefPlugin.java
++++ b/src/main/java/net/sf/jabref/plugin/core/generated/_JabRefPlugin.java
 @@ -0,0 +1,360 @@
 +package net.sf.jabref.plugin.core.generated;\r
 +\r
 @@ -0,0 +1,360 @@
 +package net.sf.jabref.plugin.core.generated;\r
 +\r
index 39a7e83..610cde8 100644 (file)
@@ -6,44 +6,10 @@ Origin: upstream git
 Forwarded: not-needed
 Author: Oliver Kopp <oliver.kopp@gmail.com>
 Reviewed-by: gregor herrmann <gregoa@debian.org>
 Forwarded: not-needed
 Author: Oliver Kopp <oliver.kopp@gmail.com>
 Reviewed-by: gregor herrmann <gregoa@debian.org>
-Last-Update: 2014-03-12
+Last-Update: 2015-05-19
 
 
---- a/.classpath
-+++ b/.classpath
-@@ -11,8 +11,6 @@
-       <classpathentry exported="true" kind="lib" path="lib/plugin/JPFCodeGenerator-rt.jar" sourcepath="/JPFCodeGenerator/src"/>
-       <classpathentry exported="true" kind="lib" path="lib/glazedlists-1.8.0_java15.jar"/>
-       <classpathentry kind="lib" path="lib/mysql-connector-java-5.0.7-bin.jar"/>
--      <classpathentry kind="lib" path="lib/spl/sciplore/xstream-1.4.1.jar"/>
--      <classpathentry kind="lib" path="lib/spl/sciplore/mrDlib-serialization-api.jar" sourcepath="/Serialization API"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
-               <accessrules>
-                       <accessrule kind="accessible" pattern="**"/>
-@@ -21,14 +19,10 @@
-       <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-       <classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/resources"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/sciplore"/>
--      <classpathentry kind="lib" path="lib/spl/jersey/mimepull-1.3.jar"/>
-       <classpathentry kind="lib" path="lib/oo/juh.jar"/>
-       <classpathentry kind="lib" path="lib/oo/jurt.jar"/>
-       <classpathentry kind="lib" path="lib/oo/ridl.jar"/>
-       <classpathentry kind="lib" path="lib/oo/unoil.jar"/>
--      <classpathentry kind="lib" path="lib/spl/jersey/jersey-client-1.14.jar"/>
--      <classpathentry kind="lib" path="lib/spl/jersey/jersey-core-1.14.jar"/>
--      <classpathentry kind="lib" path="lib/spl/jersey/jersey-multipart-1.14.jar"/>
-       <classpathentry kind="lib" path="lib/antlr-3.4-complete.jar"/>
-       <classpathentry kind="lib" path="lib/jgoodies-common-1.4.0.jar"/>
-       <classpathentry kind="lib" path="lib/jgoodies-forms-1.6.0.jar"/>
-@@ -36,7 +30,6 @@
-       <classpathentry kind="lib" path="lib/fontbox-1.7.1.jar"/>
-       <classpathentry kind="lib" path="lib/jempbox-1.7.1.jar"/>
-       <classpathentry kind="lib" path="lib/pdfbox-1.7.1.jar"/>
--      <classpathentry kind="lib" path="lib/jayatana-1.2.4.jar"/>
-       <classpathentry kind="lib" path="lib/postgresql-9.2-1002.jdbc4.jar"/>
-       <classpathentry kind="output" path="bin"/>
- </classpath>
---- a/src/java/net/sf/jabref/ImportSettingsTab.java
-+++ b/src/java/net/sf/jabref/ImportSettingsTab.java
+--- a/src/main/java/net/sf/jabref/ImportSettingsTab.java
++++ b/src/main/java/net/sf/jabref/ImportSettingsTab.java
 @@ -44,10 +44,8 @@
        
      private JRadioButton radioButtonXmp;
 @@ -44,10 +44,8 @@
        
      private JRadioButton radioButtonXmp;
@@ -119,15 +85,15 @@ Last-Update: 2014-03-12
                Globals.prefs.putInt(PREF_IMPORT_DEFAULT_PDF_IMPORT_STYLE, style);
                Globals.prefs.put(PREF_IMPORT_FILENAMEPATTERN, fileNamePattern.getText());
        }
                Globals.prefs.putInt(PREF_IMPORT_DEFAULT_PDF_IMPORT_STYLE, style);
                Globals.prefs.put(PREF_IMPORT_FILENAMEPATTERN, fileNamePattern.getText());
        }
---- a/src/java/net/sf/jabref/JabRefFrame.java
-+++ b/src/java/net/sf/jabref/JabRefFrame.java
+--- a/src/main/java/net/sf/jabref/JabRefFrame.java
++++ b/src/main/java/net/sf/jabref/JabRefFrame.java
 @@ -1,4 +1,4 @@
 -/*  Copyright (C) 2003-2012 JabRef contributors.
 +/*  Copyright (C) 2003-2011 JabRef contributors.
      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation; either version 2 of the License, or
 @@ -1,4 +1,4 @@
 -/*  Copyright (C) 2003-2012 JabRef contributors.
 +/*  Copyright (C) 2003-2011 JabRef contributors.
      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation; either version 2 of the License, or
-@@ -40,8 +40,6 @@
+@@ -39,8 +39,6 @@
  import javax.swing.event.ChangeEvent;
  import javax.swing.event.ChangeListener;
  
  import javax.swing.event.ChangeEvent;
  import javax.swing.event.ChangeListener;
  
@@ -136,7 +102,7 @@ Last-Update: 2014-03-12
  import net.sf.jabref.export.*;
  import net.sf.jabref.external.ExternalFileTypeEditor;
  import net.sf.jabref.external.PushToApplicationButton;
  import net.sf.jabref.export.*;
  import net.sf.jabref.external.ExternalFileTypeEditor;
  import net.sf.jabref.external.PushToApplicationButton;
-@@ -562,13 +560,6 @@
+@@ -574,13 +572,6 @@
                  }
              }
          });
                  }
              }
          });
@@ -150,1215 +116,1164 @@ Last-Update: 2014-03-12
      }
  
      public void setWindowTitle() {
      }
  
      public void setWindowTitle() {
---- 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
+--- a/src/main/java/spl/PdfImporter.java
++++ b/src/main/java/spl/PdfImporter.java
 @@ -19,12 +19,8 @@
 @@ -19,12 +19,8 @@
- 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
\r
- /**\r
-  * Created by IntelliJ IDEA.\r
+ import net.sf.jabref.undo.UndoableInsertEntry;
+ import net.sf.jabref.util.XMPUtil;
+-import org.sciplore.beans.Document;
+-
+ import spl.filter.PdfFileFilter;
+ import spl.gui.ImportDialog;
+-import spl.gui.MetaDataListDialog;
+-
+ /**
+  * Created by IntelliJ IDEA.
 @@ -129,7 +125,6 @@
 @@ -129,7 +125,6 @@
-               BibtexEntryType type;\r
-                 InputStream in = null;\r
-                 List<BibtexEntry> localRes = null;\r
--              MetaDataListDialog metaDataListDialog;\r
-                 switch (choice) {\r
-                       case ImportDialog.XMP:\r
-                     //SplDatabaseChangeListener dataListener = new SplDatabaseChangeListener(frame, panel, entryTable, fileName);\r
+               BibtexEntryType type;
+                 InputStream in = null;
+                 List<BibtexEntry> localRes = null;
+-              MetaDataListDialog metaDataListDialog;
+                 switch (choice) {
+                       case ImportDialog.XMP:
+                     //SplDatabaseChangeListener dataListener = new SplDatabaseChangeListener(frame, panel, entryTable, fileName);
 @@ -222,88 +217,10 @@
 @@ -222,88 +217,10 @@
-                     }\r
-                     res.add(entry);\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
--                    entry = null; // to satisfy the Java compiler\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
--                            entry = createNewBlankEntry(fileName);\r
--                        }\r
--                    }\r
--                    else if(metaDataListDialog.getResult() == JOptionPane.CANCEL_OPTION ){\r
--                        continue;\r
--                    }\r
--                    else if(metaDataListDialog.getResult() == JOptionPane.NO_OPTION ){\r
--                        entry = createNewBlankEntry(fileName);\r
--                    }\r
--                    else if(document == null /*|| document.getDocuments() == null || document.getDocuments().size() <= 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
--                        entry = createNewBlankEntry(fileName);\r
--                    }\r
--                    assert(entry != null);\r
--                    res.add(entry);\r
--                    break;\r
-                       case ImportDialog.NOMETA:\r
-                     entry = createNewBlankEntry(fileName);\r
-                     res.add(entry);\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
+                     }
+                     res.add(entry);
+                     break;
+-                      case ImportDialog.MRDLIB:
+-                    metaDataListDialog = new MetaDataListDialog(fileName, true);
+-                    Tools.centerRelativeToWindow(metaDataListDialog, frame);
+-                    metaDataListDialog.showDialog();
+-                    Document document = metaDataListDialog.getXmlDocuments();
+-                    entry = null; // to satisfy the Java compiler
+-                    if(document != null /*&& documents.getDocuments() != null && documents.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){
+-                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();
+-                        if(selected > -1 /*&& selected < documents.getDocuments().size()*/){
+-                            //Document document = documents/*.getDocuments().get(selected)*/;
+-                            String id = Util.createNeutralId();
+-                            entry = new BibtexEntry(id);
+-                            if(fieldExists(document.getType())){
+-                                type = BibtexEntryType.getStandardType(document.getType());
+-                                if(type == null){
+-                                    type = BibtexEntryType.ARTICLE;
+-                                }
+-                                entry.setType(type);
+-                            }
+-                            else{
+-                                entry.setType(BibtexEntryType.ARTICLE);
+-                            }
+-                            ArrayList<BibtexEntry> list = new ArrayList<BibtexEntry>();
+-                            list.add(entry);
+-                            Util.setAutomaticFields(list, true, true, false);
+-                            //insertFields(entry.getRequiredFields(), entry, document);
+-                            insertFields(BibtexFields.getAllFieldNames(), entry, document);
+-                            //insertFields(entry.getOptionalFields(), entry, document);
+-                            panel.database().insertEntry(entry);
+-                            dfh = new DroppedFileHandler(frame, panel);
+-                            dfh.linkPdfToEntry(fileName, entryTable, entry);
+-                            LabelPatternUtil.makeLabel(panel.metaData(), panel.database(), entry);
+-                        }
+-                        else{
+-                            entry = createNewBlankEntry(fileName);
+-                        }
+-                    }
+-                    else if(metaDataListDialog.getResult() == JOptionPane.CANCEL_OPTION ){
+-                        continue;
+-                    }
+-                    else if(metaDataListDialog.getResult() == JOptionPane.NO_OPTION ){
+-                        entry = createNewBlankEntry(fileName);
+-                    }
+-                    else if(document == null /*|| document.getDocuments() == null || document.getDocuments().size() <= 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){
+-                        entry = createNewBlankEntry(fileName);
+-                    }
+-                    assert(entry != null);
+-                    res.add(entry);
+-                    break;
+                       case ImportDialog.NOMETA:
+                     entry = createNewBlankEntry(fileName);
+                     res.add(entry);
+                     break;
+-                      case ImportDialog.UPDATEEMPTYFIELDS:
+-                    metaDataListDialog = new MetaDataListDialog(fileName, false);                   
+-                    Tools.centerRelativeToWindow(metaDataListDialog, frame);
+-                    metaDataListDialog.showDialog();
+-                    document = metaDataListDialog.getXmlDocuments();
+-                    if(document != null /*&& document.getDocuments() != null && document.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){
+-                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();
+-                        if(selected > -1 /*&& selected < document.getDocuments().size()*/){
+-                            //XmlDocument document = documents.getDocuments().get(selected);
+-                            entry = entryTable.getEntryAt(dropRow);
+-                            if(fieldExists(document.getType())){
+-                                type = BibtexEntryType.getStandardType(document.getType());
+-                                if(type != null){
+-                                    entry.setType(type);
+-                                }
+-                            }
+-                            //insertFields(entry.getRequiredFields(), entry, document);
+-                            insertFields(BibtexFields.getAllFieldNames(), entry, document);
+-                            //insertFields(entry.getOptionalFields(), entry, document);
+-
+-                            dfh = new DroppedFileHandler(frame, panel);
+-                            dfh.linkPdfToEntry(fileName, entryTable, dropRow);
+-                        }
+-                    }
+-                    break;
+-                      case ImportDialog.ONLYATTACH:
+-                    dfh = new DroppedFileHandler(frame, panel);
+-                    dfh.linkPdfToEntry(fileName, entryTable, dropRow);
+-                    break;
+                 }
+             }
 @@ -322,58 +239,6 @@
 @@ -322,58 +239,6 @@
-         return newEntry;\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 String fileName;\r
-     // indicates whether the drop target is a row in the table or whether other kinds of imports are used\r
-@@ -72,15 +66,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
-@@ -90,12 +76,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
-@@ -113,8 +95,6 @@
\r
-         if (!this.targetIsARow) {\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
-@@ -123,8 +103,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
-@@ -135,9 +113,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
-@@ -174,15 +150,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
-@@ -217,14 +187,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.ButtonBarBuilder;\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."), 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
--        ButtonBarBuilder bb = new ButtonBarBuilder();\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
+         return newEntry;
+     }
+-    private void insertFields(String[] fields, BibtexEntry entry, Document xmlDocument) {
+-        DocumentWrapper document = new DocumentWrapper(xmlDocument);
+-        for(String field : fields){
+-            if(entry.getField(field) != null){
+-                continue;
+-            }
+-            if(field.equalsIgnoreCase("author")){
+-                entry.setField(field, document.getAuthors("and"));
+-            }
+-            if(field.equalsIgnoreCase("title")){
+-                entry.setField(field, document.getTitle());
+-            }
+-            if(field.equalsIgnoreCase("abstract")){
+-                entry.setField(field, document.getAbstract());
+-            }
+-            /*if(field.equalsIgnoreCase("keywords")){
+-                entry.setField(field, document.getKeyWords());
+-            }*/
+-            if(field.equalsIgnoreCase("doi")){
+-                entry.setField(field, document.getDoi());
+-            }
+-            /*if(field.equalsIgnoreCase("pages")){
+-                entry.setField(field, document.getPages());
+-            }
+-            if(field.equalsIgnoreCase("volume")){
+-                entry.setField(field, document.getVolume());
+-            }
+-            if(field.equalsIgnoreCase("number")){
+-                entry.setField(field, document.getNumber());
+-            }*/
+-            if(field.equalsIgnoreCase("year")){
+-                entry.setField(field, document.getYear());
+-            }
+-            /*if(field.equalsIgnoreCase("month")){
+-                entry.setField(field, document.getMonth());
+-            }
+-            if(field.equalsIgnoreCase("day")){
+-                entry.setField(field, document.getDay());
+-            }
+-            if(field.equalsIgnoreCase("booktitle")){
+-                entry.setField(field, document.getVenue());
+-            }
+-            if(field.equalsIgnoreCase("journal")){
+-                entry.setField(field, document.getVenue());
+-            }*/
+-        }
+-    }
+-
+-    private boolean fieldExists(String string) {
+-        return string != null && !string.isEmpty();
+-    }
+-
+     private BibtexEntry createNewEntry() {
+         // Find out what type is wanted.
+--- a/src/main/java/spl/gui/ImportDialog.java
++++ b/src/main/java/spl/gui/ImportDialog.java
+@@ -17,19 +17,15 @@
+       public final static int NOMETA = 0;
+       public final static int XMP = 1;
+       public final static int CONTENT = 2;
+-      public final static int MRDLIB = 3;
+       public final static int ONLYATTACH = 4;
+-      public final static int UPDATEEMPTYFIELDS = 5;
+       
+     private JPanel contentPane;
+     private JCheckBox checkBoxDoNotShowAgain;
+       private JCheckBox useDefaultPDFImportStyle;
+     private JRadioButton radioButtonXmp;
+       private JRadioButton radioButtonPDFcontent;
+-    private JRadioButton radioButtonMrDlib;
+     private JRadioButton radioButtonNoMeta;
+     private JRadioButton radioButtononlyAttachPDF;
+-    private JRadioButton radioButtonUpdateEmptyFields;
+     private int result;
+     public ImportDialog(boolean targetIsARow, String fileName) {
+@@ -59,15 +55,7 @@
+         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"));
+         radioButtononlyAttachPDF = new JRadioButton(Globals.lang("Only_attach_PDF"));
+-        radioButtonUpdateEmptyFields = new JRadioButton(Globals.lang("Update_empty_fields_with_data_fetched_from"));
+-        JLabel labelMrDlib1 = new JLabel("Mr._dLib");
+-        labelMrDlib1.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));
+-        labelMrDlib1.setForeground(new Color(-16776961));
+-        JLabel labelMrDlib2 = new JLabel("Mr._dLib");
+-        labelMrDlib2.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));
+-        labelMrDlib2.setForeground(new Color(-16776961));
+         JButton buttonOK = new JButton(Globals.lang("Ok"));
+         JButton buttonCancel = new JButton(Globals.lang("Cancel"));
+         checkBoxDoNotShowAgain = new JCheckBox(Globals.lang("Do not show this box again for this import"));
+@@ -77,12 +65,8 @@
+         b.append(radioButtonNoMeta, 3);
+         b.append(radioButtonXmp, 3);
+         b.append(radioButtonPDFcontent, 3);
+-        b.append(radioButtonMrDlib);
+-        b.append(labelMrDlib1);
+         b.appendSeparator(Globals.lang("Update_Existing_Entry"));
+         b.append(radioButtononlyAttachPDF, 3);
+-        b.append(radioButtonUpdateEmptyFields);
+-        b.append(labelMrDlib2);
+         b.nextLine();
+         b.append(checkBoxDoNotShowAgain);
+         b.append(useDefaultPDFImportStyle);
+@@ -100,8 +84,6 @@
+         if (!targetIsARow1) {
+             this.radioButtononlyAttachPDF.setEnabled(false);
+-            this.radioButtonUpdateEmptyFields.setEnabled(false);
+-            labelMrDlib2.setEnabled(false);
+         }
+         String fileName1 = fileName;
+         String name = new File(fileName1).getName();
+@@ -110,8 +92,6 @@
+         } else {
+             labelFileName.setText(new File(fileName1).getName().substring(0, 33) + "...");
+         }
+-        labelMrDlib1.addMouseListener(new LabelLinkListener(labelMrDlib1, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));
+-        labelMrDlib2.addMouseListener(new LabelLinkListener(labelMrDlib2, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));
+         this.setTitle(LocalizationSupport.message("Import_Metadata_From_PDF"));
+         setModal(true);
+@@ -122,9 +102,7 @@
+         bg.add(radioButtonNoMeta);
+         bg.add(radioButtonXmp);
+         bg.add(radioButtonPDFcontent);
+-        bg.add(radioButtonMrDlib);
+         bg.add(radioButtononlyAttachPDF);
+-        bg.add(radioButtonUpdateEmptyFields);
+         buttonOK.addActionListener(new ActionListener() {
+             public void actionPerformed(ActionEvent e) {
+@@ -161,15 +139,9 @@
+               case CONTENT:
+                       radioButtonPDFcontent.setSelected(true);
+                       break;
+-              case MRDLIB:
+-                      radioButtonMrDlib.setSelected(true);
+-                      break;
+               case ONLYATTACH:
+                       radioButtononlyAttachPDF.setSelected(true);
+                       break;
+-              case UPDATEEMPTYFIELDS:
+-                      radioButtonUpdateEmptyFields.setSelected(true);
+-                      break;
+               default:
+                       // fallback
+                       radioButtonPDFcontent.setSelected(true);
+@@ -204,14 +176,10 @@
+               return XMP;
+       else if (radioButtonPDFcontent.isSelected())
+               return CONTENT;
+-      else if (radioButtonMrDlib.isSelected())
+-              return MRDLIB;
+       else if (radioButtonNoMeta.isSelected())
+               return NOMETA;
+       else if (radioButtononlyAttachPDF.isSelected())
+               return ONLYATTACH;
+-      else if (radioButtonUpdateEmptyFields.isSelected())
+-              return UPDATEEMPTYFIELDS;
+       else throw new IllegalStateException();
+     }
+--- a/src/main/java/spl/DocumentWrapper.java
++++ b/src/main/java/spl/DocumentWrapper.java
+@@ -1,244 +0,0 @@
+-package spl;
+-
+-import java.util.List;
+-
+-import org.sciplore.beans.Abstract;
+-import org.sciplore.beans.Author;
+-import org.sciplore.beans.Document;
+-import org.sciplore.formatter.Bean;
+-import org.sciplore.formatter.SimpleTypeElementBean;
+-
+-/**
+- * Created by IntelliJ IDEA.
+- * User: Christoph Arbeit
+- * Date: 10.09.2010
+- * Time: 20:02:51
+- * To change this template use File | Settings | File Templates.
+- */
+-public class DocumentWrapper {
+-
+-    Document xmlDocument;
+-
+-    public DocumentWrapper(Document xmlDocument) {
+-        this.xmlDocument = xmlDocument;
+-    }
+-
+-    public Document getXmlDocument() {
+-        return xmlDocument;
+-    }
+-
+-    public void setXmlDocument(Document xmlDocument) {
+-        this.xmlDocument = xmlDocument;
+-    }
+-
+-    public String getTitle(){
+-        if(this.hasTitle()){
+-            return xmlDocument.getTitle().getValue();
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasTitle(){
+-        return (xmlDocument.getTitle() != null && xmlDocument.getTitle().getValue() != null && !xmlDocument.getTitle().getValue().isEmpty());
+-    }
+-
+-    public String getAbstract(){
+-        if(this.hasAbstract()){
+-            return ((Abstract)xmlDocument.getAbstract()).getValue();
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasAbstract(){
+-        return (xmlDocument.getAbstract() != null && ((Abstract)xmlDocument.getAbstract()).getValue() != null && !((Abstract)xmlDocument.getAbstract()).getValue().isEmpty());
+-    }
+-
+-   public String getAuthors(String seperator){
+-        if(this.hasAuthors()){
+-              List<Bean> authors = xmlDocument.getAuthors().getCollection();
+-            authors = DocumentsWrapper.sortAuthors(authors);
+-            String value = "";
+-            int i = 1;
+-            for(Bean author : authors){
+-                if(i < authors.size()){
+-                    value = value + getNameComplete((Author)author);
+-                    value = value + " " + seperator + " ";
+-                }
+-                else{
+-                    value = value + getNameComplete((Author)author);
+-                }
+-                i++;
+-            }
+-            return value;
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasAuthors(){
+-        return (xmlDocument.getAuthors() != null && xmlDocument.getAuthors().getCollection() != null && !xmlDocument.getAuthors().getCollection().isEmpty());
+-    }
+-
+-    /* public String getKeyWords(){
+-        if(this.hasKeyWords()){
+-            List<XmlKeyword> keywords = xmlDocument.getKeywords().getKeywords();
+-            String value = "";
+-            int i = 1;
+-            for(XmlKeyword keyword : keywords){
+-                if(i < keywords.size()){
+-                    value = value + keyword.getValue();
+-                    value = value + ", ";
+-                }
+-                else{
+-                    value = value + keyword.getValue();
+-                }
+-                i++;
+-            }
+-            return value;
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasKeyWords(){
+-        return (xmlDocument.getKeywords() != null && xmlDocument.getKeywords().getKeywords() != null && !xmlDocument.getKeywords().getKeywords().isEmpty());
+-    }
+-*/
+-
+-    public String getDoi(){
+-        if(this.hasDoi()){
+-            return this.getSimpleTypeValue(xmlDocument.getDoi());
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasDoi(){
+-        return (xmlDocument.getDoi() != null && this.getSimpleTypeValue(xmlDocument.getDoi()) != null && !this.getSimpleTypeValue(xmlDocument.getDoi()).isEmpty());
+-    }
+-/*
+-    public String getPages(){
+-        if(this.hasPages()){
+-            return xmlDocument.getPages().getValue();
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasPages(){
+-        return (xmlDocument.getPages() != null && xmlDocument.getPages().getValue() != null && !xmlDocument.getPages().getValue().isEmpty());
+-    }
+-
+-    public String getVolume(){
+-        if(this.hasVolume()){
+-            return xmlDocument.getVolume().getValue();
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasVolume(){
+-        return (xmlDocument.getVolume() != null && xmlDocument.getVolume().getValue() != null && !xmlDocument.getVolume().getValue().isEmpty());
+-    }
+-
+-    public String getNumber(){
+-        if(this.hasNumber()){
+-            return xmlDocument.getNumber().getValue();
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasNumber(){
+-        return (xmlDocument.getNumber() != null && xmlDocument.getNumber().getValue() != null && !xmlDocument.getNumber().getValue().isEmpty());
+-    }
+-*/
+-    
+-    public String getYear(){
+-        if(this.hasYear()){
+-            return this.getSimpleTypeValue(xmlDocument.getYear());
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasYear(){
+-        return (this.getSimpleTypeValue(xmlDocument.getYear()) != null && !this.getSimpleTypeValue(xmlDocument.getYear()).isEmpty() && !this.getSimpleTypeValue(xmlDocument.getYear()).equalsIgnoreCase("null"));
+-    }
+-    
+-/*
+-     public String getMonth(){
+-        if(this.hasMonth()){
+-            return xmlDocument.getPublishdate().getMonth();
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasMonth(){
+-        return (xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getMonth() != null && !xmlDocument.getPublishdate().getMonth().isEmpty());
+-    }
+-
+-    public String getDay(){
+-        if(this.hasDay()){
+-            return xmlDocument.getPublishdate().getDay();
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasDay(){
+-        return (xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getDay() != null && !xmlDocument.getPublishdate().getDay().isEmpty());
+-    }
+-    
+-      /*
+-    public String getVenue() {
+-        if(this.hasVenue()){
+-            return xmlDocument.getVenue().getValue();
+-        }
+-        else{
+-            return "";
+-        }
+-    }
+-
+-    public boolean hasVenue(){
+-        return (xmlDocument.getVenue() != null && xmlDocument.getVenue().getValue() != null && !xmlDocument.getVenue().getValue().isEmpty());
+-    }*/
+-    
+-    private String getNameComplete(Author author){
+-      if(author == null) return "";
+-      String result = "";
+-      if(getSimpleTypeValue(author.getName_First()) != null)
+-              result = result + getSimpleTypeValue(author.getName_First()).trim() + " ";
+-      if(getSimpleTypeValue(author.getName_Middle()) != null)
+-              result = result + getSimpleTypeValue(author.getName_Middle()).trim() + " ";
+-      if(getSimpleTypeValue(author.getName_Last_Prefix()) != null)
+-              result = result + getSimpleTypeValue(author.getName_Last_Prefix()).trim() + " ";
+-      if(getSimpleTypeValue(author.getName_Last()) != null)
+-              result = result + getSimpleTypeValue(author.getName_Last()).trim() + " ";
+-      if(getSimpleTypeValue(author.getName_Last_Suffix()) != null)
+-              result = result + getSimpleTypeValue(author.getName_Last_Suffix()).trim() + " ";
+-      return result.trim();
+-    }
+-    
+-    private String getSimpleTypeValue(Bean bean){
+-      if(bean == null || !(bean instanceof SimpleTypeElementBean)) return null;
+-      SimpleTypeElementBean simpleTypeElementBean = (SimpleTypeElementBean)bean;
+-      if(simpleTypeElementBean.getValue() == null || simpleTypeElementBean.getValue().equalsIgnoreCase("null") || simpleTypeElementBean.getValue().length() <= 0) return null;
+-      return simpleTypeElementBean.getValue();
+-    }
+-
+-}
+--- a/src/main/java/spl/DocumentsWrapper.java
++++ b/src/main/java/spl/DocumentsWrapper.java
+@@ -1,132 +0,0 @@
+-package spl;
+-
+-import java.util.ArrayList;
+-import java.util.List;
+-import java.util.Vector;
+-
+-import org.sciplore.beans.Author;
+-import org.sciplore.beans.Document;
+-import org.sciplore.beans.Year;
+-import org.sciplore.formatter.Bean;
+-import org.sciplore.formatter.SimpleTypeElementBean;
+-
+-/**
+- * Created by IntelliJ IDEA.
+- * User: Christoph Arbeit
+- * Date: 09.09.2010
+- * Time: 10:56:50
+- * To change this template use File | Settings | File Templates.
+- */
+-public class DocumentsWrapper {
+-
+-    Document xmlDocuments;
+-
+-    public DocumentsWrapper(Document documents) {
+-        this.xmlDocuments = documents;
+-    }
+-
+-    public Document getXmlDocuments() {
+-        return xmlDocuments;
+-    }
+-
+-    public void setXmlDocuments(Document xmlDocuments) {
+-        this.xmlDocuments = xmlDocuments;
+-    }
+-
+-    public List<Vector<String>> getDocuments(){
+-        List<Vector<String>> documents = new ArrayList<Vector<String>>();
+-        //List<XmlDocument> xmlDocuments = this.xmlDocuments.getDocuments();
+-        //for(XmlDocument xmlDocument : xmlDocuments){
+-              Document xmlDocument = xmlDocuments;
+-            Vector<String> vector = new Vector<String>();
+-            if(xmlDocument.getTitle() != null){
+-                vector.add(xmlDocument.getTitle().getValue());
+-            }
+-            else{
+-                vector.add("");
+-            }
+-            if(xmlDocument.getAuthors() != null){
+-                List<Bean> authors = xmlDocument.getAuthors().getCollection();
+-                authors = sortAuthors(authors);
+-                String value = "";
+-                int i = 1;
+-                for(Bean author : authors){
+-                    if(i < authors.size()){
+-                        value = value + getNameComplete(((Author)author));
+-                        value = value + ", ";
+-                    }
+-                    else{
+-                        value = value + getNameComplete(((Author)author));
+-                    }
+-                    i++;
+-                }
+-                vector.add(value);
+-            }
+-            else{
+-                vector.add("");
+-            }
+-            if(xmlDocument.getYear() != null && ((Year)xmlDocument.getYear()).getValue() != null && !((Year)xmlDocument.getYear()).getValue().equalsIgnoreCase("null")){
+-                vector.add(((Year)xmlDocument.getYear()).getValue());
+-            }
+-            /*if(xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getYear() != null && !xmlDocument.getPublishdate().getYear().equalsIgnoreCase("null")){
+-                vector.add(xmlDocument.getPublishdate().getYear());
+-            }*/
+-            else{
+-                vector.add("");
+-            }
+-            documents.add(vector);
+-        //}
+-        return documents;
+-    }
+-    
+-    private String getNameComplete(Author author){
+-      if(author == null) return "";
+-      String result = "";
+-      if(getSimpleTypeValue(author.getName_First()) != null)
+-              result = result + getSimpleTypeValue(author.getName_First()).trim() + " ";
+-      if(getSimpleTypeValue(author.getName_Middle()) != null)
+-              result = result + getSimpleTypeValue(author.getName_Middle()).trim() + " ";
+-      if(getSimpleTypeValue(author.getName_Last_Prefix()) != null)
+-              result = result + getSimpleTypeValue(author.getName_Last_Prefix()).trim() + " ";
+-      if(getSimpleTypeValue(author.getName_Last()) != null)
+-              result = result + getSimpleTypeValue(author.getName_Last()).trim() + " ";
+-      if(getSimpleTypeValue(author.getName_Last_Suffix()) != null)
+-              result = result + getSimpleTypeValue(author.getName_Last_Suffix()).trim() + " ";
+-      return result.trim();
+-    }
+-    
+-    private String getSimpleTypeValue(Bean bean){
+-      if(bean == null || !(bean instanceof SimpleTypeElementBean)) return null;
+-      SimpleTypeElementBean simpleTypeElementBean = (SimpleTypeElementBean)bean;
+-      if(simpleTypeElementBean.getValue() == null || simpleTypeElementBean.getValue().equalsIgnoreCase("null") || simpleTypeElementBean.getValue().length() <= 0) return null;
+-      return simpleTypeElementBean.getValue();
+-    }
+-    
+-    protected static List<Bean> sortAuthors(List<Bean> authors){
+-       boolean unsorted = true;
+-         Bean temp;
+-         
+-         while (unsorted){
+-               unsorted = false;
+-               for (int i = 0; i < authors.size() - 1; i++){
+-                       int rank = 99;
+-                       int otherRank = 99;
+-                       if(((Author)authors.get(i)).getRank() != null && !((Author)authors.get(i)).getRank().equalsIgnoreCase("null")){
+-                               rank = Integer.parseInt(((Author)authors.get(i)).getRank());
+-                       }                       
+-                       if(((Author)authors.get(i + 1)).getRank() != null && !((Author)authors.get(i + 1)).getRank().equalsIgnoreCase("null")){
+-                               otherRank = Integer.parseInt(((Author)authors.get(i + 1)).getRank());
+-                       }                       
+-                       
+-                       if (rank > otherRank) {                      
+-                  temp       = authors.get(i);
+-                  authors.set(i, authors.get(i + 1));
+-                  authors.set(i + 1, temp);                 
+-                  unsorted = true;
+-               }          
+-              }        
+-        } 
+-      
+-      return authors;
+-    }
+-}
+--- a/src/main/java/spl/SplWebClient.java
++++ b/src/main/java/spl/SplWebClient.java
+@@ -1,195 +0,0 @@
+-package spl;
+-
+-import java.io.ByteArrayInputStream;
+-import java.io.File;
+-import java.io.FileInputStream;
+-import java.io.InputStream;
+-import java.io.UnsupportedEncodingException;
+-
+-import javax.ws.rs.core.MediaType;
+-
+-import org.sciplore.beans.Author;
+-import org.sciplore.beans.Document;
+-import org.sciplore.deserialize.creator.AuthorBeanCreator;
+-import org.sciplore.deserialize.creator.AuthorsBeanCreator;
+-import org.sciplore.deserialize.creator.DefaultStringCreator;
+-import org.sciplore.deserialize.creator.DocumentBeanCreator;
+-import org.sciplore.deserialize.creator.DocumentsBeanCreator;
+-import org.sciplore.deserialize.creator.ObjectCreator;
+-import org.sciplore.deserialize.creator.TitleBeanCreator;
+-import org.sciplore.deserialize.creator.YearBeanCreator;
+-import org.sciplore.deserialize.reader.ObjectCreatorMapper;
+-import org.sciplore.deserialize.reader.XmlResourceReader;
+-import org.sciplore.formatter.Bean;
+-import org.sciplore.formatter.SimpleTypeElementBean;
+-
+-import com.sun.jersey.api.client.Client;
+-import com.sun.jersey.api.client.ClientResponse;
+-import com.sun.jersey.api.client.WebResource;
+-import com.sun.jersey.multipart.FormDataMultiPart;
+-
+-/**
+- * Created by IntelliJ IDEA.
+- * User: Christoph Arbeit
+- * Date: 09.09.2010
+- * Time: 10:35:20
+- * To change this template use File | Settings | File Templates.
+- */
+-public class SplWebClient {
+-
+-    private static Client CLIENT = Client.create();
+-    static{
+-        CLIENT.setConnectTimeout(1000);
+-        CLIENT.setReadTimeout(70000);
+-    }
+-    private static WebResource WEBRESOURCE = CLIENT.resource( "http://api.mr-dlib.org/" );
+-    private static WebResource INTERNETRESOURCE = CLIENT.resource( "http://www.google.com" );
+-    //private static WebResource WEBRESOURCE = CLIENT.resource( "http://localhost:8080/rest/" );
+-
+-    public static Document metadata;
+-
+-    public static WebServiceStatus getMetaData(File file){
+-        try{
+-            if(!isWebServiceAvailable()){
+-                if(isInternetAvailable()){
+-                    return  WebServiceStatus.WEBSERVICE_DOWN;
+-                }
+-                else{
+-                    return  WebServiceStatus.NO_INTERNET;
+-                }
+-            }
+-            if(isWebServiceOutDated()){
+-                return  WebServiceStatus.OUTDATED;
+-            }
+-            if(!isMetaDataServiceAvailable()){
+-                return  WebServiceStatus.UNAVAILABLE;
+-            }
+-            FileInputStream fin = new FileInputStream(file);      
+-            byte[] data = new byte[(int)file.length()];          
+-            fin.read(data);           
+-            
+-            FormDataMultiPart formDataMultiPart = new FormDataMultiPart();            
+-            formDataMultiPart.field("file", data,  MediaType.APPLICATION_OCTET_STREAM_TYPE);            
+-            formDataMultiPart.field("source", "jabref",  MediaType.TEXT_PLAIN_TYPE);
+-            formDataMultiPart.field("filename", file.getName(), MediaType.TEXT_PLAIN_TYPE);
+-           
+-           
+-            ClientResponse response = WEBRESOURCE.path("documents").type(MediaType.MULTIPART_FORM_DATA_TYPE).post(ClientResponse.class, formDataMultiPart);
+-            //System.out.println(response.getEntity(String.class));
+-            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){
+-                String entity = response.getEntity(String.class);
+-                byte[] bytes = new byte[0];
+-                try {
+-                    bytes = entity.getBytes("UTF-8");
+-                } catch (UnsupportedEncodingException e) {
+-                    return null;
+-                }
+-                InputStream is = new ByteArrayInputStream(bytes);
+-                if(is != null){
+-                      ObjectCreatorMapper resourceMapper = new ObjectCreatorMapper();
+-                      ObjectCreator stringCreator = new DefaultStringCreator();
+-                      // initialize Mapper    
+-                        resourceMapper.addCreator("documents", new DocumentsBeanCreator());
+-                        resourceMapper.addCreator("authors", new AuthorsBeanCreator());
+-                        resourceMapper.addCreator("document", new DocumentBeanCreator());
+-                        resourceMapper.addCreator("title", new TitleBeanCreator());
+-                        resourceMapper.addCreator("year", new YearBeanCreator());
+-                        resourceMapper.addCreator("author", new AuthorBeanCreator());
+-                        
+-                        resourceMapper.addCreator("name_first", stringCreator);
+-                        resourceMapper.addCreator("name_middle", stringCreator);
+-                        resourceMapper.addCreator("name_last", stringCreator);
+-                        resourceMapper.addCreator("name_last_prefix", stringCreator);
+-                        resourceMapper.addCreator("name_last_suffix", stringCreator);
+-                        
+-                        // initialize xml reader
+-                        XmlResourceReader<?> reader = new XmlResourceReader(resourceMapper);
+-                        
+-                        // parse given file -> create object tree
+-                        Document docs =  (Document)reader.parse(is);
+-                        for(Bean author : docs.getAuthors().getCollection()){
+-                                Author temp = (Author)author;
+-                                System.out.println(((SimpleTypeElementBean)temp.getName_Last()).getValue() + " " + temp.getRank());
+-                        }
+-                   // XmlDocuments documents = JAXB.unmarshal(is, XmlDocuments.class);
+-                    SplWebClient.metadata = docs;
+-                    return WebServiceStatus.OK;
+-                }
+-                else{
+-                    return WebServiceStatus.NO_METADATA;
+-                }
+-            }
+-            if(response.getClientResponseStatus() == ClientResponse.Status.SERVICE_UNAVAILABLE){
+-                return  WebServiceStatus.UNAVAILABLE;
+-            }
+-        }catch(Exception e){
+-            System.out.println(Tools.getStackTraceAsString(e));
+-            //Todo logging
+-        }
+-        return WebServiceStatus.NO_METADATA;
+-    }
+-
+-    public static boolean isWebServiceOutDated(){
+-        try{
+-            ClientResponse response =  WEBRESOURCE.path("service/versioncheck/" + Tools.WEBSERVICE_APP_ID + "/current").get(ClientResponse.class);
+-            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){
+-                String entity = response.getEntity(String.class);
+-                byte[] bytes = entity.getBytes();
+-                InputStream is = new ByteArrayInputStream(bytes);
+-                if(is != null){
+-                    /*XmlApplication app = JAXB.unmarshal(is, XmlApplication.class);
+-                    if(app != null){
+-                        if(app.getVersion() != null && !app.getVersion().equalsIgnoreCase(Tools.WEBSERVICE_VERSION_SHORT)){
+-                            return true;
+-                        }
+-                    }*/
+-                }
+-            }
+-        }catch(Exception e){
+-            //Todo logging
+-        }
+-        return false;
+-    }
+-
+-    public static boolean isMetaDataServiceAvailable(){
+-        try{
+-            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);
+-            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){
+-                String entity = response.getEntity(String.class);
+-                if(entity != null && entity.equalsIgnoreCase("false")){
+-                    return false;
+-                }
+-            }
+-        }catch(Exception e){
+-            //Todo logging
+-        }
+-        return true;
+-    }
+-
+-    public static boolean isWebServiceAvailable(){
+-        try{
+-            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);
+-        }catch(Exception e){
+-            return false;
+-        }
+-        return true;
+-    }
+-
+-    public static boolean isInternetAvailable(){
+-        try{
+-            ClientResponse response =  INTERNETRESOURCE.get(ClientResponse.class);
+-        }catch(Exception e){
+-            return false;
+-        }
+-        return true;
+-    }
+-
+-    public enum WebServiceStatus {
+-        OK,
+-        NO_METADATA,
+-        UNAVAILABLE,
+-        OUTDATED,
+-        WEBSERVICE_DOWN,
+-        NO_INTERNET
+-    }
+-}
+--- a/src/main/java/spl/gui/MetaDataListDialog.java
++++ b/src/main/java/spl/gui/MetaDataListDialog.java
+@@ -1,297 +0,0 @@
+-package spl.gui;
+-
+-
+-import java.awt.BorderLayout;
+-import java.awt.CardLayout;
+-import java.awt.Color;
+-import java.awt.Component;
+-import java.awt.Dimension;
+-import java.awt.Font;
+-import java.awt.event.ActionEvent;
+-import java.awt.event.ActionListener;
+-import java.awt.event.KeyEvent;
+-import java.awt.event.WindowAdapter;
+-import java.awt.event.WindowEvent;
+-import java.io.File;
+-import java.io.IOException;
+-import java.util.List;
+-import java.util.Vector;
+-
+-import javax.swing.*;
+-import javax.swing.table.DefaultTableModel;
+-
+-import net.sf.jabref.Globals;
+-import net.sf.jabref.MetaData;
+-import net.sf.jabref.Util;
+-
+-import org.sciplore.beans.Document;
+-
+-import spl.DocumentsWrapper;
+-import spl.SplWebClient;
+-import spl.listener.LabelLinkListener;
+-import spl.localization.LocalizationSupport;
+-
+-import com.jgoodies.forms.builder.ButtonBarBuilder;
+-
+-public class MetaDataListDialog extends JDialog {
+-    private JPanel contentPane;
+-    private JTable tableMetadata;
+-    private JButton buttonOK;
+-    private JButton buttonCancel;
+-    private JLabel labelFetch;
+-    private JLabel iconLabel;
+-    private JButton blankButton;
+-    private JLabel labelLogo;
+-    private JButton moreInformationButton;
+-    private JPanel panelMetadata;
+-    private DefaultTableModel tableModel;
+-    private int result;
+-    private Document xmlDocuments;
+-    private String fileName;
+-    private SplWebClient.WebServiceStatus webserviceStatus;
+-    private Component thisDialog;
+-    private boolean showBlankButton;
+-    private CardLayout cardLayou = new CardLayout();
+-
+-    public MetaDataListDialog(String fileName, boolean showBlankButton) {
+-        $$$setupUI$$$();
+-        this.showBlankButton = showBlankButton;
+-        this.thisDialog = this;
+-        this.fileName = fileName;
+-        this.labelLogo.addMouseListener(new LabelLinkListener(this.labelLogo, "www.mr-dlib.org"));
+-        this.setTitle(LocalizationSupport.message("Mr._dLib_Metadata_Entries_Associated_With_PDF_File"));
+-        this.tableMetadata.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+-        setContentPane(contentPane);
+-        pack();
+-        setModal(true);
+-        getRootPane().setDefaultButton(buttonOK);
+-
+-        buttonOK.addActionListener(new ActionListener() {
+-            public void actionPerformed(ActionEvent e) {
+-                onOK();
+-            }
+-        });
+-
+-        buttonCancel.addActionListener(new ActionListener() {
+-            public void actionPerformed(ActionEvent e) {
+-                onCancel();
+-            }
+-        });
+-
+-        blankButton.addActionListener(new ActionListener() {
+-            public void actionPerformed(ActionEvent e) {
+-                onBlank();
+-            }
+-        });
+-
+-        moreInformationButton.addActionListener(new ActionListener() {
+-            public void actionPerformed(ActionEvent e) {
+-                onInfo();
+-            }
+-        });
+-
+-        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
+-        addWindowListener(new WindowAdapter() {
+-            public void windowClosing(WindowEvent e) {
+-                onCancel();
+-            }
+-        });
+-
+-        contentPane.registerKeyboardAction(new ActionListener() {
+-            public void actionPerformed(ActionEvent e) {
+-                onCancel();
+-            }
+-        }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+-
+-        cardLayou.show(panelMetadata, "panelWait");
+-        //this.scrollPane.setVisible(false);
+-        //this.blankButton.setVisible(false);
+-        this.moreInformationButton.setVisible(true);
+-        this.setSize(616, 366);
+-    }
+-
+-    private void onInfo() {
+-        try {
+-            Util.openExternalViewer(new MetaData(), "http://www.mr-dlib.org/docs/jabref_metadata_extraction_alpha.php", "url");
+-        } catch (IOException exc) {
+-            exc.printStackTrace();
+-        }
+-    }
+-
+-    private void onBlank() {
+-        this.result = JOptionPane.NO_OPTION;
+-        dispose();
+-    }
+-
+-    private void onOK() {
+-        this.result = JOptionPane.OK_OPTION;
+-        dispose();
+-    }
+-
+-    private void onCancel() {
+-        this.result = JOptionPane.CANCEL_OPTION;
+-        dispose();
+-    }
+-
+-    public void showDialog() {
+-        SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
+-            @Override
+-            public Void doInBackground() {
+-                System.out.println("Starting Webclient...");
+-                webserviceStatus = SplWebClient.getMetaData(new File(fileName));
+-                return null;
+-            }
+-
+-            @Override
+-            public void done() {
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.OK) {
+-                    xmlDocuments = SplWebClient.metadata;
+-                    if (xmlDocuments != null /*&& xmlDocuments.getDocuments() != null && xmlDocuments.getDocuments().size() > 0*/) {
+-                        DocumentsWrapper documents = new DocumentsWrapper(xmlDocuments);
+-                        List<Vector<String>> vectorList = documents.getDocuments();
+-                        for (Vector<String> vector : vectorList) {
+-                            tableModel.addRow(vector);
+-                        }
+-
+-                        tableMetadata.getSelectionModel().setSelectionInterval(0, 0);
+-                        cardLayou.show(panelMetadata, "scrollPane");
+-                        //panelWait.setVisible(false);
+-                        //scrollPane.setVisible(true);
+-                        moreInformationButton.setVisible(true);
+-                    } else {
+-                        iconLabel.setVisible(false);
+-                        labelFetch.setText(LocalizationSupport.message("No_metadata_found."));
+-                        blankButton.setVisible(showBlankButton);
+-                    }
+-                }
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_METADATA) {
+-                    iconLabel.setVisible(false);
+-                    labelFetch.setText(LocalizationSupport.message("No_metadata_found."));
+-                    blankButton.setVisible(showBlankButton);
+-                }
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.UNAVAILABLE) {
+-                    iconLabel.setVisible(false);
+-                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_unavailable."));
+-                    blankButton.setVisible(showBlankButton);
+-                }
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.OUTDATED) {
+-                    iconLabel.setVisible(false);
+-                    labelFetch.setText(LocalizationSupport.message("The_Mr._dLib_web_service_version_you_trying_to_access_is_outdated."));
+-                    blankButton.setVisible(showBlankButton);
+-                    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."), LocalizationSupport.message("Web_Service_Version_Outdated"), JOptionPane.INFORMATION_MESSAGE);
+-                }
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.WEBSERVICE_DOWN) {
+-                    iconLabel.setVisible(false);
+-                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_down._Please_try_again_later."));
+-                    blankButton.setVisible(showBlankButton);
+-                }
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_INTERNET) {
+-                    iconLabel.setVisible(false);
+-                    labelFetch.setText(LocalizationSupport.message("No_Internet_Connection."));
+-                    blankButton.setVisible(showBlankButton);
+-                    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);
+-                }
+-            }
+-        };
+-        worker.execute();
+-        this.pack();
+-        this.setVisible(true);
+-    }
+-
+-    public Document getXmlDocuments() {
+-        return xmlDocuments;
+-    }
+-
+-    private void createUIComponents() {
+-        this.tableModel = new MyTableModel();
+-        this.tableModel.addColumn(LocalizationSupport.message("Title"));
+-        this.tableModel.addColumn(LocalizationSupport.message("Author(s)"));
+-        this.tableModel.addColumn(LocalizationSupport.message("Published_Year"));
+-        this.tableMetadata = new JTable(this.tableModel);
+-    }
+-
+-    public JTable getTableMetadata() {
+-        return tableMetadata;
+-    }
+-
+-    public int getResult() {
+-        return result;
+-    }
+-
+-    public JButton getBlankButton() {
+-        return blankButton;
+-    }
+-
+-    private void $$$setupUI$$$() {
+-        createUIComponents();
+-        contentPane = new JPanel();
+-        contentPane.setLayout(new BorderLayout());
+-        labelLogo = new JLabel();
+-        labelLogo.setIcon(new ImageIcon(getClass().getResource("/spl/gui/mrdlib header.png")));
+-        labelLogo.setText("");
+-        contentPane.add(labelLogo, BorderLayout.NORTH);
+-        panelMetadata = new JPanel();
+-        panelMetadata.setLayout(cardLayou);
+-
+-
+-        panelMetadata.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null));
+-        JScrollPane scrollPane = new JScrollPane();
+-        scrollPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), null));
+-        tableMetadata.setAutoCreateRowSorter(false);
+-        tableMetadata.setEnabled(true);
+-        tableMetadata.setFillsViewportHeight(true);
+-        tableMetadata.setShowVerticalLines(true);
+-        scrollPane.setViewportView(tableMetadata);
+-        panelMetadata.add(scrollPane, "scrollPane");
+-        JPanel panelWait = new JPanel();
+-        panelWait.setLayout(new BorderLayout());
+-        panelWait.setBackground(new Color(-1));
+-        panelMetadata.add(panelWait, "panelWait");
+-        panelWait.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), null));
+-        iconLabel = new JLabel();
+-        iconLabel.setBackground(new Color(-1));
+-        iconLabel.setHorizontalAlignment(SwingConstants.CENTER);
+-        iconLabel.setHorizontalTextPosition(SwingConstants.TRAILING);
+-        iconLabel.setIcon(new ImageIcon(getClass().getResource("/spl/gui/ajax-loader.gif")));
+-        iconLabel.setText("");
+-        panelWait.add(iconLabel, BorderLayout.CENTER);
+-        labelFetch = new JLabel();
+-        labelFetch.setHorizontalAlignment(JLabel.CENTER);
+-        labelFetch.setFont(new Font(labelFetch.getFont().getName(), labelFetch.getFont().getStyle(), 13));
+-        labelFetch.setText(Globals.lang("Fetching Metadata..."));
+-        panelWait.add(labelFetch, BorderLayout.SOUTH);
+-
+-        cardLayou.show(panelMetadata, "panelWait");
+-        panelMetadata.setPreferredSize(new Dimension(400, 200));
+-        contentPane.add(panelMetadata, BorderLayout.CENTER);
+-
+-        buttonOK = new JButton(Globals.lang("Ok"));
+-        buttonCancel = new JButton(Globals.lang("Cancel"));
+-        moreInformationButton = new JButton(Globals.lang("More information"));
+-        ButtonBarBuilder bb = new ButtonBarBuilder();
+-        bb.addGlue();
+-        bb.addButton(moreInformationButton);
+-        bb.addButton(buttonOK);
+-        bb.addButton(buttonCancel);
+-        bb.addGlue();
+-        blankButton = new JButton();
+-        blankButton.setText("");
+-        contentPane.add(bb.getPanel(), BorderLayout.SOUTH);
+-        iconLabel.setLabelFor(scrollPane);
+-
+-
+-    }
+-
+-    public JComponent $$$getRootComponent$$$() {
+-        return contentPane;
+-    }
+-
+-    public static class MyTableModel extends DefaultTableModel {
+-
+-        @Override
+-        public boolean isCellEditable(int row, int column) {
+-            return false;
+-        }
+-    }
+-
+-}
index 9e1b7df..9ed273d 100644 (file)
@@ -1,4 +1,3 @@
 debian_libs.patch
 mrDlib_jayatana.patch
 generated_JabRefPlugin.java.patch
 debian_libs.patch
 mrDlib_jayatana.patch
 generated_JabRefPlugin.java.patch
-fix-headless-bibtex-output.diff