39a7e83bed50f4d93281da43d8d10d373e83b65c
[debian/jabref.git] / debian / patches / mrDlib_jayatana.patch
1 Description: This is the diff between the debian branch and the v_2.10 tag
2  in upstream git; the debian branch was created for us with the purpose to
3  disable the mrDlib functionality which needs libraries not packaged in
4  Debian yet.
5 Origin: upstream git
6 Forwarded: not-needed
7 Author: Oliver Kopp <oliver.kopp@gmail.com>
8 Reviewed-by: gregor herrmann <gregoa@debian.org>
9 Last-Update: 2014-03-12
10
11 --- a/.classpath
12 +++ b/.classpath
13 @@ -11,8 +11,6 @@
14         <classpathentry exported="true" kind="lib" path="lib/plugin/JPFCodeGenerator-rt.jar" sourcepath="/JPFCodeGenerator/src"/>
15         <classpathentry exported="true" kind="lib" path="lib/glazedlists-1.8.0_java15.jar"/>
16         <classpathentry kind="lib" path="lib/mysql-connector-java-5.0.7-bin.jar"/>
17 -       <classpathentry kind="lib" path="lib/spl/sciplore/xstream-1.4.1.jar"/>
18 -       <classpathentry kind="lib" path="lib/spl/sciplore/mrDlib-serialization-api.jar" sourcepath="/Serialization API"/>
19         <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
20                 <accessrules>
21                         <accessrule kind="accessible" pattern="**"/>
22 @@ -21,14 +19,10 @@
23         <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
24         <classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/resources"/>
25         <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/sciplore"/>
26 -       <classpathentry kind="lib" path="lib/spl/jersey/mimepull-1.3.jar"/>
27         <classpathentry kind="lib" path="lib/oo/juh.jar"/>
28         <classpathentry kind="lib" path="lib/oo/jurt.jar"/>
29         <classpathentry kind="lib" path="lib/oo/ridl.jar"/>
30         <classpathentry kind="lib" path="lib/oo/unoil.jar"/>
31 -       <classpathentry kind="lib" path="lib/spl/jersey/jersey-client-1.14.jar"/>
32 -       <classpathentry kind="lib" path="lib/spl/jersey/jersey-core-1.14.jar"/>
33 -       <classpathentry kind="lib" path="lib/spl/jersey/jersey-multipart-1.14.jar"/>
34         <classpathentry kind="lib" path="lib/antlr-3.4-complete.jar"/>
35         <classpathentry kind="lib" path="lib/jgoodies-common-1.4.0.jar"/>
36         <classpathentry kind="lib" path="lib/jgoodies-forms-1.6.0.jar"/>
37 @@ -36,7 +30,6 @@
38         <classpathentry kind="lib" path="lib/fontbox-1.7.1.jar"/>
39         <classpathentry kind="lib" path="lib/jempbox-1.7.1.jar"/>
40         <classpathentry kind="lib" path="lib/pdfbox-1.7.1.jar"/>
41 -       <classpathentry kind="lib" path="lib/jayatana-1.2.4.jar"/>
42         <classpathentry kind="lib" path="lib/postgresql-9.2-1002.jdbc4.jar"/>
43         <classpathentry kind="output" path="bin"/>
44  </classpath>
45 --- a/src/java/net/sf/jabref/ImportSettingsTab.java
46 +++ b/src/java/net/sf/jabref/ImportSettingsTab.java
47 @@ -44,10 +44,8 @@
48         
49      private JRadioButton radioButtonXmp;
50         private JRadioButton radioButtonPDFcontent;
51 -    private JRadioButton radioButtonMrDlib;
52      private JRadioButton radioButtonNoMeta;
53         private JRadioButton radioButtononlyAttachPDF;
54 -       private JRadioButton radioButtonUpdateEmptyFields;
55         private JCheckBox useDefaultPDFImportStyle;
56         
57         private JTextField fileNamePattern;
58 @@ -59,17 +57,12 @@
59          radioButtonNoMeta = new JRadioButton(Globals.lang("Create_blank_entry_linking_the_PDF"));
60          radioButtonXmp = new JRadioButton(Globals.lang("Create_entry_based_on_XMP_data"));
61          radioButtonPDFcontent = new JRadioButton(Globals.lang("Create_entry_based_on_content"));
62 -        radioButtonMrDlib = new JRadioButton(Globals.lang("Create_entry_based_on_data_fetched_from")+" Mr.DLib");
63          radioButtononlyAttachPDF = new JRadioButton(Globals.lang("Only_attach_PDF"));
64 -        radioButtonUpdateEmptyFields = new JRadioButton(Globals.lang("Update_empty_fields_with_data_fetched_from")
65 -            +" Mr.DLib");
66          ButtonGroup bg = new ButtonGroup();
67          bg.add(radioButtonNoMeta);
68          bg.add(radioButtonXmp);
69          bg.add(radioButtonPDFcontent);
70 -        bg.add(radioButtonMrDlib);
71          bg.add(radioButtononlyAttachPDF);
72 -        bg.add(radioButtonUpdateEmptyFields);
73  
74          useDefaultPDFImportStyle = new JCheckBox(Globals.lang("Always use this PDF import style (and do not ask for each import)"));
75                 
76 @@ -96,15 +89,9 @@
77                 builder.append(radioButtonPDFcontent);
78          builder.nextLine();
79          builder.append(pan);
80 -               builder.append(radioButtonMrDlib);
81 -        builder.nextLine();
82 -        builder.append(pan);
83                 builder.append(radioButtononlyAttachPDF);
84          builder.nextLine();
85          builder.append(pan);
86 -               builder.append(radioButtonUpdateEmptyFields);
87 -        builder.nextLine();
88 -        builder.append(pan);
89                 builder.append(useDefaultPDFImportStyle);
90          builder.nextLine();
91                 
92 @@ -136,15 +123,9 @@
93                 case ImportDialog.CONTENT:
94                         radioButtonPDFcontent.setSelected(true);
95                         break;
96 -               case ImportDialog.MRDLIB:
97 -                       radioButtonMrDlib.setSelected(true);
98 -                       break;
99                 case ImportDialog.ONLYATTACH:
100                         radioButtononlyAttachPDF.setSelected(true);
101                         break;
102 -               case ImportDialog.UPDATEEMPTYFIELDS:
103 -                       radioButtonUpdateEmptyFields.setSelected(true);
104 -                       break;
105                 default:
106                         // fallback
107                         radioButtonPDFcontent.setSelected(true);
108 @@ -162,12 +143,9 @@
109                         style = ImportDialog.XMP;
110                 else if (radioButtonPDFcontent.isSelected())
111                         style = ImportDialog.CONTENT;
112 -               else if (radioButtonMrDlib.isSelected())
113 -                       style = ImportDialog.MRDLIB;
114                 else if (radioButtononlyAttachPDF.isSelected())
115                         style = ImportDialog.ONLYATTACH;
116 -               else if (radioButtonUpdateEmptyFields.isSelected())
117 -                       style = ImportDialog.UPDATEEMPTYFIELDS;
118 +               else throw new IllegalStateException();
119                 Globals.prefs.putInt(PREF_IMPORT_DEFAULT_PDF_IMPORT_STYLE, style);
120                 Globals.prefs.put(PREF_IMPORT_FILENAMEPATTERN, fileNamePattern.getText());
121         }
122 --- a/src/java/net/sf/jabref/JabRefFrame.java
123 +++ b/src/java/net/sf/jabref/JabRefFrame.java
124 @@ -1,4 +1,4 @@
125 -/*  Copyright (C) 2003-2012 JabRef contributors.
126 +/*  Copyright (C) 2003-2011 JabRef contributors.
127      This program is free software; you can redistribute it and/or modify
128      it under the terms of the GNU General Public License as published by
129      the Free Software Foundation; either version 2 of the License, or
130 @@ -40,8 +40,6 @@
131  import javax.swing.event.ChangeEvent;
132  import javax.swing.event.ChangeListener;
133  
134 -import org.java.ayatana.ApplicationMenu;
135 -
136  import net.sf.jabref.export.*;
137  import net.sf.jabref.external.ExternalFileTypeEditor;
138  import net.sf.jabref.external.PushToApplicationButton;
139 @@ -562,13 +560,6 @@
140                  }
141              }
142          });
143 -
144 -        // The following sets up integration with Unity's global menu, but currently (Nov 18, 2012)
145 -        // this doesn't work with OpenJDK 6 (leads to crash), only with 7.
146 -        String javaVersion = System.getProperty("java.version", null);
147 -        if (javaVersion.compareTo("1.7") >= 0)
148 -            ApplicationMenu.tryInstall(this);
149 -
150      }
151  
152      public void setWindowTitle() {
153 --- a/src/java/spl/DocumentWrapper.java
154 +++ /dev/null
155 @@ -1,272 +0,0 @@
156 -package spl;\r
157 -\r
158 -import java.util.List;\r
159 -\r
160 -import org.sciplore.beans.Abstract;\r
161 -import org.sciplore.beans.Author;\r
162 -import org.sciplore.beans.Authors;\r
163 -import org.sciplore.beans.Document;\r
164 -import org.sciplore.formatter.Bean;\r
165 -import org.sciplore.formatter.SimpleTypeElementBean;\r
166 -\r
167 -/**\r
168 - * Created by IntelliJ IDEA.\r
169 - * User: Christoph Arbeit\r
170 - * Date: 10.09.2010\r
171 - * Time: 20:02:51\r
172 - * To change this template use File | Settings | File Templates.\r
173 - */\r
174 -public class DocumentWrapper {\r
175 -\r
176 -    Document xmlDocument;\r
177 -\r
178 -    public DocumentWrapper(Document xmlDocument) {\r
179 -        this.xmlDocument = xmlDocument;\r
180 -    }\r
181 -\r
182 -    public Document getXmlDocument() {\r
183 -        return xmlDocument;\r
184 -    }\r
185 -\r
186 -    public void setXmlDocument(Document xmlDocument) {\r
187 -        this.xmlDocument = xmlDocument;\r
188 -    }\r
189 -\r
190 -    public String getTitle(){\r
191 -        if(this.hasTitle()){\r
192 -            return xmlDocument.getTitle().getValue();\r
193 -        }\r
194 -        else{\r
195 -            return "";\r
196 -        }\r
197 -    }\r
198 -\r
199 -    public boolean hasTitle(){\r
200 -        return (xmlDocument.getTitle() != null && xmlDocument.getTitle().getValue() != null && !xmlDocument.getTitle().getValue().isEmpty());\r
201 -    }\r
202 -\r
203 -    public String getAbstract(){\r
204 -        if(this.hasAbstract()){\r
205 -            return ((Abstract)xmlDocument.getAbstract()).getValue();\r
206 -        }\r
207 -        else{\r
208 -            return "";\r
209 -        }\r
210 -    }\r
211 -\r
212 -    public boolean hasAbstract(){\r
213 -        return (xmlDocument.getAbstract() != null && ((Abstract)xmlDocument.getAbstract()).getValue() != null && !((Abstract)xmlDocument.getAbstract()).getValue().isEmpty());\r
214 -    }\r
215 -\r
216 -   public String getAuthors(String seperator){\r
217 -        if(this.hasAuthors()){\r
218 -               List<Bean> authors = xmlDocument.getAuthors().getCollection();\r
219 -            authors = this.sortAuthors(authors);\r
220 -            String value = "";\r
221 -            int i = 1;\r
222 -            for(Bean author : authors){\r
223 -                if(i < authors.size()){\r
224 -                    value = value + getNameComplete((Author)author);\r
225 -                    value = value + " " + seperator + " ";\r
226 -                }\r
227 -                else{\r
228 -                    value = value + getNameComplete((Author)author);\r
229 -                }\r
230 -                i++;\r
231 -            }\r
232 -            return value;\r
233 -        }\r
234 -        else{\r
235 -            return "";\r
236 -        }\r
237 -    }\r
238 -\r
239 -    public boolean hasAuthors(){\r
240 -        return (xmlDocument.getAuthors() != null && xmlDocument.getAuthors().getCollection() != null && !xmlDocument.getAuthors().getCollection().isEmpty());\r
241 -    }\r
242 -\r
243 -    /* public String getKeyWords(){\r
244 -        if(this.hasKeyWords()){\r
245 -            List<XmlKeyword> keywords = xmlDocument.getKeywords().getKeywords();\r
246 -            String value = "";\r
247 -            int i = 1;\r
248 -            for(XmlKeyword keyword : keywords){\r
249 -                if(i < keywords.size()){\r
250 -                    value = value + keyword.getValue();\r
251 -                    value = value + ", ";\r
252 -                }\r
253 -                else{\r
254 -                    value = value + keyword.getValue();\r
255 -                }\r
256 -                i++;\r
257 -            }\r
258 -            return value;\r
259 -        }\r
260 -        else{\r
261 -            return "";\r
262 -        }\r
263 -    }\r
264 -\r
265 -    public boolean hasKeyWords(){\r
266 -        return (xmlDocument.getKeywords() != null && xmlDocument.getKeywords().getKeywords() != null && !xmlDocument.getKeywords().getKeywords().isEmpty());\r
267 -    }\r
268 -*/\r
269 -\r
270 -    public String getDoi(){\r
271 -        if(this.hasDoi()){\r
272 -            return this.getSimpleTypeValue(xmlDocument.getDoi());\r
273 -        }\r
274 -        else{\r
275 -            return "";\r
276 -        }\r
277 -    }\r
278 -\r
279 -    public boolean hasDoi(){\r
280 -        return (xmlDocument.getDoi() != null && this.getSimpleTypeValue(xmlDocument.getDoi()) != null && !this.getSimpleTypeValue(xmlDocument.getDoi()).isEmpty());\r
281 -    }\r
282 -/*\r
283 -    public String getPages(){\r
284 -        if(this.hasPages()){\r
285 -            return xmlDocument.getPages().getValue();\r
286 -        }\r
287 -        else{\r
288 -            return "";\r
289 -        }\r
290 -    }\r
291 -\r
292 -    public boolean hasPages(){\r
293 -        return (xmlDocument.getPages() != null && xmlDocument.getPages().getValue() != null && !xmlDocument.getPages().getValue().isEmpty());\r
294 -    }\r
295 -\r
296 -    public String getVolume(){\r
297 -        if(this.hasVolume()){\r
298 -            return xmlDocument.getVolume().getValue();\r
299 -        }\r
300 -        else{\r
301 -            return "";\r
302 -        }\r
303 -    }\r
304 -\r
305 -    public boolean hasVolume(){\r
306 -        return (xmlDocument.getVolume() != null && xmlDocument.getVolume().getValue() != null && !xmlDocument.getVolume().getValue().isEmpty());\r
307 -    }\r
308 -\r
309 -    public String getNumber(){\r
310 -        if(this.hasNumber()){\r
311 -            return xmlDocument.getNumber().getValue();\r
312 -        }\r
313 -        else{\r
314 -            return "";\r
315 -        }\r
316 -    }\r
317 -\r
318 -    public boolean hasNumber(){\r
319 -        return (xmlDocument.getNumber() != null && xmlDocument.getNumber().getValue() != null && !xmlDocument.getNumber().getValue().isEmpty());\r
320 -    }\r
321 -*/\r
322 -    \r
323 -    public String getYear(){\r
324 -        if(this.hasYear()){\r
325 -            return this.getSimpleTypeValue(xmlDocument.getYear());\r
326 -        }\r
327 -        else{\r
328 -            return "";\r
329 -        }\r
330 -    }\r
331 -\r
332 -    public boolean hasYear(){\r
333 -        return (this.getSimpleTypeValue(xmlDocument.getYear()) != null && !this.getSimpleTypeValue(xmlDocument.getYear()).isEmpty() && !this.getSimpleTypeValue(xmlDocument.getYear()).equalsIgnoreCase("null"));\r
334 -    }\r
335 -    \r
336 -/*\r
337 -     public String getMonth(){\r
338 -        if(this.hasMonth()){\r
339 -            return xmlDocument.getPublishdate().getMonth();\r
340 -        }\r
341 -        else{\r
342 -            return "";\r
343 -        }\r
344 -    }\r
345 -\r
346 -    public boolean hasMonth(){\r
347 -        return (xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getMonth() != null && !xmlDocument.getPublishdate().getMonth().isEmpty());\r
348 -    }\r
349 -\r
350 -    public String getDay(){\r
351 -        if(this.hasDay()){\r
352 -            return xmlDocument.getPublishdate().getDay();\r
353 -        }\r
354 -        else{\r
355 -            return "";\r
356 -        }\r
357 -    }\r
358 -\r
359 -    public boolean hasDay(){\r
360 -        return (xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getDay() != null && !xmlDocument.getPublishdate().getDay().isEmpty());\r
361 -    }\r
362 -    \r
363 -       /*\r
364 -    public String getVenue() {\r
365 -        if(this.hasVenue()){\r
366 -            return xmlDocument.getVenue().getValue();\r
367 -        }\r
368 -        else{\r
369 -            return "";\r
370 -        }\r
371 -    }\r
372 -\r
373 -    public boolean hasVenue(){\r
374 -        return (xmlDocument.getVenue() != null && xmlDocument.getVenue().getValue() != null && !xmlDocument.getVenue().getValue().isEmpty());\r
375 -    }*/\r
376 -    \r
377 -    private String getNameComplete(Author author){\r
378 -       if(author == null) return "";\r
379 -       String result = "";\r
380 -       if(getSimpleTypeValue(author.getName_First()) != null)\r
381 -               result = result + getSimpleTypeValue(author.getName_First()).trim() + " ";\r
382 -       if(getSimpleTypeValue(author.getName_Middle()) != null)\r
383 -               result = result + getSimpleTypeValue(author.getName_Middle()).trim() + " ";\r
384 -       if(getSimpleTypeValue(author.getName_Last_Prefix()) != null)\r
385 -               result = result + getSimpleTypeValue(author.getName_Last_Prefix()).trim() + " ";\r
386 -       if(getSimpleTypeValue(author.getName_Last()) != null)\r
387 -               result = result + getSimpleTypeValue(author.getName_Last()).trim() + " ";\r
388 -       if(getSimpleTypeValue(author.getName_Last_Suffix()) != null)\r
389 -               result = result + getSimpleTypeValue(author.getName_Last_Suffix()).trim() + " ";\r
390 -       return result.trim();\r
391 -    }\r
392 -    \r
393 -    private String getSimpleTypeValue(Bean bean){\r
394 -       if(bean == null || !(bean instanceof SimpleTypeElementBean)) return null;\r
395 -       SimpleTypeElementBean simpleTypeElementBean = (SimpleTypeElementBean)bean;\r
396 -       if(simpleTypeElementBean.getValue() == null || simpleTypeElementBean.getValue().equalsIgnoreCase("null") || simpleTypeElementBean.getValue().length() <= 0) return null;\r
397 -       return simpleTypeElementBean.getValue();\r
398 -    }\r
399 -    \r
400 -    private List<Bean> sortAuthors(List<Bean> authors){\r
401 -        boolean unsorted = true;\r
402 -        Bean temp;\r
403 -        \r
404 -        while (unsorted){\r
405 -                unsorted = false;\r
406 -                for (int i = 0; i < authors.size() - 1; i++){\r
407 -                        int rank = 99;\r
408 -                        int otherRank = 99;\r
409 -                        if(((Author)authors.get(i)).getRank() != null && !((Author)authors.get(i)).getRank().equalsIgnoreCase("null")){\r
410 -                                rank = Integer.parseInt(((Author)authors.get(i)).getRank());\r
411 -                        }                       \r
412 -                        if(((Author)authors.get(i + 1)).getRank() != null && !((Author)authors.get(i + 1)).getRank().equalsIgnoreCase("null")){\r
413 -                                otherRank = Integer.parseInt(((Author)authors.get(i + 1)).getRank());\r
414 -                        }                       \r
415 -                        \r
416 -                        if (rank > otherRank) {                      \r
417 -                 temp       = authors.get(i);\r
418 -                 authors.set(i, authors.get(i + 1));\r
419 -                 authors.set(i + 1, temp);                 \r
420 -                 unsorted = true;\r
421 -              }          \r
422 -               }        \r
423 -       } \r
424 -       \r
425 -       return authors;\r
426 -   }\r
427 -}\r
428 --- a/src/java/spl/DocumentsWrapper.java
429 +++ /dev/null
430 @@ -1,132 +0,0 @@
431 -package spl;\r
432 -\r
433 -import java.util.ArrayList;\r
434 -import java.util.List;\r
435 -import java.util.Vector;\r
436 -\r
437 -import org.sciplore.beans.Author;\r
438 -import org.sciplore.beans.Document;\r
439 -import org.sciplore.beans.Year;\r
440 -import org.sciplore.formatter.Bean;\r
441 -import org.sciplore.formatter.SimpleTypeElementBean;\r
442 -\r
443 -/**\r
444 - * Created by IntelliJ IDEA.\r
445 - * User: Christoph Arbeit\r
446 - * Date: 09.09.2010\r
447 - * Time: 10:56:50\r
448 - * To change this template use File | Settings | File Templates.\r
449 - */\r
450 -public class DocumentsWrapper {\r
451 -\r
452 -    Document xmlDocuments;\r
453 -\r
454 -    public DocumentsWrapper(Document documents) {\r
455 -        this.xmlDocuments = documents;\r
456 -    }\r
457 -\r
458 -    public Document getXmlDocuments() {\r
459 -        return xmlDocuments;\r
460 -    }\r
461 -\r
462 -    public void setXmlDocuments(Document xmlDocuments) {\r
463 -        this.xmlDocuments = xmlDocuments;\r
464 -    }\r
465 -\r
466 -    public List<Vector> getDocuments(){\r
467 -        List<Vector> documents = new ArrayList<Vector>();\r
468 -        //List<XmlDocument> xmlDocuments = this.xmlDocuments.getDocuments();\r
469 -        //for(XmlDocument xmlDocument : xmlDocuments){\r
470 -               Document xmlDocument = xmlDocuments;\r
471 -            Vector<String> vector = new Vector<String>();\r
472 -            if(xmlDocument.getTitle() != null){\r
473 -                vector.add(xmlDocument.getTitle().getValue());\r
474 -            }\r
475 -            else{\r
476 -                vector.add("");\r
477 -            }\r
478 -            if(xmlDocument.getAuthors() != null){\r
479 -                List<Bean> authors = xmlDocument.getAuthors().getCollection();\r
480 -                authors = this.sortAuthors(authors);\r
481 -                String value = "";\r
482 -                int i = 1;\r
483 -                for(Bean author : authors){\r
484 -                    if(i < authors.size()){\r
485 -                        value = value + getNameComplete(((Author)author));\r
486 -                        value = value + ", ";\r
487 -                    }\r
488 -                    else{\r
489 -                        value = value + getNameComplete(((Author)author));\r
490 -                    }\r
491 -                    i++;\r
492 -                }\r
493 -                vector.add(value);\r
494 -            }\r
495 -            else{\r
496 -                vector.add("");\r
497 -            }\r
498 -            if(xmlDocument.getYear() != null && ((Year)xmlDocument.getYear()).getValue() != null && !((Year)xmlDocument.getYear()).getValue().equalsIgnoreCase("null")){\r
499 -                vector.add(((Year)xmlDocument.getYear()).getValue());\r
500 -            }\r
501 -            /*if(xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getYear() != null && !xmlDocument.getPublishdate().getYear().equalsIgnoreCase("null")){\r
502 -                vector.add(xmlDocument.getPublishdate().getYear());\r
503 -            }*/\r
504 -            else{\r
505 -                vector.add("");\r
506 -            }\r
507 -            documents.add(vector);\r
508 -        //}\r
509 -        return documents;\r
510 -    }\r
511 -    \r
512 -    private String getNameComplete(Author author){\r
513 -       if(author == null) return "";\r
514 -       String result = "";\r
515 -       if(getSimpleTypeValue(author.getName_First()) != null)\r
516 -               result = result + getSimpleTypeValue(author.getName_First()).trim() + " ";\r
517 -       if(getSimpleTypeValue(author.getName_Middle()) != null)\r
518 -               result = result + getSimpleTypeValue(author.getName_Middle()).trim() + " ";\r
519 -       if(getSimpleTypeValue(author.getName_Last_Prefix()) != null)\r
520 -               result = result + getSimpleTypeValue(author.getName_Last_Prefix()).trim() + " ";\r
521 -       if(getSimpleTypeValue(author.getName_Last()) != null)\r
522 -               result = result + getSimpleTypeValue(author.getName_Last()).trim() + " ";\r
523 -       if(getSimpleTypeValue(author.getName_Last_Suffix()) != null)\r
524 -               result = result + getSimpleTypeValue(author.getName_Last_Suffix()).trim() + " ";\r
525 -       return result.trim();\r
526 -    }\r
527 -    \r
528 -    private String getSimpleTypeValue(Bean bean){\r
529 -       if(bean == null || !(bean instanceof SimpleTypeElementBean)) return null;\r
530 -       SimpleTypeElementBean simpleTypeElementBean = (SimpleTypeElementBean)bean;\r
531 -       if(simpleTypeElementBean.getValue() == null || simpleTypeElementBean.getValue().equalsIgnoreCase("null") || simpleTypeElementBean.getValue().length() <= 0) return null;\r
532 -       return simpleTypeElementBean.getValue();\r
533 -    }\r
534 -    \r
535 -    private List<Bean> sortAuthors(List<Bean> authors){\r
536 -        boolean unsorted = true;\r
537 -         Bean temp;\r
538 -         \r
539 -         while (unsorted){\r
540 -                unsorted = false;\r
541 -                for (int i = 0; i < authors.size() - 1; i++){\r
542 -                        int rank = 99;\r
543 -                        int otherRank = 99;\r
544 -                        if(((Author)authors.get(i)).getRank() != null && !((Author)authors.get(i)).getRank().equalsIgnoreCase("null")){\r
545 -                                rank = Integer.parseInt(((Author)authors.get(i)).getRank());\r
546 -                        }                       \r
547 -                        if(((Author)authors.get(i + 1)).getRank() != null && !((Author)authors.get(i + 1)).getRank().equalsIgnoreCase("null")){\r
548 -                                otherRank = Integer.parseInt(((Author)authors.get(i + 1)).getRank());\r
549 -                        }                       \r
550 -                        \r
551 -                        if (rank > otherRank) {                      \r
552 -                  temp       = authors.get(i);\r
553 -                  authors.set(i, authors.get(i + 1));\r
554 -                  authors.set(i + 1, temp);                 \r
555 -                  unsorted = true;\r
556 -               }          \r
557 -               }        \r
558 -        } \r
559 -       \r
560 -       return authors;\r
561 -    }\r
562 -}\r
563 --- a/src/java/spl/PdfImporter.java
564 +++ b/src/java/spl/PdfImporter.java
565 @@ -19,12 +19,8 @@
566  import net.sf.jabref.undo.UndoableInsertEntry;\r
567  import net.sf.jabref.util.XMPUtil;\r
568  \r
569 -import org.sciplore.beans.Document;\r
570 -\r
571  import spl.filter.PdfFileFilter;\r
572  import spl.gui.ImportDialog;\r
573 -import spl.gui.MetaDataListDialog;\r
574 -\r
575  \r
576  /**\r
577   * Created by IntelliJ IDEA.\r
578 @@ -129,7 +125,6 @@
579                 BibtexEntryType type;\r
580                  InputStream in = null;\r
581                  List<BibtexEntry> localRes = null;\r
582 -               MetaDataListDialog metaDataListDialog;\r
583                  switch (choice) {\r
584                         case ImportDialog.XMP:\r
585                      //SplDatabaseChangeListener dataListener = new SplDatabaseChangeListener(frame, panel, entryTable, fileName);\r
586 @@ -222,88 +217,10 @@
587                      }\r
588                      res.add(entry);\r
589                      break;\r
590 -                       case ImportDialog.MRDLIB:\r
591 -                    metaDataListDialog = new MetaDataListDialog(fileName, true);\r
592 -                    Tools.centerRelativeToWindow(metaDataListDialog, frame);\r
593 -                    metaDataListDialog.showDialog();\r
594 -                    Document document = metaDataListDialog.getXmlDocuments();\r
595 -                    entry = null; // to satisfy the Java compiler\r
596 -                    if(document != null /*&& documents.getDocuments() != null && documents.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
597 -                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();\r
598 -                        if(selected > -1 /*&& selected < documents.getDocuments().size()*/){\r
599 -                            //Document document = documents/*.getDocuments().get(selected)*/;\r
600 -                            String id = Util.createNeutralId();\r
601 -                            entry = new BibtexEntry(id);\r
602 -                            if(fieldExists(document.getType())){\r
603 -                                type = BibtexEntryType.getStandardType(document.getType());\r
604 -                                if(type == null){\r
605 -                                    type = BibtexEntryType.ARTICLE;\r
606 -                                }\r
607 -                                entry.setType(type);\r
608 -                            }\r
609 -                            else{\r
610 -                                entry.setType(BibtexEntryType.ARTICLE);\r
611 -                            }\r
612 -                            ArrayList<BibtexEntry> list = new ArrayList<BibtexEntry>();\r
613 -                            list.add(entry);\r
614 -                            Util.setAutomaticFields(list, true, true, false);\r
615 -                            //insertFields(entry.getRequiredFields(), entry, document);\r
616 -                            insertFields(BibtexFields.getAllFieldNames(), entry, document);\r
617 -                            //insertFields(entry.getOptionalFields(), entry, document);\r
618 -                            panel.database().insertEntry(entry);\r
619 -                            dfh = new DroppedFileHandler(frame, panel);\r
620 -                            dfh.linkPdfToEntry(fileName, entryTable, entry);\r
621 -                            LabelPatternUtil.makeLabel(panel.metaData(), panel.database(), entry);\r
622 -                        }\r
623 -                        else{\r
624 -                            entry = createNewBlankEntry(fileName);\r
625 -                        }\r
626 -                    }\r
627 -                    else if(metaDataListDialog.getResult() == JOptionPane.CANCEL_OPTION ){\r
628 -                        continue;\r
629 -                    }\r
630 -                    else if(metaDataListDialog.getResult() == JOptionPane.NO_OPTION ){\r
631 -                        entry = createNewBlankEntry(fileName);\r
632 -                    }\r
633 -                    else if(document == null /*|| document.getDocuments() == null || document.getDocuments().size() <= 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
634 -                        entry = createNewBlankEntry(fileName);\r
635 -                    }\r
636 -                    assert(entry != null);\r
637 -                    res.add(entry);\r
638 -                    break;\r
639                         case ImportDialog.NOMETA:\r
640                      entry = createNewBlankEntry(fileName);\r
641                      res.add(entry);\r
642                      break;\r
643 -                       case ImportDialog.UPDATEEMPTYFIELDS:\r
644 -                    metaDataListDialog = new MetaDataListDialog(fileName, false);                   \r
645 -                    Tools.centerRelativeToWindow(metaDataListDialog, frame);\r
646 -                    metaDataListDialog.showDialog();\r
647 -                    document = metaDataListDialog.getXmlDocuments();\r
648 -                    if(document != null /*&& document.getDocuments() != null && document.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
649 -                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();\r
650 -                        if(selected > -1 /*&& selected < document.getDocuments().size()*/){\r
651 -                            //XmlDocument document = documents.getDocuments().get(selected);\r
652 -                            entry = entryTable.getEntryAt(dropRow);\r
653 -                            if(fieldExists(document.getType())){\r
654 -                                type = BibtexEntryType.getStandardType(document.getType());\r
655 -                                if(type != null){\r
656 -                                    entry.setType(type);\r
657 -                                }\r
658 -                            }\r
659 -                            //insertFields(entry.getRequiredFields(), entry, document);\r
660 -                            insertFields(BibtexFields.getAllFieldNames(), entry, document);\r
661 -                            //insertFields(entry.getOptionalFields(), entry, document);\r
662 -\r
663 -                            dfh = new DroppedFileHandler(frame, panel);\r
664 -                            dfh.linkPdfToEntry(fileName, entryTable, dropRow);\r
665 -                        }\r
666 -                    }\r
667 -                    break;\r
668 -                       case ImportDialog.ONLYATTACH:\r
669 -                    dfh = new DroppedFileHandler(frame, panel);\r
670 -                    dfh.linkPdfToEntry(fileName, entryTable, dropRow);\r
671 -                    break;\r
672                  }\r
673              }\r
674  \r
675 @@ -322,58 +239,6 @@
676          return newEntry;\r
677      }\r
678  \r
679 -    private void insertFields(String[] fields, BibtexEntry entry, Document xmlDocument) {\r
680 -        DocumentWrapper document = new DocumentWrapper(xmlDocument);\r
681 -        for(String field : fields){\r
682 -            if(entry.getField(field) != null){\r
683 -                continue;\r
684 -            }\r
685 -            if(field.equalsIgnoreCase("author")){\r
686 -                entry.setField(field, document.getAuthors("and"));\r
687 -            }\r
688 -            if(field.equalsIgnoreCase("title")){\r
689 -                entry.setField(field, document.getTitle());\r
690 -            }\r
691 -            if(field.equalsIgnoreCase("abstract")){\r
692 -                entry.setField(field, document.getAbstract());\r
693 -            }\r
694 -            /*if(field.equalsIgnoreCase("keywords")){\r
695 -                entry.setField(field, document.getKeyWords());\r
696 -            }*/\r
697 -            if(field.equalsIgnoreCase("doi")){\r
698 -                entry.setField(field, document.getDoi());\r
699 -            }\r
700 -            /*if(field.equalsIgnoreCase("pages")){\r
701 -                entry.setField(field, document.getPages());\r
702 -            }\r
703 -            if(field.equalsIgnoreCase("volume")){\r
704 -                entry.setField(field, document.getVolume());\r
705 -            }\r
706 -            if(field.equalsIgnoreCase("number")){\r
707 -                entry.setField(field, document.getNumber());\r
708 -            }*/\r
709 -            if(field.equalsIgnoreCase("year")){\r
710 -                entry.setField(field, document.getYear());\r
711 -            }\r
712 -            /*if(field.equalsIgnoreCase("month")){\r
713 -                entry.setField(field, document.getMonth());\r
714 -            }\r
715 -            if(field.equalsIgnoreCase("day")){\r
716 -                entry.setField(field, document.getDay());\r
717 -            }\r
718 -            if(field.equalsIgnoreCase("booktitle")){\r
719 -                entry.setField(field, document.getVenue());\r
720 -            }\r
721 -            if(field.equalsIgnoreCase("journal")){\r
722 -                entry.setField(field, document.getVenue());\r
723 -            }*/\r
724 -        }\r
725 -    }\r
726 -\r
727 -    private boolean fieldExists(String string) {\r
728 -        return string != null && !string.isEmpty();\r
729 -    }\r
730 -\r
731      private BibtexEntry createNewEntry() {\r
732  \r
733          // Find out what type is wanted.\r
734 --- a/src/java/spl/SplWebClient.java
735 +++ /dev/null
736 @@ -1,196 +0,0 @@
737 -package spl;\r
738 -\r
739 -import java.io.ByteArrayInputStream;\r
740 -import java.io.File;\r
741 -import java.io.FileInputStream;\r
742 -import java.io.InputStream;\r
743 -import java.io.UnsupportedEncodingException;\r
744 -\r
745 -import javax.ws.rs.core.MediaType;\r
746 -import javax.xml.bind.JAXB;\r
747 -\r
748 -import org.sciplore.beans.Author;\r
749 -import org.sciplore.beans.Document;\r
750 -import org.sciplore.deserialize.creator.AuthorBeanCreator;\r
751 -import org.sciplore.deserialize.creator.AuthorsBeanCreator;\r
752 -import org.sciplore.deserialize.creator.DefaultStringCreator;\r
753 -import org.sciplore.deserialize.creator.DocumentBeanCreator;\r
754 -import org.sciplore.deserialize.creator.DocumentsBeanCreator;\r
755 -import org.sciplore.deserialize.creator.ObjectCreator;\r
756 -import org.sciplore.deserialize.creator.TitleBeanCreator;\r
757 -import org.sciplore.deserialize.creator.YearBeanCreator;\r
758 -import org.sciplore.deserialize.reader.ObjectCreatorMapper;\r
759 -import org.sciplore.deserialize.reader.XmlResourceReader;\r
760 -import org.sciplore.formatter.Bean;\r
761 -import org.sciplore.formatter.SimpleTypeElementBean;\r
762 -\r
763 -import com.sun.jersey.api.client.Client;\r
764 -import com.sun.jersey.api.client.ClientResponse;\r
765 -import com.sun.jersey.api.client.WebResource;\r
766 -import com.sun.jersey.multipart.FormDataMultiPart;\r
767 -\r
768 -/**\r
769 - * Created by IntelliJ IDEA.\r
770 - * User: Christoph Arbeit\r
771 - * Date: 09.09.2010\r
772 - * Time: 10:35:20\r
773 - * To change this template use File | Settings | File Templates.\r
774 - */\r
775 -public class SplWebClient {\r
776 -\r
777 -    private static Client CLIENT = Client.create();\r
778 -    static{\r
779 -        CLIENT.setConnectTimeout(1000);\r
780 -        CLIENT.setReadTimeout(70000);\r
781 -    }\r
782 -    private static WebResource WEBRESOURCE = CLIENT.resource( "http://api.mr-dlib.org/" );\r
783 -    private static WebResource INTERNETRESOURCE = CLIENT.resource( "http://www.google.com" );\r
784 -    //private static WebResource WEBRESOURCE = CLIENT.resource( "http://localhost:8080/rest/" );\r
785 -\r
786 -    public static Document metadata;\r
787 -\r
788 -    public static WebServiceStatus getMetaData(File file){\r
789 -        try{\r
790 -            if(isWebServiceAvailable() == false){\r
791 -                if(isInternetAvailable()){\r
792 -                    return  WebServiceStatus.WEBSERVICE_DOWN;\r
793 -                }\r
794 -                else{\r
795 -                    return  WebServiceStatus.NO_INTERNET;\r
796 -                }\r
797 -            }\r
798 -            if(isWebServiceOutDated()){\r
799 -                return  WebServiceStatus.OUTDATED;\r
800 -            }\r
801 -            if(isMetaDataServiceAvailable() == false){\r
802 -                return  WebServiceStatus.UNAVAILABLE;\r
803 -            }\r
804 -            FileInputStream fin = new FileInputStream(file);      \r
805 -            byte[] data = new byte[(int)file.length()];          \r
806 -            fin.read(data);           \r
807 -            \r
808 -            FormDataMultiPart formDataMultiPart = new FormDataMultiPart();            \r
809 -            formDataMultiPart.field("file", data,  MediaType.APPLICATION_OCTET_STREAM_TYPE);            \r
810 -            formDataMultiPart.field("source", "jabref",  MediaType.TEXT_PLAIN_TYPE);\r
811 -            formDataMultiPart.field("filename", file.getName(), MediaType.TEXT_PLAIN_TYPE);\r
812 -           \r
813 -           \r
814 -            ClientResponse response = WEBRESOURCE.path("documents").type(MediaType.MULTIPART_FORM_DATA_TYPE).post(ClientResponse.class, formDataMultiPart);\r
815 -            //System.out.println(response.getEntity(String.class));\r
816 -            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
817 -                String entity = response.getEntity(String.class);\r
818 -                byte[] bytes = new byte[0];\r
819 -                try {\r
820 -                    bytes = entity.getBytes("UTF-8");\r
821 -                } catch (UnsupportedEncodingException e) {\r
822 -                    return null;\r
823 -                }\r
824 -                InputStream is = new ByteArrayInputStream(bytes);\r
825 -                if(is != null){\r
826 -                       ObjectCreatorMapper resourceMapper = new ObjectCreatorMapper();\r
827 -                       ObjectCreator stringCreator = new DefaultStringCreator();\r
828 -                       // initialize Mapper    \r
829 -                         resourceMapper.addCreator("documents", new DocumentsBeanCreator());\r
830 -                         resourceMapper.addCreator("authors", new AuthorsBeanCreator());\r
831 -                         resourceMapper.addCreator("document", new DocumentBeanCreator());\r
832 -                         resourceMapper.addCreator("title", new TitleBeanCreator());\r
833 -                         resourceMapper.addCreator("year", new YearBeanCreator());\r
834 -                         resourceMapper.addCreator("author", new AuthorBeanCreator());\r
835 -                         \r
836 -                         resourceMapper.addCreator("name_first", stringCreator);\r
837 -                         resourceMapper.addCreator("name_middle", stringCreator);\r
838 -                         resourceMapper.addCreator("name_last", stringCreator);\r
839 -                         resourceMapper.addCreator("name_last_prefix", stringCreator);\r
840 -                         resourceMapper.addCreator("name_last_suffix", stringCreator);\r
841 -                         \r
842 -                         // initialize xml reader\r
843 -                         XmlResourceReader<?> reader = new XmlResourceReader(resourceMapper);\r
844 -                         \r
845 -                         // parse given file -> create object tree\r
846 -                         Document docs =  (Document)reader.parse(is);\r
847 -                         for(Bean author : docs.getAuthors().getCollection()){\r
848 -                                 Author temp = (Author)author;\r
849 -                                 System.out.println(((SimpleTypeElementBean)temp.getName_Last()).getValue() + " " + temp.getRank());\r
850 -                         }\r
851 -                   // XmlDocuments documents = JAXB.unmarshal(is, XmlDocuments.class);\r
852 -                    SplWebClient.metadata = docs;\r
853 -                    return WebServiceStatus.OK;\r
854 -                }\r
855 -                else{\r
856 -                    return WebServiceStatus.NO_METADATA;\r
857 -                }\r
858 -            }\r
859 -            if(response.getClientResponseStatus() == ClientResponse.Status.SERVICE_UNAVAILABLE){\r
860 -                return  WebServiceStatus.UNAVAILABLE;\r
861 -            }\r
862 -        }catch(Exception e){\r
863 -            System.out.println(Tools.getStackTraceAsString(e));\r
864 -            //Todo logging\r
865 -        }\r
866 -        return WebServiceStatus.NO_METADATA;\r
867 -    }\r
868 -\r
869 -    public static boolean isWebServiceOutDated(){\r
870 -        try{\r
871 -            ClientResponse response =  WEBRESOURCE.path("service/versioncheck/" + Tools.WEBSERVICE_APP_ID + "/current").get(ClientResponse.class);\r
872 -            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
873 -                String entity = response.getEntity(String.class);\r
874 -                byte[] bytes = entity.getBytes();\r
875 -                InputStream is = new ByteArrayInputStream(bytes);\r
876 -                if(is != null){\r
877 -                    /*XmlApplication app = JAXB.unmarshal(is, XmlApplication.class);\r
878 -                    if(app != null){\r
879 -                        if(app.getVersion() != null && !app.getVersion().equalsIgnoreCase(Tools.WEBSERVICE_VERSION_SHORT)){\r
880 -                            return true;\r
881 -                        }\r
882 -                    }*/\r
883 -                }\r
884 -            }\r
885 -        }catch(Exception e){\r
886 -            //Todo logging\r
887 -        }\r
888 -        return false;\r
889 -    }\r
890 -\r
891 -    public static boolean isMetaDataServiceAvailable(){\r
892 -        try{\r
893 -            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);\r
894 -            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
895 -                String entity = response.getEntity(String.class);\r
896 -                if(entity != null && entity.equalsIgnoreCase("false")){\r
897 -                    return false;\r
898 -                }\r
899 -            }\r
900 -        }catch(Exception e){\r
901 -            //Todo logging\r
902 -        }\r
903 -        return true;\r
904 -    }\r
905 -\r
906 -    public static boolean isWebServiceAvailable(){\r
907 -        try{\r
908 -            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);\r
909 -        }catch(Exception e){\r
910 -            return false;\r
911 -        }\r
912 -        return true;\r
913 -    }\r
914 -\r
915 -    public static boolean isInternetAvailable(){\r
916 -        try{\r
917 -            ClientResponse response =  INTERNETRESOURCE.get(ClientResponse.class);\r
918 -        }catch(Exception e){\r
919 -            return false;\r
920 -        }\r
921 -        return true;\r
922 -    }\r
923 -\r
924 -    public enum WebServiceStatus {\r
925 -        OK,\r
926 -        NO_METADATA,\r
927 -        UNAVAILABLE,\r
928 -        OUTDATED,\r
929 -        WEBSERVICE_DOWN,\r
930 -        NO_INTERNET\r
931 -    }\r
932 -}\r
933 --- a/src/java/spl/gui/ImportDialog.java
934 +++ b/src/java/spl/gui/ImportDialog.java
935 @@ -20,9 +20,7 @@
936         public final static int NOMETA = 0;\r
937         public final static int XMP = 1;\r
938         public final static int CONTENT = 2;\r
939 -       public final static int MRDLIB = 3;\r
940         public final static int ONLYATTACH = 4;\r
941 -       public final static int UPDATEEMPTYFIELDS = 5;\r
942         \r
943      private JPanel contentPane;\r
944      private JLabel labelSubHeadline;\r
945 @@ -32,14 +30,10 @@
946         private JCheckBox useDefaultPDFImportStyle;\r
947      private JRadioButton radioButtonXmp;\r
948         private JRadioButton radioButtonPDFcontent;\r
949 -    private JRadioButton radioButtonMrDlib;\r
950      private JRadioButton radioButtonNoMeta;\r
951      private JLabel labelHeadline;\r
952      private JLabel labelFileName;\r
953      private JRadioButton radioButtononlyAttachPDF;\r
954 -    private JRadioButton radioButtonUpdateEmptyFields;\r
955 -    private JLabel labelMrDlib1;\r
956 -    private JLabel labelMrDlib2;\r
957      private int result;\r
958      private String fileName;\r
959      // indicates whether the drop target is a row in the table or whether other kinds of imports are used\r
960 @@ -72,15 +66,7 @@
961          radioButtonNoMeta = new JRadioButton(Globals.lang("Create_blank_entry_linking_the_PDF"));\r
962          radioButtonXmp = new JRadioButton(Globals.lang("Create_entry_based_on_XMP_data"));\r
963          radioButtonPDFcontent = new JRadioButton(Globals.lang("Create_entry_based_on_content"));\r
964 -        radioButtonMrDlib = new JRadioButton(Globals.lang("Create_entry_based_on_data_fetched_from"));\r
965          radioButtononlyAttachPDF = new JRadioButton(Globals.lang("Only_attach_PDF"));\r
966 -        radioButtonUpdateEmptyFields = new JRadioButton(Globals.lang("Update_empty_fields_with_data_fetched_from"));\r
967 -        labelMrDlib1 = new JLabel("Mr._dLib");\r
968 -        labelMrDlib1.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));\r
969 -        labelMrDlib1.setForeground(new Color(-16776961));\r
970 -        labelMrDlib2 = new JLabel("Mr._dLib");\r
971 -        labelMrDlib2.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));\r
972 -        labelMrDlib2.setForeground(new Color(-16776961));\r
973          buttonOK = new JButton(Globals.lang("Ok"));\r
974          buttonCancel = new JButton(Globals.lang("Cancel"));\r
975          checkBoxDoNotShowAgain = new JCheckBox(Globals.lang("Do not show this box again for this import"));\r
976 @@ -90,12 +76,8 @@
977          b.append(radioButtonNoMeta, 3);\r
978          b.append(radioButtonXmp, 3);\r
979          b.append(radioButtonPDFcontent, 3);\r
980 -        b.append(radioButtonMrDlib);\r
981 -        b.append(labelMrDlib1);\r
982          b.appendSeparator(Globals.lang("Update_Existing_Entry"));\r
983          b.append(radioButtononlyAttachPDF, 3);\r
984 -        b.append(radioButtonUpdateEmptyFields);\r
985 -        b.append(labelMrDlib2);\r
986          b.nextLine();\r
987          b.append(checkBoxDoNotShowAgain);\r
988          b.append(useDefaultPDFImportStyle);\r
989 @@ -113,8 +95,6 @@
990  \r
991          if (!this.targetIsARow) {\r
992              this.radioButtononlyAttachPDF.setEnabled(false);\r
993 -            this.radioButtonUpdateEmptyFields.setEnabled(false);\r
994 -            this.labelMrDlib2.setEnabled(false);\r
995          }\r
996          this.fileName = fileName;\r
997          String name = new File(this.fileName).getName();\r
998 @@ -123,8 +103,6 @@
999          } else {\r
1000              this.labelFileName.setText(new File(this.fileName).getName().substring(0, 33) + "...");\r
1001          }\r
1002 -        this.labelMrDlib1.addMouseListener(new LabelLinkListener(this.labelMrDlib1, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));\r
1003 -        this.labelMrDlib2.addMouseListener(new LabelLinkListener(this.labelMrDlib2, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));\r
1004          this.setTitle(LocalizationSupport.message("Import_Metadata_From_PDF"));\r
1005  \r
1006          setModal(true);\r
1007 @@ -135,9 +113,7 @@
1008          bg.add(radioButtonNoMeta);\r
1009          bg.add(radioButtonXmp);\r
1010          bg.add(radioButtonPDFcontent);\r
1011 -        bg.add(radioButtonMrDlib);\r
1012          bg.add(radioButtononlyAttachPDF);\r
1013 -        bg.add(radioButtonUpdateEmptyFields);\r
1014  \r
1015          buttonOK.addActionListener(new ActionListener() {\r
1016              public void actionPerformed(ActionEvent e) {\r
1017 @@ -174,15 +150,9 @@
1018                 case CONTENT:\r
1019                         radioButtonPDFcontent.setSelected(true);\r
1020                         break;\r
1021 -               case MRDLIB:\r
1022 -                       radioButtonMrDlib.setSelected(true);\r
1023 -                       break;\r
1024                 case ONLYATTACH:\r
1025                         radioButtononlyAttachPDF.setSelected(true);\r
1026                         break;\r
1027 -               case UPDATEEMPTYFIELDS:\r
1028 -                       radioButtonUpdateEmptyFields.setSelected(true);\r
1029 -                       break;\r
1030                 default:\r
1031                         // fallback\r
1032                         radioButtonPDFcontent.setSelected(true);\r
1033 @@ -217,14 +187,10 @@
1034                 return XMP;\r
1035         else if (radioButtonPDFcontent.isSelected())\r
1036                 return CONTENT;\r
1037 -       else if (radioButtonMrDlib.isSelected())\r
1038 -               return MRDLIB;\r
1039         else if (radioButtonNoMeta.isSelected())\r
1040                 return NOMETA;\r
1041         else if (radioButtononlyAttachPDF.isSelected())\r
1042                 return ONLYATTACH;\r
1043 -       else if (radioButtonUpdateEmptyFields.isSelected())\r
1044 -               return UPDATEEMPTYFIELDS;\r
1045         else throw new IllegalStateException();\r
1046      }\r
1047  \r
1048 --- a/src/java/spl/gui/MetaDataListDialog.java
1049 +++ /dev/null
1050 @@ -1,314 +0,0 @@
1051 -package spl.gui;\r
1052 -\r
1053 -\r
1054 -import java.awt.BorderLayout;\r
1055 -import java.awt.CardLayout;\r
1056 -import java.awt.Color;\r
1057 -import java.awt.Component;\r
1058 -import java.awt.Dimension;\r
1059 -import java.awt.Font;\r
1060 -import java.awt.event.ActionEvent;\r
1061 -import java.awt.event.ActionListener;\r
1062 -import java.awt.event.KeyEvent;\r
1063 -import java.awt.event.WindowAdapter;\r
1064 -import java.awt.event.WindowEvent;\r
1065 -import java.io.File;\r
1066 -import java.io.IOException;\r
1067 -import java.util.List;\r
1068 -import java.util.Vector;\r
1069 -\r
1070 -import javax.swing.BorderFactory;\r
1071 -import javax.swing.ImageIcon;\r
1072 -import javax.swing.JButton;\r
1073 -import javax.swing.JComponent;\r
1074 -import javax.swing.JDialog;\r
1075 -import javax.swing.JLabel;\r
1076 -import javax.swing.JOptionPane;\r
1077 -import javax.swing.JPanel;\r
1078 -import javax.swing.JScrollPane;\r
1079 -import javax.swing.JTable;\r
1080 -import javax.swing.KeyStroke;\r
1081 -import javax.swing.ListSelectionModel;\r
1082 -import javax.swing.SwingWorker;\r
1083 -import javax.swing.table.DefaultTableModel;\r
1084 -\r
1085 -import net.sf.jabref.Globals;\r
1086 -import net.sf.jabref.MetaData;\r
1087 -import net.sf.jabref.Util;\r
1088 -\r
1089 -import org.sciplore.beans.Document;\r
1090 -\r
1091 -import spl.DocumentsWrapper;\r
1092 -import spl.SplWebClient;\r
1093 -import spl.listener.LabelLinkListener;\r
1094 -import spl.localization.LocalizationSupport;\r
1095 -\r
1096 -import com.jgoodies.forms.builder.ButtonBarBuilder;\r
1097 -\r
1098 -public class MetaDataListDialog extends JDialog {\r
1099 -    private JPanel contentPane;\r
1100 -    private JTable tableMetadata;\r
1101 -    private JButton buttonOK;\r
1102 -    private JButton buttonCancel;\r
1103 -    private JScrollPane scrollPane;\r
1104 -    private JPanel panelWait;\r
1105 -    private JLabel labelFetch;\r
1106 -    private JLabel iconLabel;\r
1107 -    private JButton blankButton;\r
1108 -    private JLabel labelLogo;\r
1109 -    private JButton moreInformationButton;\r
1110 -    private JPanel panelMetadata;\r
1111 -    private DefaultTableModel tableModel;\r
1112 -    private int result;\r
1113 -    private Document xmlDocuments;\r
1114 -    private String fileName;\r
1115 -    private SplWebClient.WebServiceStatus webserviceStatus;\r
1116 -    private Component thisDialog;\r
1117 -    private boolean showBlankButton;\r
1118 -    private CardLayout cardLayou = new CardLayout();\r
1119 -\r
1120 -    public MetaDataListDialog(String fileName, boolean showBlankButton) {\r
1121 -        $$$setupUI$$$();\r
1122 -        this.showBlankButton = showBlankButton;\r
1123 -        this.thisDialog = this;\r
1124 -        this.fileName = fileName;\r
1125 -        this.labelLogo.addMouseListener(new LabelLinkListener(this.labelLogo, "www.mr-dlib.org"));\r
1126 -        this.setTitle(LocalizationSupport.message("Mr._dLib_Metadata_Entries_Associated_With_PDF_File"));\r
1127 -        this.tableMetadata.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
1128 -        setContentPane(contentPane);\r
1129 -        pack();\r
1130 -        setModal(true);\r
1131 -        getRootPane().setDefaultButton(buttonOK);\r
1132 -\r
1133 -        buttonOK.addActionListener(new ActionListener() {\r
1134 -            public void actionPerformed(ActionEvent e) {\r
1135 -                onOK();\r
1136 -            }\r
1137 -        });\r
1138 -\r
1139 -        buttonCancel.addActionListener(new ActionListener() {\r
1140 -            public void actionPerformed(ActionEvent e) {\r
1141 -                onCancel();\r
1142 -            }\r
1143 -        });\r
1144 -\r
1145 -        blankButton.addActionListener(new ActionListener() {\r
1146 -            public void actionPerformed(ActionEvent e) {\r
1147 -                onBlank();\r
1148 -            }\r
1149 -        });\r
1150 -\r
1151 -        moreInformationButton.addActionListener(new ActionListener() {\r
1152 -            public void actionPerformed(ActionEvent e) {\r
1153 -                onInfo();\r
1154 -            }\r
1155 -        });\r
1156 -\r
1157 -        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);\r
1158 -        addWindowListener(new WindowAdapter() {\r
1159 -            public void windowClosing(WindowEvent e) {\r
1160 -                onCancel();\r
1161 -            }\r
1162 -        });\r
1163 -\r
1164 -        contentPane.registerKeyboardAction(new ActionListener() {\r
1165 -            public void actionPerformed(ActionEvent e) {\r
1166 -                onCancel();\r
1167 -            }\r
1168 -        }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);\r
1169 -\r
1170 -        cardLayou.show(panelMetadata, "panelWait");\r
1171 -        //this.scrollPane.setVisible(false);\r
1172 -        //this.blankButton.setVisible(false);\r
1173 -        this.moreInformationButton.setVisible(true);\r
1174 -        this.setSize(616, 366);\r
1175 -    }\r
1176 -\r
1177 -    private void onInfo() {\r
1178 -        try {\r
1179 -            Util.openExternalViewer(new MetaData(), "http://www.mr-dlib.org/docs/jabref_metadata_extraction_alpha.php", "url");\r
1180 -        } catch (IOException exc) {\r
1181 -            exc.printStackTrace();\r
1182 -        }\r
1183 -    }\r
1184 -\r
1185 -    private void onBlank() {\r
1186 -        this.result = JOptionPane.NO_OPTION;\r
1187 -        dispose();\r
1188 -    }\r
1189 -\r
1190 -    private void onOK() {\r
1191 -        this.result = JOptionPane.OK_OPTION;\r
1192 -        dispose();\r
1193 -    }\r
1194 -\r
1195 -    private void onCancel() {\r
1196 -        this.result = JOptionPane.CANCEL_OPTION;\r
1197 -        dispose();\r
1198 -    }\r
1199 -\r
1200 -    public void showDialog() {\r
1201 -        SwingWorker worker = new SwingWorker<Void, Void>() {\r
1202 -            @Override\r
1203 -            public Void doInBackground() {\r
1204 -                System.out.println("Starting Webclient...");\r
1205 -                webserviceStatus = SplWebClient.getMetaData(new File(fileName));\r
1206 -                return null;\r
1207 -            }\r
1208 -\r
1209 -            @Override\r
1210 -            public void done() {\r
1211 -                if (webserviceStatus == SplWebClient.WebServiceStatus.OK) {\r
1212 -                    xmlDocuments = SplWebClient.metadata;\r
1213 -                    if (xmlDocuments != null /*&& xmlDocuments.getDocuments() != null && xmlDocuments.getDocuments().size() > 0*/) {\r
1214 -                        DocumentsWrapper documents = new DocumentsWrapper(xmlDocuments);\r
1215 -                        List<Vector> vectorList = documents.getDocuments();\r
1216 -                        for (Vector vector : vectorList) {\r
1217 -                            tableModel.addRow(vector);\r
1218 -                        }\r
1219 -\r
1220 -                        tableMetadata.getSelectionModel().setSelectionInterval(0, 0);\r
1221 -                        cardLayou.show(panelMetadata, "scrollPane");\r
1222 -                        //panelWait.setVisible(false);\r
1223 -                        //scrollPane.setVisible(true);\r
1224 -                        moreInformationButton.setVisible(true);\r
1225 -                    } else {\r
1226 -                        iconLabel.setVisible(false);\r
1227 -                        labelFetch.setText(LocalizationSupport.message("No_metadata_found."));\r
1228 -                        blankButton.setVisible(showBlankButton);\r
1229 -                    }\r
1230 -                }\r
1231 -                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_METADATA) {\r
1232 -                    iconLabel.setVisible(false);\r
1233 -                    labelFetch.setText(LocalizationSupport.message("No_metadata_found."));\r
1234 -                    blankButton.setVisible(showBlankButton);\r
1235 -                }\r
1236 -                if (webserviceStatus == SplWebClient.WebServiceStatus.UNAVAILABLE) {\r
1237 -                    iconLabel.setVisible(false);\r
1238 -                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_unavailable."));\r
1239 -                    blankButton.setVisible(showBlankButton);\r
1240 -                }\r
1241 -                if (webserviceStatus == SplWebClient.WebServiceStatus.OUTDATED) {\r
1242 -                    iconLabel.setVisible(false);\r
1243 -                    labelFetch.setText(LocalizationSupport.message("The_Mr._dLib_web_service_version_you_trying_to_access_is_outdated."));\r
1244 -                    blankButton.setVisible(showBlankButton);\r
1245 -                    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
1246 -                }\r
1247 -                if (webserviceStatus == SplWebClient.WebServiceStatus.WEBSERVICE_DOWN) {\r
1248 -                    iconLabel.setVisible(false);\r
1249 -                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_down._Please_try_again_later."));\r
1250 -                    blankButton.setVisible(showBlankButton);\r
1251 -                }\r
1252 -                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_INTERNET) {\r
1253 -                    iconLabel.setVisible(false);\r
1254 -                    labelFetch.setText(LocalizationSupport.message("No_Internet_Connection."));\r
1255 -                    blankButton.setVisible(showBlankButton);\r
1256 -                    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
1257 -                }\r
1258 -            }\r
1259 -        };\r
1260 -        worker.execute();\r
1261 -        this.pack();\r
1262 -        this.setVisible(true);\r
1263 -    }\r
1264 -\r
1265 -    public Document getXmlDocuments() {\r
1266 -        return xmlDocuments;\r
1267 -    }\r
1268 -\r
1269 -    private void createUIComponents() {\r
1270 -        this.tableModel = new MyTableModel();\r
1271 -        this.tableModel.addColumn(LocalizationSupport.message("Title"));\r
1272 -        this.tableModel.addColumn(LocalizationSupport.message("Author(s)"));\r
1273 -        this.tableModel.addColumn(LocalizationSupport.message("Published_Year"));\r
1274 -        this.tableMetadata = new JTable(this.tableModel);\r
1275 -    }\r
1276 -\r
1277 -    public JTable getTableMetadata() {\r
1278 -        return tableMetadata;\r
1279 -    }\r
1280 -\r
1281 -    public int getResult() {\r
1282 -        return result;\r
1283 -    }\r
1284 -\r
1285 -    public JButton getBlankButton() {\r
1286 -        return blankButton;\r
1287 -    }\r
1288 -\r
1289 -    private void $$$setupUI$$$() {\r
1290 -        createUIComponents();\r
1291 -        contentPane = new JPanel();\r
1292 -        contentPane.setLayout(new BorderLayout());\r
1293 -        labelLogo = new JLabel();\r
1294 -        labelLogo.setIcon(new ImageIcon(getClass().getResource("/spl/gui/mrdlib header.png")));\r
1295 -        labelLogo.setText("");\r
1296 -        contentPane.add(labelLogo, BorderLayout.NORTH);\r
1297 -        panelMetadata = new JPanel();\r
1298 -        panelMetadata.setLayout(cardLayou);\r
1299 -\r
1300 -\r
1301 -        panelMetadata.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null));\r
1302 -        scrollPane = new JScrollPane();\r
1303 -        scrollPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), null));\r
1304 -        tableMetadata.setAutoCreateRowSorter(false);\r
1305 -        tableMetadata.setEnabled(true);\r
1306 -        tableMetadata.setFillsViewportHeight(true);\r
1307 -        tableMetadata.setShowVerticalLines(true);\r
1308 -        scrollPane.setViewportView(tableMetadata);\r
1309 -        panelMetadata.add(scrollPane, "scrollPane");\r
1310 -        panelWait = new JPanel();\r
1311 -        panelWait.setLayout(new BorderLayout());\r
1312 -        panelWait.setBackground(new Color(-1));\r
1313 -        panelMetadata.add(panelWait, "panelWait");\r
1314 -        panelWait.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), null));\r
1315 -        iconLabel = new JLabel();\r
1316 -        iconLabel.setBackground(new Color(-1));\r
1317 -        iconLabel.setHorizontalAlignment(0);\r
1318 -        iconLabel.setHorizontalTextPosition(11);\r
1319 -        iconLabel.setIcon(new ImageIcon(getClass().getResource("/spl/gui/ajax-loader.gif")));\r
1320 -        iconLabel.setText("");\r
1321 -        panelWait.add(iconLabel, BorderLayout.CENTER);\r
1322 -        labelFetch = new JLabel();\r
1323 -        labelFetch.setHorizontalAlignment(JLabel.CENTER);\r
1324 -        labelFetch.setFont(new Font(labelFetch.getFont().getName(), labelFetch.getFont().getStyle(), 13));\r
1325 -        labelFetch.setText(Globals.lang("Fetching Metadata..."));\r
1326 -        panelWait.add(labelFetch, BorderLayout.SOUTH);\r
1327 -\r
1328 -        cardLayou.show(panelMetadata, "panelWait");\r
1329 -        panelMetadata.setPreferredSize(new Dimension(400, 200));\r
1330 -        contentPane.add(panelMetadata, BorderLayout.CENTER);\r
1331 -\r
1332 -        buttonOK = new JButton(Globals.lang("Ok"));\r
1333 -        buttonCancel = new JButton(Globals.lang("Cancel"));\r
1334 -        moreInformationButton = new JButton(Globals.lang("More information"));\r
1335 -        ButtonBarBuilder bb = new ButtonBarBuilder();\r
1336 -        bb.addGlue();\r
1337 -        bb.addButton(moreInformationButton);\r
1338 -        bb.addButton(buttonOK);\r
1339 -        bb.addButton(buttonCancel);\r
1340 -        bb.addGlue();\r
1341 -        blankButton = new JButton();\r
1342 -        blankButton.setText("");\r
1343 -        contentPane.add(bb.getPanel(), BorderLayout.SOUTH);\r
1344 -        iconLabel.setLabelFor(scrollPane);\r
1345 -\r
1346 -\r
1347 -    }\r
1348 -\r
1349 -    /**\r
1350 -     * @noinspection ALL\r
1351 -     */\r
1352 -    public JComponent $$$getRootComponent$$$() {\r
1353 -        return contentPane;\r
1354 -    }\r
1355 -\r
1356 -    public class MyTableModel extends DefaultTableModel {\r
1357 -\r
1358 -        @Override\r
1359 -        public boolean isCellEditable(int row, int column) {\r
1360 -            return false;\r
1361 -        }\r
1362 -    }\r
1363 -\r
1364 -}\r