#4315: SchemaExpContext.java

tools/org.projectforge.tools.schemaexp/src/main/java/org/projectforge/tools/schemaexp/SchemaExpContext.java

Path: tools/org.projectforge.tools.schemaexp/src/main/java/org/projectforge/tools/schemaexp/SchemaExpContext.java

Type: Spring @Configuration · Lines: 11

Purpose: Minimal Spring configuration for the standalone SchemaExp tool — equivalent to @SpringBootApplication but without Boot's auto-configuration. The single annotation that bootstraps the entire Spring container for the tool.

Source: GitHub

11 lines · 8 code · 0 comments · 3 blank
CommitMessage
9ebb885222016-07-18 Initial commit

The 11 lines that control everything

@Configuration
@ComponentScan({ "org.projectforge", "de.micromata.mgc.jpa.spring" })
public class SchemaExpContext { }

Despite being only 11 lines, this is arguably the most critical file in the SchemaExp tool. Its @ComponentScan determines which Spring beans are discovered and available:

PackageWhat it brings
org.projectforgeALL ProjectForge components — SchemaExpService (#4104), XmlDump, ConfigurationDao, PfEmgrFactory, all DAOs, all DOs, all Wicket pages, all REST controllers. Thousands of beans.
de.micromata.mgc.jpa.springGenome JPA framework — JpaXmlDumpService, JpaSchemaService, transaction management, EntityManagerFactory config. The critical dependency for XML dump/restore.

Scope concern: The "org.projectforge" scan is excessively broad — it discovers all Wicket pages, REST controllers, Quartz schedulers, email services, and security filters. Most are never used by the SchemaExp tool but are instantiated anyway. This explains why the tool requires a database connection even for export operations (DAOs need a DB for initialization). A narrower scan would reduce startup time and dependencies.