OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 147 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 147 Rev 164
1
package org.openconcerto.modules.finance.accounting.exchangerates;
1
package org.openconcerto.modules.finance.accounting.exchangerates;
2
 
2
 
3
import java.awt.GraphicsEnvironment;
3
import java.awt.GraphicsEnvironment;
4
import java.io.File;
-
 
5
import java.io.IOException;
4
import java.io.IOException;
6
import java.math.BigDecimal;
5
import java.math.BigDecimal;
7
import java.sql.ResultSet;
6
import java.sql.ResultSet;
8
import java.sql.SQLException;
7
import java.sql.SQLException;
9
import java.util.ArrayList;
8
import java.util.ArrayList;
10
import java.util.Arrays;
9
import java.util.Arrays;
11
import java.util.Calendar;
10
import java.util.Calendar;
12
import java.util.Date;
11
import java.util.Date;
13
import java.util.HashSet;
12
import java.util.HashSet;
14
import java.util.List;
13
import java.util.List;
15
import java.util.Set;
14
import java.util.Set;
16
import java.util.TimeZone;
15
import java.util.TimeZone;
17
 
16
 
18
import javax.swing.JOptionPane;
17
import javax.swing.JOptionPane;
19
 
18
 
20
import org.apache.commons.dbutils.ResultSetHandler;
19
import org.apache.commons.dbutils.ResultSetHandler;
21
import org.openconcerto.erp.config.ComptaPropsConfiguration;
20
import org.openconcerto.erp.config.ComptaPropsConfiguration;
22
import org.openconcerto.erp.config.Gestion;
-
 
23
import org.openconcerto.erp.core.finance.accounting.model.CurrencyConverter;
21
import org.openconcerto.erp.core.finance.accounting.model.CurrencyConverter;
24
import org.openconcerto.erp.modules.AbstractModule;
22
import org.openconcerto.erp.modules.AbstractModule;
25
import org.openconcerto.erp.modules.DBContext;
23
import org.openconcerto.erp.modules.DBContext;
26
import org.openconcerto.erp.modules.ModuleFactory;
24
import org.openconcerto.erp.modules.ModuleFactory;
27
import org.openconcerto.erp.modules.ModuleManager;
-
 
28
import org.openconcerto.erp.modules.ModulePackager;
-
 
29
import org.openconcerto.erp.modules.ModulePreferencePanel;
25
import org.openconcerto.erp.modules.ModulePreferencePanel;
30
import org.openconcerto.erp.modules.ModulePreferencePanelDesc;
26
import org.openconcerto.erp.modules.ModulePreferencePanelDesc;
31
import org.openconcerto.erp.modules.ModuleVersion;
-
 
32
import org.openconcerto.erp.modules.RuntimeModuleFactory;
-
 
33
import org.openconcerto.sql.model.DBRoot;
27
import org.openconcerto.sql.model.DBRoot;
34
import org.openconcerto.sql.model.SQLBase;
28
import org.openconcerto.sql.model.SQLBase;
35
import org.openconcerto.sql.model.SQLRequestLog;
-
 
36
import org.openconcerto.sql.model.SQLRow;
29
import org.openconcerto.sql.model.SQLRow;
37
import org.openconcerto.sql.model.SQLRowListRSH;
30
import org.openconcerto.sql.model.SQLRowListRSH;
38
import org.openconcerto.sql.model.SQLSelect;
31
import org.openconcerto.sql.model.SQLSelect;
39
import org.openconcerto.sql.model.SQLTable;
32
import org.openconcerto.sql.model.SQLTable;
40
import org.openconcerto.sql.model.Where;
33
import org.openconcerto.sql.model.Where;
41
import org.openconcerto.sql.ui.ConnexionPanel;
-
 
42
import org.openconcerto.sql.utils.SQLUtils;
34
import org.openconcerto.sql.utils.SQLUtils;
43
import org.openconcerto.utils.PrefType;
35
import org.openconcerto.utils.PrefType;
44
 
36
 
45
public final class Module extends AbstractModule {
37
public final class Module extends AbstractModule {
46
 
38
 
47
    public static final String TABLE_EXPENSE = "EXPENSE";
39
    public static final String TABLE_EXPENSE = "EXPENSE";
48
    public static final String TABLE_EXPENSE_STATE = "EXPENSE_STATE";
40
    public static final String TABLE_EXPENSE_STATE = "EXPENSE_STATE";
49
    public static final String EXPENSE_RATE_NOT_DOWNLOAD_PREF = "EXPENSE_RATE_NOT_DOWNLOAD_PREF";
41
    public static final String EXPENSE_RATE_NOT_DOWNLOAD_PREF = "EXPENSE_RATE_NOT_DOWNLOAD_PREF";
50
    public static ModuleVersion MODULE_VERSION = new ModuleVersion(1, 0);
-
 
51
    private CurrencyConverter commercialConverter = null;
42
    private CurrencyConverter commercialConverter = null;
52
 
43
 
53
    public Module(ModuleFactory f) throws IOException {
44
    public Module(ModuleFactory f) throws IOException {
54
        super(f);
45
        super(f);
55
    }
46
    }
56
 
47
 
57
    @Override
48
    @Override
58
    protected void install(DBContext ctxt) {
49
    protected void install(DBContext ctxt) {
59
 
50
 
60
    }
51
    }
61
 
52
 
62
    public void setCommercialConverter(CurrencyConverter commercialConverter) {
53
    public void setCommercialConverter(CurrencyConverter commercialConverter) {
63
        this.commercialConverter = commercialConverter;
54
        this.commercialConverter = commercialConverter;
64
    }
55
    }
65
 
56
 
66
    @Override
57
    @Override
67
    protected void start() {
58
    protected void start() {
68
        final DBRoot root = ComptaPropsConfiguration.getInstanceCompta().getRootSociete();
59
        final DBRoot root = ComptaPropsConfiguration.getInstanceCompta().getRootSociete();
69
        Boolean b = ModuleManager.getInstance().getFactories().get("org.openconcerto.modules.finance.accounting.exchangerates").get(Module.MODULE_VERSION).getSQLPreferences(root)
-
 
70
                .getBoolean(EXPENSE_RATE_NOT_DOWNLOAD_PREF, false);
60
        Boolean b = getFactory().getSQLPreferences(root).getBoolean(EXPENSE_RATE_NOT_DOWNLOAD_PREF, false);
71
        if (!b) {
61
        if (!b) {
72
            final Thread t = new Thread() {
62
            final Thread t = new Thread() {
73
                public void run() {
63
                public void run() {
74
                    // Wait 1s to prevent too many internet access at startup
64
                    // Wait 1s to prevent too many internet access at startup
75
                    try {
65
                    try {
76
                        Thread.sleep(1000);
66
                        Thread.sleep(1000);
77
                    } catch (InterruptedException e1) {
67
                    } catch (InterruptedException e1) {
78
                        e1.printStackTrace();
68
                        e1.printStackTrace();
79
                    }
69
                    }
80
                    updateRates(root, ComptaPropsConfiguration.getInstanceCompta().getRowSociete().getForeign("ID_DEVISE").getString("CODE"));
70
                    updateRates(root, ComptaPropsConfiguration.getInstanceCompta().getRowSociete().getForeign("ID_DEVISE").getString("CODE"));
81
                };
71
                };
82
            };
72
            };
83
            t.setPriority(Thread.MIN_PRIORITY);
73
            t.setPriority(Thread.MIN_PRIORITY);
84
            t.setDaemon(true);
74
            t.setDaemon(true);
85
            t.start();
75
            t.start();
86
        }
76
        }
87
 
77
 
88
    }
78
    }
89
 
79
 
90
    public void updateRates(DBRoot root, String companyCurrencyCode) {
80
    public void updateRates(DBRoot root, String companyCurrencyCode) {
91
        // Check if update need to be done
81
        // Check if update need to be done
92
        final Calendar c = Calendar.getInstance();
82
        final Calendar c = Calendar.getInstance();
93
        c.set(Calendar.HOUR_OF_DAY, 0);
83
        c.set(Calendar.HOUR_OF_DAY, 0);
94
        c.set(Calendar.MINUTE, 0);
84
        c.set(Calendar.MINUTE, 0);
95
        c.set(Calendar.SECOND, 0);
85
        c.set(Calendar.SECOND, 0);
96
        c.set(Calendar.MILLISECOND, 0);
86
        c.set(Calendar.MILLISECOND, 0);
97
 
87
 
98
        if (c.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
88
        if (c.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
99
            c.set(Calendar.HOUR, -72);
89
            c.set(Calendar.HOUR, -72);
100
        } else {
90
        } else {
101
            c.add(Calendar.HOUR, -24);
91
            c.add(Calendar.HOUR, -24);
102
        }
92
        }
103
        final Date yesterday = c.getTime();
93
        final Date yesterday = c.getTime();
104
 
94
 
105
        final CurrencyConverter converter = new CurrencyConverter(root, companyCurrencyCode, "EUR");
95
        final CurrencyConverter converter = new CurrencyConverter(root, companyCurrencyCode, "EUR");
106
        final SQLSelect select = new SQLSelect();
96
        final SQLSelect select = new SQLSelect();
107
        final SQLTable t = root.getTable("DEVISE_HISTORIQUE");
97
        final SQLTable t = root.getTable("DEVISE_HISTORIQUE");
108
        select.addAllSelect(t, Arrays.asList("DATE", "SRC", "ID"));
98
        select.addAllSelect(t, Arrays.asList("DATE", "SRC", "ID"));
109
        Where w = new Where(t.getField("SRC"), "=", "EUR");
99
        Where w = new Where(t.getField("SRC"), "=", "EUR");
110
        w = w.and(new Where(t.getField("DATE"), "=", yesterday));
100
        w = w.and(new Where(t.getField("DATE"), "=", yesterday));
111
        select.setWhere(w);
101
        select.setWhere(w);
112
        select.setLimit(1);
102
        select.setLimit(1);
113
        final List<SQLRow> rows = SQLRowListRSH.execute(select);
103
        final List<SQLRow> rows = SQLRowListRSH.execute(select);
114
        if (!rows.isEmpty()) {
104
        if (!rows.isEmpty()) {
115
            // Nothing to update
105
            // Nothing to update
116
            System.out.println("No exchange rates to download");
106
            System.out.println("No exchange rates to download");
117
            return;
107
            return;
118
        }
108
        }
119
        // Get conversion info
109
        // Get conversion info
120
        final ExchangeRatesDownloader d = new ExchangeRatesDownloader();
110
        final ExchangeRatesDownloader d = new ExchangeRatesDownloader();
121
        try {
111
        try {
122
            d.downloadAndParse();
112
            d.downloadAndParse();
123
            Set<Date> dates = getMissingDates(converter, root);
113
            Set<Date> dates = getMissingDates(converter, root);
124
            System.out.println("Missing date:" + dates);
114
            System.out.println("Missing date:" + dates);
125
            List<Report> reports = d.getReports();
115
            List<Report> reports = d.getReports();
126
 
116
 
127
            for (Report report : reports) {
117
            for (Report report : reports) {
128
                if (dates.contains(report.getDate())) {
118
                if (dates.contains(report.getDate())) {
129
                    importReport(d, report, converter, root);
119
                    importReport(d, report, converter, root);
130
                }
120
                }
131
            }
121
            }
132
        } catch (Exception e) {
122
        } catch (Exception e) {
133
            e.printStackTrace();
123
            e.printStackTrace();
134
            if (!GraphicsEnvironment.isHeadless()) {
124
            if (!GraphicsEnvironment.isHeadless()) {
135
                JOptionPane.showMessageDialog(null, "Impossible de mettre à jour les taux de change");
125
                JOptionPane.showMessageDialog(null, "Impossible de mettre à jour les taux de change");
136
            }
126
            }
137
        }
127
        }
138
    }
128
    }
139
 
129
 
140
    @Override
130
    @Override
141
    public List<ModulePreferencePanelDesc> getPrefDescriptors() {
131
    public List<ModulePreferencePanelDesc> getPrefDescriptors(final DBRoot root) {
142
        return Arrays.<ModulePreferencePanelDesc> asList(new ModulePreferencePanelDesc("Gestion des devises") {
132
        return Arrays.<ModulePreferencePanelDesc> asList(new ModulePreferencePanelDesc("Gestion des devises") {
143
            @Override
133
            @Override
144
            protected ModulePreferencePanel createPanel() {
134
            protected ModulePreferencePanel createPanel() {
145
                return new ModulePreferencePanel("Gestion des devises") {
135
                return new ModulePreferencePanel(root, "Gestion des devises") {
146
                    @Override
136
                    @Override
147
                    protected void addViews() {
137
                    protected void addViews() {
148
 
-
 
149
                        final SQLPrefView<Boolean> view = new SQLPrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Ne pas télécharger les nouveaux taux au lancement du logiciel",
138
                        final SQLPrefView<Boolean> view = new SQLPrefView<Boolean>(PrefType.BOOLEAN_TYPE, "Ne pas télécharger les nouveaux taux au lancement du logiciel",
150
                                EXPENSE_RATE_NOT_DOWNLOAD_PREF);
139
                                EXPENSE_RATE_NOT_DOWNLOAD_PREF);
151
                        this.addView(view);
140
                        this.addView(view);
152
                    }
141
                    }
153
                };
142
                };
154
            }
143
            }
155
        }.setLocal(false).setKeywords("devise"));
144
        }.setLocal(false).setKeywords("devise"));
156
    }
145
    }
157
 
146
 
158
    protected void importReport(ExchangeRatesDownloader d, Report report, CurrencyConverter converter, DBRoot root) {
147
    protected void importReport(ExchangeRatesDownloader d, Report report, CurrencyConverter converter, DBRoot root) {
159
 
148
 
160
        System.out.println("Module.importReport() " + report.getDate());
149
        System.out.println("Module.importReport() " + report.getDate());
161
 
150
 
162
        SQLTable tDeviseHisto = root.getTable("DEVISE_HISTORIQUE");
151
        SQLTable tDeviseHisto = root.getTable("DEVISE_HISTORIQUE");
163
 
152
 
164
        final List<String> queries = new ArrayList<String>();
153
        final List<String> queries = new ArrayList<String>();
165
        final List<ResultSetHandler> handlers = new ArrayList<ResultSetHandler>();
154
        final List<ResultSetHandler> handlers = new ArrayList<ResultSetHandler>();
166
        final ResultSetHandler handler = new ResultSetHandler() {
155
        final ResultSetHandler handler = new ResultSetHandler() {
167
 
156
 
168
            @Override
157
            @Override
169
            public Object handle(ResultSet rs) throws SQLException {
158
            public Object handle(ResultSet rs) throws SQLException {
170
                if (rs.next()) {
159
                if (rs.next()) {
171
                    return rs.getObject(1);
160
                    return rs.getObject(1);
172
                }
161
                }
173
                return null;
162
                return null;
174
            }
163
            }
175
        };
164
        };
176
        Date date = Calendar.getInstance().getTime();
165
        Date date = Calendar.getInstance().getTime();
177
        final int size = ExchangeRatesDownloader.supportedCurrencyCodes.size();
166
        final int size = ExchangeRatesDownloader.supportedCurrencyCodes.size();
178
        for (int i = 0; i < size; i++) {
167
        for (int i = 0; i < size; i++) {
179
            String code = ExchangeRatesDownloader.supportedCurrencyCodes.get(i);
168
            String code = ExchangeRatesDownloader.supportedCurrencyCodes.get(i);
180
            BigDecimal tauxCommercial;
169
            BigDecimal tauxCommercial;
181
            if (this.commercialConverter != null) {
170
            if (this.commercialConverter != null) {
182
                tauxCommercial = commercialConverter.convert(BigDecimal.ONE, report.getMainCurrencyCode(), code, date, true);
171
                tauxCommercial = commercialConverter.convert(BigDecimal.ONE, report.getMainCurrencyCode(), code, date, true);
183
            } else {
172
            } else {
184
                try {
173
                try {
185
                    tauxCommercial = converter.convert(BigDecimal.ONE, report.getMainCurrencyCode(), code, date, true);
174
                    tauxCommercial = converter.convert(BigDecimal.ONE, report.getMainCurrencyCode(), code, date, true);
186
                } catch (IllegalStateException e) {
175
                } catch (IllegalStateException e) {
187
                    // Aucun taux n'existe encore dans la base.
176
                    // Aucun taux n'existe encore dans la base.
188
                    tauxCommercial = null;
177
                    tauxCommercial = null;
189
                }
178
                }
190
            }
179
            }
191
            if (tauxCommercial == null) {
180
            if (tauxCommercial == null) {
192
                tauxCommercial = BigDecimal.ONE;
181
                tauxCommercial = BigDecimal.ONE;
193
            }
182
            }
194
            tauxCommercial = tauxCommercial.setScale(4, BigDecimal.ROUND_HALF_UP);
183
            tauxCommercial = tauxCommercial.setScale(4, BigDecimal.ROUND_HALF_UP);
195
            String query = "INSERT INTO " + tDeviseHisto.getSQLName().quote();
184
            String query = "INSERT INTO " + tDeviseHisto.getSQLName().quote();
196
            final BigDecimal rate = report.getRate(code);
185
            final BigDecimal rate = report.getRate(code);
197
            if (rate == null) {
186
            if (rate == null) {
198
                System.err.println("RATE " + code + " NOT Supported");
187
                System.err.println("RATE " + code + " NOT Supported");
199
                // Thread.dumpStack();
188
                // Thread.dumpStack();
200
            } else {
189
            } else {
201
                final BigDecimal taux = rate.setScale(4, BigDecimal.ROUND_HALF_UP);
190
                final BigDecimal taux = rate.setScale(4, BigDecimal.ROUND_HALF_UP);
202
 
191
 
203
                final java.sql.Date date2 = new java.sql.Date(report.getDate().getTime());
192
                final java.sql.Date date2 = new java.sql.Date(report.getDate().getTime());
204
                query += " (\"DATE\", \"SRC\", \"DST\", \"TAUX\", \"TAUX_COMMERCIAL\", \"ORDRE\") select " + SQLBase.quoteStringStd(date2.toString()) + ", "
193
                query += " (\"DATE\", \"SRC\", \"DST\", \"TAUX\", \"TAUX_COMMERCIAL\", \"ORDRE\") select " + SQLBase.quoteStringStd(date2.toString()) + ", "
205
                        + SQLBase.quoteStringStd(report.getMainCurrencyCode()) + ", " + SQLBase.quoteStringStd(code) + ", " + taux + ", " + tauxCommercial + ", COALESCE(MAX(\"ORDRE\"), 0) + 1 ";
194
                        + SQLBase.quoteStringStd(report.getMainCurrencyCode()) + ", " + SQLBase.quoteStringStd(code) + ", " + taux + ", " + tauxCommercial + ", COALESCE(MAX(\"ORDRE\"), 0) + 1 ";
206
                query += "FROM " + tDeviseHisto.getSQLName().quote() + " RETURNING \"ID\"";
195
                query += "FROM " + tDeviseHisto.getSQLName().quote() + " RETURNING \"ID\"";
207
 
196
 
208
                queries.add(query);
197
                queries.add(query);
209
                handlers.add(handler);
198
                handlers.add(handler);
210
            }
199
            }
211
        }
200
        }
212
 
201
 
213
        try {
202
        try {
214
            SQLUtils.executeMultiple(tDeviseHisto.getDBSystemRoot(), queries, handlers);
203
            SQLUtils.executeMultiple(tDeviseHisto.getDBSystemRoot(), queries, handlers);
215
 
204
 
216
        } catch (Exception e) {
205
        } catch (Exception e) {
217
            e.printStackTrace();
206
            e.printStackTrace();
218
        }
207
        }
219
 
208
 
220
    }
209
    }
221
 
210
 
222
    protected Set<Date> getMissingDates(CurrencyConverter converter, DBRoot root) {
211
    protected Set<Date> getMissingDates(CurrencyConverter converter, DBRoot root) {
223
        final SQLSelect select = new SQLSelect();
212
        final SQLSelect select = new SQLSelect();
224
 
213
 
225
        final SQLTable t = root.getTable("DEVISE_HISTORIQUE");
214
        final SQLTable t = root.getTable("DEVISE_HISTORIQUE");
226
        select.addAllSelect(t, Arrays.asList("DATE"));
215
        select.addAllSelect(t, Arrays.asList("DATE"));
227
        Where w = new Where(t.getField("SRC"), "=", converter.getCompanyCurrencyCode());
216
        Where w = new Where(t.getField("SRC"), "=", converter.getCompanyCurrencyCode());
228
        w = w.and(new Where(t.getField("DATE"), "<", new Date(System.currentTimeMillis())));
217
        w = w.and(new Where(t.getField("DATE"), "<", new Date(System.currentTimeMillis())));
229
        select.setWhere(w);
218
        select.setWhere(w);
230
        select.addGroupBy(t.getField("DATE"));
219
        select.addGroupBy(t.getField("DATE"));
231
        select.setLimit(30);
220
        select.setLimit(30);
232
        final List<Date> dates = t.getDBSystemRoot().getDataSource().executeCol(select.asString());
221
        final List<Date> dates = t.getDBSystemRoot().getDataSource().executeCol(select.asString());
233
 
222
 
234
        final Set<Date> result = new HashSet<Date>();
223
        final Set<Date> result = new HashSet<Date>();
235
        Calendar c = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
224
        Calendar c = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
236
        c.set(Calendar.HOUR_OF_DAY, 0);
225
        c.set(Calendar.HOUR_OF_DAY, 0);
237
        c.set(Calendar.MINUTE, 0);
226
        c.set(Calendar.MINUTE, 0);
238
        c.set(Calendar.SECOND, 0);
227
        c.set(Calendar.SECOND, 0);
239
        c.set(Calendar.MILLISECOND, 0);
228
        c.set(Calendar.MILLISECOND, 0);
240
        for (int i = 0; i < 20; i++) {
229
        for (int i = 0; i < 20; i++) {
241
            c.add(Calendar.HOUR_OF_DAY, -24);
230
            c.add(Calendar.HOUR_OF_DAY, -24);
242
            final Date time = c.getTime();
231
            final Date time = c.getTime();
243
            System.out.println("::" + time);
232
            System.out.println("::" + time);
244
            result.add(time);
233
            result.add(time);
245
        }
234
        }
246
 
235
 
247
        for (Date date : dates) {
236
        for (Date date : dates) {
248
            Calendar c2 = Calendar.getInstance();
237
            Calendar c2 = Calendar.getInstance();
249
            c2.setTime(date);
238
            c2.setTime(date);
250
            c = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
239
            c = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
251
            c.set(Calendar.YEAR, c2.get(Calendar.YEAR));
240
            c.set(Calendar.YEAR, c2.get(Calendar.YEAR));
252
            c.set(Calendar.DAY_OF_YEAR, c2.get(Calendar.DAY_OF_YEAR));
241
            c.set(Calendar.DAY_OF_YEAR, c2.get(Calendar.DAY_OF_YEAR));
253
            c.set(Calendar.HOUR_OF_DAY, 0);
242
            c.set(Calendar.HOUR_OF_DAY, 0);
254
            c.set(Calendar.MINUTE, 0);
243
            c.set(Calendar.MINUTE, 0);
255
            c.set(Calendar.SECOND, 0);
244
            c.set(Calendar.SECOND, 0);
256
            c.set(Calendar.MILLISECOND, 0);
245
            c.set(Calendar.MILLISECOND, 0);
257
            Date dd = c.getTime();
246
            Date dd = c.getTime();
258
            result.remove(dd);
247
            result.remove(dd);
259
            System.out.println("--" + dd);
248
            System.out.println("--" + dd);
260
        }
249
        }
261
        System.out.println(result.size());
250
        System.out.println(result.size());
262
 
251
 
263
        return result;
252
        return result;
264
    }
253
    }
265
 
254
 
266
    @Override
255
    @Override
267
    protected void stop() {
256
    protected void stop() {
268
    }
257
    }
269
 
-
 
270
    public static void main(String[] args) throws IOException {
-
 
271
        System.setProperty(ConnexionPanel.QUICK_LOGIN, "true");
-
 
272
        final File propsFile = new File("module.properties");
-
 
273
        System.out.println(propsFile.getAbsolutePath());
-
 
274
        final ModuleFactory factory = new RuntimeModuleFactory(propsFile);
-
 
275
        SQLRequestLog.setEnabled(true);
-
 
276
        SQLRequestLog.showFrame();
-
 
277
        // uncomment to create and use the jar
-
 
278
        final ModulePackager modulePackager = new ModulePackager(propsFile, new File("bin/"));
-
 
279
        modulePackager.writeToDir(new File("../OpenConcerto/Modules"));
-
 
280
        // final ModuleFactory factory = new JarModuleFactory(jar);
-
 
281
        ModuleManager.getInstance().addFactories(new File("../OpenConcerto/Modules"));
-
 
282
        ModuleManager.getInstance().addFactoryAndStart(factory, false);
-
 
283
        Gestion.main(args);
-
 
284
    }
-
 
285
 
258
 
286
}
259
}