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