OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 180 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 180 Rev 182
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
Line 44... Line 44...
44
import java.util.ArrayList;
44
import java.util.ArrayList;
45
import java.util.LinkedHashMap;
45
import java.util.LinkedHashMap;
46
import java.util.List;
46
import java.util.List;
47
import java.util.Map;
47
import java.util.Map;
48
import java.util.Map.Entry;
48
import java.util.Map.Entry;
-
 
49
import java.util.concurrent.ExecutionException;
49
import java.util.concurrent.Future;
50
import java.util.concurrent.Future;
50
 
51
 
51
import javax.swing.AbstractAction;
52
import javax.swing.AbstractAction;
52
import javax.swing.AbstractListModel;
53
import javax.swing.AbstractListModel;
53
import javax.swing.JButton;
54
import javax.swing.JButton;
Line 323... Line 324...
323
                        ExceptionHandler.handle(BaseGenerationRapport.this, "Impossible de sauver le rapport", exn);
324
                        ExceptionHandler.handle(BaseGenerationRapport.this, "Impossible de sauver le rapport", exn);
324
                    }
325
                    }
325
                }
326
                }
326
            }
327
            }
327
        } catch (final Throwable e) {
328
        } catch (final Throwable e) {
-
 
329
            // generate() always use a Future
328
            ExceptionHandler.handle(BaseGenerationRapport.this, "Impossible de générer le rapport", e);
330
            this.handleReportException(e instanceof ExecutionException ? e.getCause() : e);
329
        }
331
        }
330
    }
332
    }
331
 
333
 
332
    private Map<String, ODSingleXMLDocument> generate(final org.openconcerto.openoffice.generation.ReportGeneration<?> rg) throws Throwable {
334
    private Map<String, ODSingleXMLDocument> generate(final org.openconcerto.openoffice.generation.ReportGeneration<?> rg) throws Throwable {
333
        clearTasks();
335
        clearTasks();
Line 395... Line 397...
395
 
397
 
396
    abstract protected ReportTypes getTypes() throws JDOMException, IOException;
398
    abstract protected ReportTypes getTypes() throws JDOMException, IOException;
397
 
399
 
398
    abstract protected R createGeneration(final ReportType type);
400
    abstract protected R createGeneration(final ReportType type);
399
 
401
 
-
 
402
    protected void handleReportException(Throwable t) {
-
 
403
        ExceptionHandler.handle(this, "Impossible de générer le rapport", t);
-
 
404
    }
-
 
405
 
400
    abstract protected File getFile(final R rg, String docID);
406
    abstract protected File getFile(final R rg, String docID);
401
 
407
 
402
    protected String getEmailRecipient(final R rg) {
408
    protected String getEmailRecipient(final R rg) {
403
        return null;
409
        return null;
404
    }
410
    }