OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 110 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
110 ilm 1
package org.openconcerto.modules.reports.olap;
2
 
3
import java.io.File;
4
import java.io.IOException;
5
 
6
import javax.swing.JFrame;
7
import javax.swing.JOptionPane;
8
 
9
import org.openconcerto.erp.config.ComptaPropsConfiguration;
10
import org.openconcerto.erp.config.Gestion;
11
import org.openconcerto.erp.config.MainFrame;
12
import org.openconcerto.erp.modules.AbstractModule;
13
import org.openconcerto.erp.modules.ComponentsContext;
14
import org.openconcerto.erp.modules.DBContext;
15
import org.openconcerto.erp.modules.ModuleFactory;
16
import org.openconcerto.erp.modules.ModuleManager;
17
import org.openconcerto.erp.modules.ModulePackager;
18
import org.openconcerto.sql.element.SQLElementDirectory;
19
import org.openconcerto.sql.model.SQLRequestLog;
20
import org.openconcerto.sql.model.SQLSystem;
21
import org.openconcerto.sql.ui.ConnexionPanel;
22
import org.openconcerto.utils.FileUtils;
23
 
24
public final class Module extends AbstractModule {
25
 
26
    public Module(ModuleFactory f) throws IOException {
27
        super(f);
28
 
29
    }
30
 
31
    @Override
32
    protected void install(DBContext ctxt) {
33
 
34
    }
35
 
36
    @Override
37
    protected void setupElements(SQLElementDirectory dir) {
38
 
39
    }
40
 
41
    @Override
42
    protected void setupComponents(ComponentsContext ctxt) {
43
 
44
        // ctxt.addMenuItem(new SQLElementListAction(ctxt.getElement(TABLE_NAME)) {
45
        //
46
        // @Override
47
        // protected void initFrame(IListFrame f) {
48
        // super.initFrame(f);
49
        // f.getPanel().setAddVisible(false);
50
        // }
51
        //
52
        // }, MainFrame.LIST_MENU);
53
        // ctxt.addListAction("CLIENT", new CallActionFactory());
54
 
55
    }
56
 
57
    @Override
58
    protected void start() {
59
        try {
60
 
61
            Class.forName("mondrian.olap4j.MondrianOlap4jDriver");
62
            System.setProperty("mondrian.rolap.star.disableCaching", "true");
63
            System.setProperty("mondrian.expCache.enable", "false");
64
            System.setProperty("mondrian.rolap.RolapResult.flushAfterEachQuery", "true");
65
            System.setProperty("mondrian.rolap.EnableRolapCubeMemberCache", "false");
66
            System.setProperty("mondrian.rolap.generate.formatted.sql", "true");
67
            if (ComptaPropsConfiguration.getInstance().getRoot().getServer().getSQLSystem() != SQLSystem.POSTGRESQL) {
68
                JOptionPane.showMessageDialog(new JFrame(), "The Business Intelligence module requires a PostgreSQL database");
69
            } else {
70
                MainFrame.getInstance().getTabbedPane().addTab("Business Intelligence", new OLAPPanel());
71
            }
72
        } catch (Exception e) {
73
            e.printStackTrace();
74
        }
75
    }
76
 
77
    @Override
78
    protected void stop() {
79
    }
80
 
81
}