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