OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 177
Line 18... Line 18...
18
import org.openconcerto.erp.config.MenuAndActions;
18
import org.openconcerto.erp.config.MenuAndActions;
19
import org.openconcerto.erp.config.MenuManager;
19
import org.openconcerto.erp.config.MenuManager;
20
import org.openconcerto.erp.modules.DepSolverResult.Factory;
20
import org.openconcerto.erp.modules.DepSolverResult.Factory;
21
import org.openconcerto.erp.modules.ModuleTableModel.ModuleRow;
21
import org.openconcerto.erp.modules.ModuleTableModel.ModuleRow;
22
import org.openconcerto.sql.Configuration;
22
import org.openconcerto.sql.Configuration;
23
import org.openconcerto.sql.TM;
-
 
24
import org.openconcerto.sql.element.SQLElement;
23
import org.openconcerto.sql.element.SQLElement;
25
import org.openconcerto.sql.element.SQLElementDirectory;
24
import org.openconcerto.sql.element.SQLElementDirectory;
26
import org.openconcerto.sql.element.SQLElementNamesFromXML;
25
import org.openconcerto.sql.element.SQLElementNamesFromXML;
27
import org.openconcerto.sql.model.AliasedTable;
26
import org.openconcerto.sql.model.AliasedTable;
28
import org.openconcerto.sql.model.ConnectionHandlerNoSetup;
27
import org.openconcerto.sql.model.ConnectionHandlerNoSetup;
Line 1289... Line 1288...
1289
        final String id = module.getFactory().getID();
1288
        final String id = module.getFactory().getID();
1290
        if (!this.modulesComponents.containsKey(id)) {
1289
        if (!this.modulesComponents.containsKey(id)) {
1291
            final SQLElementDirectory dir = getDirectory();
1290
            final SQLElementDirectory dir = getDirectory();
1292
            final ComponentsContext ctxt = new ComponentsContext(dir, getRoot(), alreadyCreatedItems.get0(), alreadyCreatedItems.get1());
1291
            final ComponentsContext ctxt = new ComponentsContext(dir, getRoot(), alreadyCreatedItems.get0(), alreadyCreatedItems.get1());
1293
            module.setupComponents(ctxt);
1292
            module.setupComponents(ctxt);
1294
            TranslationManager.getInstance().addTranslationStreamFromClass(module.getClass());
1293
            TranslationManager.addTranslationStreamFromClass(module.getClass());
1295
            this.setupMenu(module, ma);
1294
            this.setupMenu(module, ma);
1296
            this.modulesComponents.put(id, ctxt);
1295
            this.modulesComponents.put(id, ctxt);
1297
        }
1296
        }
1298
    }
1297
    }
1299
 
1298
 
Line 1830... Line 1829...
1830
            }
1829
            }
1831
        });
1830
        });
1832
    }
1831
    }
1833
 
1832
 
1834
    private final Set<SQLTable> loadTranslations(final SQLFieldTranslator trns, final AbstractModule module, final String mdVariant) throws IOException {
1833
    private final Set<SQLTable> loadTranslations(final SQLFieldTranslator trns, final AbstractModule module, final String mdVariant) throws IOException {
1835
        final Locale locale = TM.getInstance().getTranslationsLocale();
1834
        final Locale locale = getConf().getLocale();
1836
        final Control cntrl = TranslationManager.getControl();
1835
        final Control cntrl = TranslationManager.getControl();
1837
        final String baseName = "labels";
1836
        final String baseName = "labels";
1838
 
1837
 
1839
        final Set<SQLTable> res = new HashSet<SQLTable>();
1838
        final Set<SQLTable> res = new HashSet<SQLTable>();
1840
        boolean found = false;
1839
        boolean found = false;
Line 2068... Line 2067...
2068
            for (final Entry<SQLElement, ? extends Collection<String>> e : ctxt.getFields().entrySet())
2067
            for (final Entry<SQLElement, ? extends Collection<String>> e : ctxt.getFields().entrySet())
2069
                for (final String fieldName : e.getValue())
2068
                for (final String fieldName : e.getValue())
2070
                    e.getKey().removeAdditionalField(fieldName);
2069
                    e.getKey().removeAdditionalField(fieldName);
2071
            for (final Entry<SQLElement, ? extends Collection<IListeAction>> e : ctxt.getRowActions().entrySet())
2070
            for (final Entry<SQLElement, ? extends Collection<IListeAction>> e : ctxt.getRowActions().entrySet())
2072
                e.getKey().getRowActions().removeAll(e.getValue());
2071
                e.getKey().getRowActions().removeAll(e.getValue());
2073
            TranslationManager.getInstance().removeTranslationStreamFromClass(module.getClass());
2072
            TranslationManager.removeTranslationStreamFromClass(module.getClass());
2074
            // can't undo so menu is reset in stopModule()
2073
            // can't undo so menu is reset in stopModule()
2075
        }
2074
        }
2076
    }
2075
    }
2077
 
2076
 
2078
    private final List<ModuleReference> getDBDependentModules(final ModuleReference ref) throws Exception {
2077
    private final List<ModuleReference> getDBDependentModules(final ModuleReference ref) throws Exception {