OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 177 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 98... Line 98...
98
import javax.swing.JOptionPane;
98
import javax.swing.JOptionPane;
99
import javax.swing.SwingUtilities;
99
import javax.swing.SwingUtilities;
100
 
100
 
101
public class Gestion {
101
public class Gestion {
102
 
102
 
103
    public static final File MODULES_DIR = new File("Modules");
103
    static final String MODULES_DIR_NAME = "Modules";
104
 
104
 
105
    /**
105
    /**
106
     * When this system property is set to <code>true</code>, Gestion will hide most of its normal
106
     * When this system property is set to <code>true</code>, Gestion will hide most of its normal
107
     * UI. E.g. no SOCIETE selection in the login panel, minimalist menu bar, etc.
107
     * UI. E.g. no SOCIETE selection in the login panel, minimalist menu bar, etc.
108
     */
108
     */
Line 314... Line 314...
314
            System.out.println("Application preferences folder : " + conf.getBaseDirs().getPreferencesFolder().getCanonicalPath());
314
            System.out.println("Application preferences folder : " + conf.getBaseDirs().getPreferencesFolder().getCanonicalPath());
315
        } catch (IOException ex2) {
315
        } catch (IOException ex2) {
316
            ex2.printStackTrace();
316
            ex2.printStackTrace();
317
        }
317
        }
318
        System.out.println("Application working directory folder : " + conf.getWD().getAbsolutePath());
318
        System.out.println("Application working directory folder : " + conf.getWD().getAbsolutePath());
-
 
319
        System.out.println("Modules folders : " + conf.getModuleManager().getFolders().toString());
319
        if (inWebStart()) {
320
        if (inWebStart()) {
320
            // needed since our classes aren't loaded by the same loader as the library classes
321
            // needed since our classes aren't loaded by the same loader as the library classes
321
            Helper.setURLStreamHandlerFactory();
322
            Helper.setURLStreamHandlerFactory();
322
            // even if we set <all-permissions/> in the jnlp, this only applies to the main jar, not
323
            // even if we set <all-permissions/> in the jnlp, this only applies to the main jar, not
323
            // to dynamically loaded jars. So to allow OOConnexion to work we need to remove the
324
            // to dynamically loaded jars. So to allow OOConnexion to work we need to remove the
Line 337... Line 338...
337
 
338
 
338
        if (logRequests) {
339
        if (logRequests) {
339
            SQLRequestLog.setEnabled(true);
340
            SQLRequestLog.setEnabled(true);
340
        }
341
        }
341
 
342
 
-
 
343
        // columns order/visibility per company
-
 
344
        IListFrame.setConfDirFunction((elem) -> conf.getConfDir(elem.getTable().getDBRoot()));
-
 
345
 
342
        if (Boolean.valueOf(conf.getProperty("minimal", "false"))) {
346
        if (Boolean.valueOf(conf.getProperty("minimal", "false"))) {
343
            System.setProperty(MINIMAL_PROP, Boolean.TRUE.toString());
347
            System.setProperty(MINIMAL_PROP, Boolean.TRUE.toString());
344
        }
348
        }
345
        if (Boolean.valueOf(conf.getProperty("statelessTable", "false"))) {
349
        if (Boolean.valueOf(conf.getProperty("statelessTable", "false"))) {
346
            System.setProperty(IListe.STATELESS_TABLE_PROP, Boolean.TRUE.toString());
350
            System.setProperty(IListe.STATELESS_TABLE_PROP, Boolean.TRUE.toString());
Line 582... Line 586...
582
            }
586
            }
583
        });
587
        });
584
 
588
 
585
        // needed so that we can uninstall modules
589
        // needed so that we can uninstall modules
586
        System.setProperty(SQLBase.ALLOW_OBJECT_REMOVAL, "true");
590
        System.setProperty(SQLBase.ALLOW_OBJECT_REMOVAL, "true");
-
 
591
        NewsChecker.check(pTOS, conf.getConfDir(), conf.getServer().getSQLSystem().equals(SQLSystem.H2));
587
    }
592
    }
588
 
593
 
589
    private static void saveProperties(File fTOS, Properties pTOS) {
594
    private static void saveProperties(File fTOS, Properties pTOS) {
590
        try {
595
        try {
591
            final FileOutputStream outputStream = new FileOutputStream(fTOS);
596
            final FileOutputStream outputStream = new FileOutputStream(fTOS);
Line 790... Line 795...
790
            e.printStackTrace();
795
            e.printStackTrace();
791
        }
796
        }
792
        return realIp;
797
        return realIp;
793
    }
798
    }
794
 
799
 
-
 
800
    // TODO : n'est plus utilisé
795
    public static PostgreSQLFrame pgFrameStart = null;
801
    public static PostgreSQLFrame pgFrameStart = null;
796
 
802
 
797
    private static JDialog frameExit = null;
803
    private static JDialog frameExit = null;
798
 
804
 
799
    static public void askForExit() {
805
    static public void askForExit() {