SchemaExpMain.java| Commit | Message |
|---|---|
9ebb88522 | 2016-07-18 Initial commit |
The tool accepts options followed by a single file argument. Supported flags:
| Flag | Effect |
|---|---|
-exp | Export operation → SchemaExpService.doExport() |
-imp | Import operation → SchemaExpService.doImport() |
-cleardb | Drop all tables before import (or standalone clear) |
-insertnew | RestoreMode.InsertNew — skip existing records |
-overwrite | RestoreMode.OverWrite — update existing records |
-insertall | RestoreMode.InsertAll — insert everything (default) |
The option parser (parseOption(), lines 40-65) uses StringUtils.equalsIgnoreCase() for case-insensitive matching. Positional options — flags must come before the file argument. The while (parseOption(args, pos++)) loop (line 78) iterates until it hits a non-option, then --pos backs up to point at the first non-option argument (the filename).
initApplicatinContext (line 122) — missing 'o' in "Application". The typo exists in both the method name and its call site (line 73).catch (IllegalArgumentException) block on line 82 never executes — parseOption() never throws this exception.restoreMode == null but restoreMode is initialized to RestoreMode.InsertAll (line 36) and never set to null. This check can never trigger.@ComponentScan({"org.projectforge", ...}) (in SchemaExpContext) brings in thousands of beans — much more than needed. Context startup can be slow.
Unlike the main ProjectForge application which uses Spring Boot (
SpringApplication.run(ProjectForgeApplication.class, args)), this tool manually bootstraps a plain Spring context:Three manual bootstrapping steps replace what Spring Boot does automatically: context creation, tenant registry registration, and Hibernate dialect setup. This gives the tool a minimal footprint — no embedded Tomcat, no Spring Security, no Quartz scheduler.