refresh patch again
[debian/jabref.git] / debian / patches / mrDlib_jayatana.patch
1 Description: This is the diff between the debian branch and the v_2.10b 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: 2013-03-29
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 @@ -18,12 +18,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 @@ -101,7 +97,6 @@
579                 BibtexEntryType type;\r
580                  InputStream in = null;\r
581                  List<BibtexEntry> res = 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 @@ -188,84 +183,9 @@
587                          panel.adjustSplitter();\r
588                      }\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 -                    if(document != null /*&& documents.getDocuments() != null && documents.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
596 -                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();\r
597 -                        if(selected > -1 /*&& selected < documents.getDocuments().size()*/){\r
598 -                            //Document document = documents/*.getDocuments().get(selected)*/;\r
599 -                            String id = Util.createNeutralId();\r
600 -                            entry = new BibtexEntry(id);\r
601 -                            if(fieldExists(document.getType())){\r
602 -                                type = BibtexEntryType.getStandardType(document.getType());\r
603 -                                if(type == null){\r
604 -                                    type = BibtexEntryType.ARTICLE;\r
605 -                                }\r
606 -                                entry.setType(type);\r
607 -                            }\r
608 -                            else{\r
609 -                                entry.setType(BibtexEntryType.ARTICLE);\r
610 -                            }\r
611 -                            ArrayList<BibtexEntry> list = new ArrayList<BibtexEntry>();\r
612 -                            list.add(entry);\r
613 -                            Util.setAutomaticFields(list, true, true, false);\r
614 -                            //insertFields(entry.getRequiredFields(), entry, document);\r
615 -                            insertFields(BibtexFields.getAllFieldNames(), entry, document);\r
616 -                            //insertFields(entry.getOptionalFields(), entry, document);\r
617 -                            panel.database().insertEntry(entry);\r
618 -                            dfh = new DroppedFileHandler(frame, panel);\r
619 -                            dfh.linkPdfToEntry(fileName, entryTable, entry);\r
620 -                            LabelPatternUtil.makeLabel(panel.metaData(), panel.database(), entry);\r
621 -                        }\r
622 -                        else{\r
623 -                            createNewBlankEntry(fileName);\r
624 -                        }\r
625 -                    }\r
626 -                    else if(metaDataListDialog.getResult() == JOptionPane.CANCEL_OPTION ){\r
627 -                        continue;\r
628 -                    }\r
629 -                    else if(metaDataListDialog.getResult() == JOptionPane.NO_OPTION ){\r
630 -                        createNewBlankEntry(fileName);\r
631 -                    }\r
632 -                    else if(document == null /*|| document.getDocuments() == null || document.getDocuments().size() <= 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
633 -                        createNewBlankEntry(fileName);\r
634 -                    }\r
635 -                    break;\r
636                         case ImportDialog.NOMETA:\r
637                      createNewBlankEntry(fileName);\r
638                      break;\r
639 -                       case ImportDialog.UPDATEEMPTYFIELDS:\r
640 -                    metaDataListDialog = new MetaDataListDialog(fileName, false);                   \r
641 -                    Tools.centerRelativeToWindow(metaDataListDialog, frame);\r
642 -                    metaDataListDialog.showDialog();\r
643 -                    document = metaDataListDialog.getXmlDocuments();\r
644 -                    if(document != null /*&& document.getDocuments() != null && document.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
645 -                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();\r
646 -                        if(selected > -1 /*&& selected < document.getDocuments().size()*/){\r
647 -                            //XmlDocument document = documents.getDocuments().get(selected);\r
648 -                            entry = entryTable.getEntryAt(dropRow);\r
649 -                            if(fieldExists(document.getType())){\r
650 -                                type = BibtexEntryType.getStandardType(document.getType());\r
651 -                                if(type != null){\r
652 -                                    entry.setType(type);\r
653 -                                }\r
654 -                            }\r
655 -                            //insertFields(entry.getRequiredFields(), entry, document);\r
656 -                            insertFields(BibtexFields.getAllFieldNames(), entry, document);\r
657 -                            //insertFields(entry.getOptionalFields(), entry, document);\r
658 -\r
659 -                            dfh = new DroppedFileHandler(frame, panel);\r
660 -                            dfh.linkPdfToEntry(fileName, entryTable, dropRow);\r
661 -                        }\r
662 -                    }\r
663 -                    break;\r
664 -                       case ImportDialog.ONLYATTACH:\r
665 -                    dfh = new DroppedFileHandler(frame, panel);\r
666 -                    dfh.linkPdfToEntry(fileName, entryTable, dropRow);\r
667 -                    break;\r
668                  }\r
669              }\r
670  \r
671 @@ -283,58 +203,6 @@
672          }\r
673      }\r
674  \r
675 -    private void insertFields(String[] fields, BibtexEntry entry, Document xmlDocument) {\r
676 -        DocumentWrapper document = new DocumentWrapper(xmlDocument);\r
677 -        for(String field : fields){\r
678 -            if(entry.getField(field) != null){\r
679 -                continue;\r
680 -            }\r
681 -            if(field.equalsIgnoreCase("author")){\r
682 -                entry.setField(field, document.getAuthors("and"));\r
683 -            }\r
684 -            if(field.equalsIgnoreCase("title")){\r
685 -                entry.setField(field, document.getTitle());\r
686 -            }\r
687 -            if(field.equalsIgnoreCase("abstract")){\r
688 -                entry.setField(field, document.getAbstract());\r
689 -            }\r
690 -            /*if(field.equalsIgnoreCase("keywords")){\r
691 -                entry.setField(field, document.getKeyWords());\r
692 -            }*/\r
693 -            if(field.equalsIgnoreCase("doi")){\r
694 -                entry.setField(field, document.getDoi());\r
695 -            }\r
696 -            /*if(field.equalsIgnoreCase("pages")){\r
697 -                entry.setField(field, document.getPages());\r
698 -            }\r
699 -            if(field.equalsIgnoreCase("volume")){\r
700 -                entry.setField(field, document.getVolume());\r
701 -            }\r
702 -            if(field.equalsIgnoreCase("number")){\r
703 -                entry.setField(field, document.getNumber());\r
704 -            }*/\r
705 -            if(field.equalsIgnoreCase("year")){\r
706 -                entry.setField(field, document.getYear());\r
707 -            }\r
708 -            /*if(field.equalsIgnoreCase("month")){\r
709 -                entry.setField(field, document.getMonth());\r
710 -            }\r
711 -            if(field.equalsIgnoreCase("day")){\r
712 -                entry.setField(field, document.getDay());\r
713 -            }\r
714 -            if(field.equalsIgnoreCase("booktitle")){\r
715 -                entry.setField(field, document.getVenue());\r
716 -            }\r
717 -            if(field.equalsIgnoreCase("journal")){\r
718 -                entry.setField(field, document.getVenue());\r
719 -            }*/\r
720 -        }\r
721 -    }\r
722 -\r
723 -    private boolean fieldExists(String string) {\r
724 -        return string != null && !string.isEmpty();\r
725 -    }\r
726 -\r
727      private BibtexEntry createNewEntry() {\r
728  \r
729          // Find out what type is wanted.\r
730 --- a/src/java/spl/SplWebClient.java
731 +++ /dev/null
732 @@ -1,196 +0,0 @@
733 -package spl;\r
734 -\r
735 -import java.io.ByteArrayInputStream;\r
736 -import java.io.File;\r
737 -import java.io.FileInputStream;\r
738 -import java.io.InputStream;\r
739 -import java.io.UnsupportedEncodingException;\r
740 -\r
741 -import javax.ws.rs.core.MediaType;\r
742 -import javax.xml.bind.JAXB;\r
743 -\r
744 -import org.sciplore.beans.Author;\r
745 -import org.sciplore.beans.Document;\r
746 -import org.sciplore.deserialize.creator.AuthorBeanCreator;\r
747 -import org.sciplore.deserialize.creator.AuthorsBeanCreator;\r
748 -import org.sciplore.deserialize.creator.DefaultStringCreator;\r
749 -import org.sciplore.deserialize.creator.DocumentBeanCreator;\r
750 -import org.sciplore.deserialize.creator.DocumentsBeanCreator;\r
751 -import org.sciplore.deserialize.creator.ObjectCreator;\r
752 -import org.sciplore.deserialize.creator.TitleBeanCreator;\r
753 -import org.sciplore.deserialize.creator.YearBeanCreator;\r
754 -import org.sciplore.deserialize.reader.ObjectCreatorMapper;\r
755 -import org.sciplore.deserialize.reader.XmlResourceReader;\r
756 -import org.sciplore.formatter.Bean;\r
757 -import org.sciplore.formatter.SimpleTypeElementBean;\r
758 -\r
759 -import com.sun.jersey.api.client.Client;\r
760 -import com.sun.jersey.api.client.ClientResponse;\r
761 -import com.sun.jersey.api.client.WebResource;\r
762 -import com.sun.jersey.multipart.FormDataMultiPart;\r
763 -\r
764 -/**\r
765 - * Created by IntelliJ IDEA.\r
766 - * User: Christoph Arbeit\r
767 - * Date: 09.09.2010\r
768 - * Time: 10:35:20\r
769 - * To change this template use File | Settings | File Templates.\r
770 - */\r
771 -public class SplWebClient {\r
772 -\r
773 -    private static Client CLIENT = Client.create();\r
774 -    static{\r
775 -        CLIENT.setConnectTimeout(1000);\r
776 -        CLIENT.setReadTimeout(70000);\r
777 -    }\r
778 -    private static WebResource WEBRESOURCE = CLIENT.resource( "http://api.mr-dlib.org/" );\r
779 -    private static WebResource INTERNETRESOURCE = CLIENT.resource( "http://www.google.com" );\r
780 -    //private static WebResource WEBRESOURCE = CLIENT.resource( "http://localhost:8080/rest/" );\r
781 -\r
782 -    public static Document metadata;\r
783 -\r
784 -    public static WebServiceStatus getMetaData(File file){\r
785 -        try{\r
786 -            if(isWebServiceAvailable() == false){\r
787 -                if(isInternetAvailable()){\r
788 -                    return  WebServiceStatus.WEBSERVICE_DOWN;\r
789 -                }\r
790 -                else{\r
791 -                    return  WebServiceStatus.NO_INTERNET;\r
792 -                }\r
793 -            }\r
794 -            if(isWebServiceOutDated()){\r
795 -                return  WebServiceStatus.OUTDATED;\r
796 -            }\r
797 -            if(isMetaDataServiceAvailable() == false){\r
798 -                return  WebServiceStatus.UNAVAILABLE;\r
799 -            }\r
800 -            FileInputStream fin = new FileInputStream(file);      \r
801 -            byte[] data = new byte[(int)file.length()];          \r
802 -            fin.read(data);           \r
803 -            \r
804 -            FormDataMultiPart formDataMultiPart = new FormDataMultiPart();            \r
805 -            formDataMultiPart.field("file", data,  MediaType.APPLICATION_OCTET_STREAM_TYPE);            \r
806 -            formDataMultiPart.field("source", "jabref",  MediaType.TEXT_PLAIN_TYPE);\r
807 -            formDataMultiPart.field("filename", file.getName(), MediaType.TEXT_PLAIN_TYPE);\r
808 -           \r
809 -           \r
810 -            ClientResponse response = WEBRESOURCE.path("documents").type(MediaType.MULTIPART_FORM_DATA_TYPE).post(ClientResponse.class, formDataMultiPart);\r
811 -            //System.out.println(response.getEntity(String.class));\r
812 -            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
813 -                String entity = response.getEntity(String.class);\r
814 -                byte[] bytes = new byte[0];\r
815 -                try {\r
816 -                    bytes = entity.getBytes("UTF-8");\r
817 -                } catch (UnsupportedEncodingException e) {\r
818 -                    return null;\r
819 -                }\r
820 -                InputStream is = new ByteArrayInputStream(bytes);\r
821 -                if(is != null){\r
822 -                       ObjectCreatorMapper resourceMapper = new ObjectCreatorMapper();\r
823 -                       ObjectCreator stringCreator = new DefaultStringCreator();\r
824 -                       // initialize Mapper    \r
825 -                         resourceMapper.addCreator("documents", new DocumentsBeanCreator());\r
826 -                         resourceMapper.addCreator("authors", new AuthorsBeanCreator());\r
827 -                         resourceMapper.addCreator("document", new DocumentBeanCreator());\r
828 -                         resourceMapper.addCreator("title", new TitleBeanCreator());\r
829 -                         resourceMapper.addCreator("year", new YearBeanCreator());\r
830 -                         resourceMapper.addCreator("author", new AuthorBeanCreator());\r
831 -                         \r
832 -                         resourceMapper.addCreator("name_first", stringCreator);\r
833 -                         resourceMapper.addCreator("name_middle", stringCreator);\r
834 -                         resourceMapper.addCreator("name_last", stringCreator);\r
835 -                         resourceMapper.addCreator("name_last_prefix", stringCreator);\r
836 -                         resourceMapper.addCreator("name_last_suffix", stringCreator);\r
837 -                         \r
838 -                         // initialize xml reader\r
839 -                         XmlResourceReader<?> reader = new XmlResourceReader(resourceMapper);\r
840 -                         \r
841 -                         // parse given file -> create object tree\r
842 -                         Document docs =  (Document)reader.parse(is);\r
843 -                         for(Bean author : docs.getAuthors().getCollection()){\r
844 -                                 Author temp = (Author)author;\r
845 -                                 System.out.println(((SimpleTypeElementBean)temp.getName_Last()).getValue() + " " + temp.getRank());\r
846 -                         }\r
847 -                   // XmlDocuments documents = JAXB.unmarshal(is, XmlDocuments.class);\r
848 -                    SplWebClient.metadata = docs;\r
849 -                    return WebServiceStatus.OK;\r
850 -                }\r
851 -                else{\r
852 -                    return WebServiceStatus.NO_METADATA;\r
853 -                }\r
854 -            }\r
855 -            if(response.getClientResponseStatus() == ClientResponse.Status.SERVICE_UNAVAILABLE){\r
856 -                return  WebServiceStatus.UNAVAILABLE;\r
857 -            }\r
858 -        }catch(Exception e){\r
859 -            System.out.println(Tools.getStackTraceAsString(e));\r
860 -            //Todo logging\r
861 -        }\r
862 -        return WebServiceStatus.NO_METADATA;\r
863 -    }\r
864 -\r
865 -    public static boolean isWebServiceOutDated(){\r
866 -        try{\r
867 -            ClientResponse response =  WEBRESOURCE.path("service/versioncheck/" + Tools.WEBSERVICE_APP_ID + "/current").get(ClientResponse.class);\r
868 -            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
869 -                String entity = response.getEntity(String.class);\r
870 -                byte[] bytes = entity.getBytes();\r
871 -                InputStream is = new ByteArrayInputStream(bytes);\r
872 -                if(is != null){\r
873 -                    /*XmlApplication app = JAXB.unmarshal(is, XmlApplication.class);\r
874 -                    if(app != null){\r
875 -                        if(app.getVersion() != null && !app.getVersion().equalsIgnoreCase(Tools.WEBSERVICE_VERSION_SHORT)){\r
876 -                            return true;\r
877 -                        }\r
878 -                    }*/\r
879 -                }\r
880 -            }\r
881 -        }catch(Exception e){\r
882 -            //Todo logging\r
883 -        }\r
884 -        return false;\r
885 -    }\r
886 -\r
887 -    public static boolean isMetaDataServiceAvailable(){\r
888 -        try{\r
889 -            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);\r
890 -            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
891 -                String entity = response.getEntity(String.class);\r
892 -                if(entity != null && entity.equalsIgnoreCase("false")){\r
893 -                    return false;\r
894 -                }\r
895 -            }\r
896 -        }catch(Exception e){\r
897 -            //Todo logging\r
898 -        }\r
899 -        return true;\r
900 -    }\r
901 -\r
902 -    public static boolean isWebServiceAvailable(){\r
903 -        try{\r
904 -            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);\r
905 -        }catch(Exception e){\r
906 -            return false;\r
907 -        }\r
908 -        return true;\r
909 -    }\r
910 -\r
911 -    public static boolean isInternetAvailable(){\r
912 -        try{\r
913 -            ClientResponse response =  INTERNETRESOURCE.get(ClientResponse.class);\r
914 -        }catch(Exception e){\r
915 -            return false;\r
916 -        }\r
917 -        return true;\r
918 -    }\r
919 -\r
920 -    public enum WebServiceStatus {\r
921 -        OK,\r
922 -        NO_METADATA,\r
923 -        UNAVAILABLE,\r
924 -        OUTDATED,\r
925 -        WEBSERVICE_DOWN,\r
926 -        NO_INTERNET\r
927 -    }\r
928 -}\r
929 --- a/src/java/spl/gui/ImportDialog.java
930 +++ b/src/java/spl/gui/ImportDialog.java
931 @@ -20,9 +20,7 @@
932         public final static int NOMETA = 0;\r
933         public final static int XMP = 1;\r
934         public final static int CONTENT = 2;\r
935 -       public final static int MRDLIB = 3;\r
936         public final static int ONLYATTACH = 4;\r
937 -       public final static int UPDATEEMPTYFIELDS = 5;\r
938         \r
939      private JPanel contentPane;\r
940      private JLabel labelSubHeadline;\r
941 @@ -32,14 +30,10 @@
942         private JCheckBox useDefaultPDFImportStyle;\r
943      private JRadioButton radioButtonXmp;\r
944         private JRadioButton radioButtonPDFcontent;\r
945 -    private JRadioButton radioButtonMrDlib;\r
946      private JRadioButton radioButtonNoMeta;\r
947      private JLabel labelHeadline;\r
948      private JLabel labelFileName;\r
949      private JRadioButton radioButtononlyAttachPDF;\r
950 -    private JRadioButton radioButtonUpdateEmptyFields;\r
951 -    private JLabel labelMrDlib1;\r
952 -    private JLabel labelMrDlib2;\r
953      private int result;\r
954      private int dropRow;\r
955      private String fileName;\r
956 @@ -71,15 +65,7 @@
957          radioButtonNoMeta = new JRadioButton(Globals.lang("Create_blank_entry_linking_the_PDF"));\r
958          radioButtonXmp = new JRadioButton(Globals.lang("Create_entry_based_on_XMP_data"));\r
959          radioButtonPDFcontent = new JRadioButton(Globals.lang("Create_entry_based_on_content"));\r
960 -        radioButtonMrDlib = new JRadioButton(Globals.lang("Create_entry_based_on_data_fetched_from"));\r
961          radioButtononlyAttachPDF = new JRadioButton(Globals.lang("Only_attach_PDF"));\r
962 -        radioButtonUpdateEmptyFields = new JRadioButton(Globals.lang("Update_empty_fields_with_data_fetched_from"));\r
963 -        labelMrDlib1 = new JLabel("Mr._dLib");\r
964 -        labelMrDlib1.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));\r
965 -        labelMrDlib1.setForeground(new Color(-16776961));\r
966 -        labelMrDlib2 = new JLabel("Mr._dLib");\r
967 -        labelMrDlib2.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));\r
968 -        labelMrDlib2.setForeground(new Color(-16776961));\r
969          buttonOK = new JButton(Globals.lang("Ok"));\r
970          buttonCancel = new JButton(Globals.lang("Cancel"));\r
971          checkBoxDoNotShowAgain = new JCheckBox(Globals.lang("Do not show this box again for this import"));\r
972 @@ -89,12 +75,8 @@
973          b.append(radioButtonNoMeta, 3);\r
974          b.append(radioButtonXmp, 3);\r
975          b.append(radioButtonPDFcontent, 3);\r
976 -        b.append(radioButtonMrDlib);\r
977 -        b.append(labelMrDlib1);\r
978          b.appendSeparator(Globals.lang("Update_Existing_Entry"));\r
979          b.append(radioButtononlyAttachPDF, 3);\r
980 -        b.append(radioButtonUpdateEmptyFields);\r
981 -        b.append(labelMrDlib2);\r
982          b.nextLine();\r
983          b.append(checkBoxDoNotShowAgain);\r
984          b.append(useDefaultPDFImportStyle);\r
985 @@ -114,8 +96,6 @@
986          //this.setText();\r
987          if (this.dropRow < 0) {\r
988              this.radioButtononlyAttachPDF.setEnabled(false);\r
989 -            this.radioButtonUpdateEmptyFields.setEnabled(false);\r
990 -            this.labelMrDlib2.setEnabled(false);\r
991          }\r
992          this.fileName = fileName;\r
993          String name = new File(this.fileName).getName();\r
994 @@ -124,8 +104,6 @@
995          } else {\r
996              this.labelFileName.setText(new File(this.fileName).getName().substring(0, 33) + "...");\r
997          }\r
998 -        this.labelMrDlib1.addMouseListener(new LabelLinkListener(this.labelMrDlib1, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));\r
999 -        this.labelMrDlib2.addMouseListener(new LabelLinkListener(this.labelMrDlib2, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));\r
1000          this.setTitle(LocalizationSupport.message("Import_Metadata_From_PDF"));\r
1001  \r
1002          setModal(true);\r
1003 @@ -136,9 +114,7 @@
1004          bg.add(radioButtonNoMeta);\r
1005          bg.add(radioButtonXmp);\r
1006          bg.add(radioButtonPDFcontent);\r
1007 -        bg.add(radioButtonMrDlib);\r
1008          bg.add(radioButtononlyAttachPDF);\r
1009 -        bg.add(radioButtonUpdateEmptyFields);\r
1010  \r
1011          buttonOK.addActionListener(new ActionListener() {\r
1012              public void actionPerformed(ActionEvent e) {\r
1013 @@ -175,15 +151,9 @@
1014                 case CONTENT:\r
1015                         radioButtonPDFcontent.setSelected(true);\r
1016                         break;\r
1017 -               case MRDLIB:\r
1018 -                       radioButtonMrDlib.setSelected(true);\r
1019 -                       break;\r
1020                 case ONLYATTACH:\r
1021                         radioButtononlyAttachPDF.setSelected(true);\r
1022                         break;\r
1023 -               case UPDATEEMPTYFIELDS:\r
1024 -                       radioButtonUpdateEmptyFields.setSelected(true);\r
1025 -                       break;\r
1026                 default:\r
1027                         // fallback\r
1028                         radioButtonPDFcontent.setSelected(true);\r
1029 @@ -218,14 +188,10 @@
1030                 return XMP;\r
1031         else if (radioButtonPDFcontent.isSelected())\r
1032                 return CONTENT;\r
1033 -       else if (radioButtonMrDlib.isSelected())\r
1034 -               return MRDLIB;\r
1035         else if (radioButtonNoMeta.isSelected())\r
1036                 return NOMETA;\r
1037         else if (radioButtononlyAttachPDF.isSelected())\r
1038                 return ONLYATTACH;\r
1039 -       else if (radioButtonUpdateEmptyFields.isSelected())\r
1040 -               return UPDATEEMPTYFIELDS;\r
1041         else throw new IllegalStateException();\r
1042      }\r
1043  \r
1044 --- a/src/java/spl/gui/MetaDataListDialog.java
1045 +++ /dev/null
1046 @@ -1,314 +0,0 @@
1047 -package spl.gui;\r
1048 -\r
1049 -\r
1050 -import java.awt.BorderLayout;\r
1051 -import java.awt.CardLayout;\r
1052 -import java.awt.Color;\r
1053 -import java.awt.Component;\r
1054 -import java.awt.Dimension;\r
1055 -import java.awt.Font;\r
1056 -import java.awt.event.ActionEvent;\r
1057 -import java.awt.event.ActionListener;\r
1058 -import java.awt.event.KeyEvent;\r
1059 -import java.awt.event.WindowAdapter;\r
1060 -import java.awt.event.WindowEvent;\r
1061 -import java.io.File;\r
1062 -import java.io.IOException;\r
1063 -import java.util.List;\r
1064 -import java.util.Vector;\r
1065 -\r
1066 -import javax.swing.BorderFactory;\r
1067 -import javax.swing.ImageIcon;\r
1068 -import javax.swing.JButton;\r
1069 -import javax.swing.JComponent;\r
1070 -import javax.swing.JDialog;\r
1071 -import javax.swing.JLabel;\r
1072 -import javax.swing.JOptionPane;\r
1073 -import javax.swing.JPanel;\r
1074 -import javax.swing.JScrollPane;\r
1075 -import javax.swing.JTable;\r
1076 -import javax.swing.KeyStroke;\r
1077 -import javax.swing.ListSelectionModel;\r
1078 -import javax.swing.SwingWorker;\r
1079 -import javax.swing.table.DefaultTableModel;\r
1080 -\r
1081 -import net.sf.jabref.Globals;\r
1082 -import net.sf.jabref.MetaData;\r
1083 -import net.sf.jabref.Util;\r
1084 -\r
1085 -import org.sciplore.beans.Document;\r
1086 -\r
1087 -import spl.DocumentsWrapper;\r
1088 -import spl.SplWebClient;\r
1089 -import spl.listener.LabelLinkListener;\r
1090 -import spl.localization.LocalizationSupport;\r
1091 -\r
1092 -import com.jgoodies.forms.builder.ButtonBarBuilder;\r
1093 -\r
1094 -public class MetaDataListDialog extends JDialog {\r
1095 -    private JPanel contentPane;\r
1096 -    private JTable tableMetadata;\r
1097 -    private JButton buttonOK;\r
1098 -    private JButton buttonCancel;\r
1099 -    private JScrollPane scrollPane;\r
1100 -    private JPanel panelWait;\r
1101 -    private JLabel labelFetch;\r
1102 -    private JLabel iconLabel;\r
1103 -    private JButton blankButton;\r
1104 -    private JLabel labelLogo;\r
1105 -    private JButton moreInformationButton;\r
1106 -    private JPanel panelMetadata;\r
1107 -    private DefaultTableModel tableModel;\r
1108 -    private int result;\r
1109 -    private Document xmlDocuments;\r
1110 -    private String fileName;\r
1111 -    private SplWebClient.WebServiceStatus webserviceStatus;\r
1112 -    private Component thisDialog;\r
1113 -    private boolean showBlankButton;\r
1114 -    private CardLayout cardLayou = new CardLayout();\r
1115 -\r
1116 -    public MetaDataListDialog(String fileName, boolean showBlankButton) {\r
1117 -        $$$setupUI$$$();\r
1118 -        this.showBlankButton = showBlankButton;\r
1119 -        this.thisDialog = this;\r
1120 -        this.fileName = fileName;\r
1121 -        this.labelLogo.addMouseListener(new LabelLinkListener(this.labelLogo, "www.mr-dlib.org"));\r
1122 -        this.setTitle(LocalizationSupport.message("Mr._dLib_Metadata_Entries_Associated_With_PDF_File"));\r
1123 -        this.tableMetadata.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
1124 -        setContentPane(contentPane);\r
1125 -        pack();\r
1126 -        setModal(true);\r
1127 -        getRootPane().setDefaultButton(buttonOK);\r
1128 -\r
1129 -        buttonOK.addActionListener(new ActionListener() {\r
1130 -            public void actionPerformed(ActionEvent e) {\r
1131 -                onOK();\r
1132 -            }\r
1133 -        });\r
1134 -\r
1135 -        buttonCancel.addActionListener(new ActionListener() {\r
1136 -            public void actionPerformed(ActionEvent e) {\r
1137 -                onCancel();\r
1138 -            }\r
1139 -        });\r
1140 -\r
1141 -        blankButton.addActionListener(new ActionListener() {\r
1142 -            public void actionPerformed(ActionEvent e) {\r
1143 -                onBlank();\r
1144 -            }\r
1145 -        });\r
1146 -\r
1147 -        moreInformationButton.addActionListener(new ActionListener() {\r
1148 -            public void actionPerformed(ActionEvent e) {\r
1149 -                onInfo();\r
1150 -            }\r
1151 -        });\r
1152 -\r
1153 -        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);\r
1154 -        addWindowListener(new WindowAdapter() {\r
1155 -            public void windowClosing(WindowEvent e) {\r
1156 -                onCancel();\r
1157 -            }\r
1158 -        });\r
1159 -\r
1160 -        contentPane.registerKeyboardAction(new ActionListener() {\r
1161 -            public void actionPerformed(ActionEvent e) {\r
1162 -                onCancel();\r
1163 -            }\r
1164 -        }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);\r
1165 -\r
1166 -        cardLayou.show(panelMetadata, "panelWait");\r
1167 -        //this.scrollPane.setVisible(false);\r
1168 -        //this.blankButton.setVisible(false);\r
1169 -        this.moreInformationButton.setVisible(true);\r
1170 -        this.setSize(616, 366);\r
1171 -    }\r
1172 -\r
1173 -    private void onInfo() {\r
1174 -        try {\r
1175 -            Util.openExternalViewer(new MetaData(), "http://www.mr-dlib.org/docs/jabref_metadata_extraction_alpha.php", "url");\r
1176 -        } catch (IOException exc) {\r
1177 -            exc.printStackTrace();\r
1178 -        }\r
1179 -    }\r
1180 -\r
1181 -    private void onBlank() {\r
1182 -        this.result = JOptionPane.NO_OPTION;\r
1183 -        dispose();\r
1184 -    }\r
1185 -\r
1186 -    private void onOK() {\r
1187 -        this.result = JOptionPane.OK_OPTION;\r
1188 -        dispose();\r
1189 -    }\r
1190 -\r
1191 -    private void onCancel() {\r
1192 -        this.result = JOptionPane.CANCEL_OPTION;\r
1193 -        dispose();\r
1194 -    }\r
1195 -\r
1196 -    public void showDialog() {\r
1197 -        SwingWorker worker = new SwingWorker<Void, Void>() {\r
1198 -            @Override\r
1199 -            public Void doInBackground() {\r
1200 -                System.out.println("Starting Webclient...");\r
1201 -                webserviceStatus = SplWebClient.getMetaData(new File(fileName));\r
1202 -                return null;\r
1203 -            }\r
1204 -\r
1205 -            @Override\r
1206 -            public void done() {\r
1207 -                if (webserviceStatus == SplWebClient.WebServiceStatus.OK) {\r
1208 -                    xmlDocuments = SplWebClient.metadata;\r
1209 -                    if (xmlDocuments != null /*&& xmlDocuments.getDocuments() != null && xmlDocuments.getDocuments().size() > 0*/) {\r
1210 -                        DocumentsWrapper documents = new DocumentsWrapper(xmlDocuments);\r
1211 -                        List<Vector> vectorList = documents.getDocuments();\r
1212 -                        for (Vector vector : vectorList) {\r
1213 -                            tableModel.addRow(vector);\r
1214 -                        }\r
1215 -\r
1216 -                        tableMetadata.getSelectionModel().setSelectionInterval(0, 0);\r
1217 -                        cardLayou.show(panelMetadata, "scrollPane");\r
1218 -                        //panelWait.setVisible(false);\r
1219 -                        //scrollPane.setVisible(true);\r
1220 -                        moreInformationButton.setVisible(true);\r
1221 -                    } else {\r
1222 -                        iconLabel.setVisible(false);\r
1223 -                        labelFetch.setText(LocalizationSupport.message("No_metadata_found."));\r
1224 -                        blankButton.setVisible(showBlankButton);\r
1225 -                    }\r
1226 -                }\r
1227 -                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_METADATA) {\r
1228 -                    iconLabel.setVisible(false);\r
1229 -                    labelFetch.setText(LocalizationSupport.message("No_metadata_found."));\r
1230 -                    blankButton.setVisible(showBlankButton);\r
1231 -                }\r
1232 -                if (webserviceStatus == SplWebClient.WebServiceStatus.UNAVAILABLE) {\r
1233 -                    iconLabel.setVisible(false);\r
1234 -                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_unavailable."));\r
1235 -                    blankButton.setVisible(showBlankButton);\r
1236 -                }\r
1237 -                if (webserviceStatus == SplWebClient.WebServiceStatus.OUTDATED) {\r
1238 -                    iconLabel.setVisible(false);\r
1239 -                    labelFetch.setText(LocalizationSupport.message("The_Mr._dLib_web_service_version_you_trying_to_access_is_outdated."));\r
1240 -                    blankButton.setVisible(showBlankButton);\r
1241 -                    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
1242 -                }\r
1243 -                if (webserviceStatus == SplWebClient.WebServiceStatus.WEBSERVICE_DOWN) {\r
1244 -                    iconLabel.setVisible(false);\r
1245 -                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_down._Please_try_again_later."));\r
1246 -                    blankButton.setVisible(showBlankButton);\r
1247 -                }\r
1248 -                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_INTERNET) {\r
1249 -                    iconLabel.setVisible(false);\r
1250 -                    labelFetch.setText(LocalizationSupport.message("No_Internet_Connection."));\r
1251 -                    blankButton.setVisible(showBlankButton);\r
1252 -                    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
1253 -                }\r
1254 -            }\r
1255 -        };\r
1256 -        worker.execute();\r
1257 -        this.pack();\r
1258 -        this.setVisible(true);\r
1259 -    }\r
1260 -\r
1261 -    public Document getXmlDocuments() {\r
1262 -        return xmlDocuments;\r
1263 -    }\r
1264 -\r
1265 -    private void createUIComponents() {\r
1266 -        this.tableModel = new MyTableModel();\r
1267 -        this.tableModel.addColumn(LocalizationSupport.message("Title"));\r
1268 -        this.tableModel.addColumn(LocalizationSupport.message("Author(s)"));\r
1269 -        this.tableModel.addColumn(LocalizationSupport.message("Published_Year"));\r
1270 -        this.tableMetadata = new JTable(this.tableModel);\r
1271 -    }\r
1272 -\r
1273 -    public JTable getTableMetadata() {\r
1274 -        return tableMetadata;\r
1275 -    }\r
1276 -\r
1277 -    public int getResult() {\r
1278 -        return result;\r
1279 -    }\r
1280 -\r
1281 -    public JButton getBlankButton() {\r
1282 -        return blankButton;\r
1283 -    }\r
1284 -\r
1285 -    private void $$$setupUI$$$() {\r
1286 -        createUIComponents();\r
1287 -        contentPane = new JPanel();\r
1288 -        contentPane.setLayout(new BorderLayout());\r
1289 -        labelLogo = new JLabel();\r
1290 -        labelLogo.setIcon(new ImageIcon(getClass().getResource("/spl/gui/mrdlib header.png")));\r
1291 -        labelLogo.setText("");\r
1292 -        contentPane.add(labelLogo, BorderLayout.NORTH);\r
1293 -        panelMetadata = new JPanel();\r
1294 -        panelMetadata.setLayout(cardLayou);\r
1295 -\r
1296 -\r
1297 -        panelMetadata.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null));\r
1298 -        scrollPane = new JScrollPane();\r
1299 -        scrollPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), null));\r
1300 -        tableMetadata.setAutoCreateRowSorter(false);\r
1301 -        tableMetadata.setEnabled(true);\r
1302 -        tableMetadata.setFillsViewportHeight(true);\r
1303 -        tableMetadata.setShowVerticalLines(true);\r
1304 -        scrollPane.setViewportView(tableMetadata);\r
1305 -        panelMetadata.add(scrollPane, "scrollPane");\r
1306 -        panelWait = new JPanel();\r
1307 -        panelWait.setLayout(new BorderLayout());\r
1308 -        panelWait.setBackground(new Color(-1));\r
1309 -        panelMetadata.add(panelWait, "panelWait");\r
1310 -        panelWait.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), null));\r
1311 -        iconLabel = new JLabel();\r
1312 -        iconLabel.setBackground(new Color(-1));\r
1313 -        iconLabel.setHorizontalAlignment(0);\r
1314 -        iconLabel.setHorizontalTextPosition(11);\r
1315 -        iconLabel.setIcon(new ImageIcon(getClass().getResource("/spl/gui/ajax-loader.gif")));\r
1316 -        iconLabel.setText("");\r
1317 -        panelWait.add(iconLabel, BorderLayout.CENTER);\r
1318 -        labelFetch = new JLabel();\r
1319 -        labelFetch.setHorizontalAlignment(JLabel.CENTER);\r
1320 -        labelFetch.setFont(new Font(labelFetch.getFont().getName(), labelFetch.getFont().getStyle(), 13));\r
1321 -        labelFetch.setText(Globals.lang("Fetching Metadata..."));\r
1322 -        panelWait.add(labelFetch, BorderLayout.SOUTH);\r
1323 -\r
1324 -        cardLayou.show(panelMetadata, "panelWait");\r
1325 -        panelMetadata.setPreferredSize(new Dimension(400, 200));\r
1326 -        contentPane.add(panelMetadata, BorderLayout.CENTER);\r
1327 -\r
1328 -        buttonOK = new JButton(Globals.lang("Ok"));\r
1329 -        buttonCancel = new JButton(Globals.lang("Cancel"));\r
1330 -        moreInformationButton = new JButton(Globals.lang("More information"));\r
1331 -        ButtonBarBuilder bb = new ButtonBarBuilder();\r
1332 -        bb.addGlue();\r
1333 -        bb.addButton(moreInformationButton);\r
1334 -        bb.addButton(buttonOK);\r
1335 -        bb.addButton(buttonCancel);\r
1336 -        bb.addGlue();\r
1337 -        blankButton = new JButton();\r
1338 -        blankButton.setText("");\r
1339 -        contentPane.add(bb.getPanel(), BorderLayout.SOUTH);\r
1340 -        iconLabel.setLabelFor(scrollPane);\r
1341 -\r
1342 -\r
1343 -    }\r
1344 -\r
1345 -    /**\r
1346 -     * @noinspection ALL\r
1347 -     */\r
1348 -    public JComponent $$$getRootComponent$$$() {\r
1349 -        return contentPane;\r
1350 -    }\r
1351 -\r
1352 -    public class MyTableModel extends DefaultTableModel {\r
1353 -\r
1354 -        @Override\r
1355 -        public boolean isCellEditable(int row, int column) {\r
1356 -            return false;\r
1357 -        }\r
1358 -    }\r
1359 -\r
1360 -}\r