- Schema Validation (XSD): - Added new configuration UI for DynamicForm Tools to manage XSD schemas. - Implemented DynFormXsdScanner to automatically map local .xsd files to the ExternalResourceManager using a custom URI prefix. - Ensured XSD registration is properly scoped at the Project-level (rather than Application-level) using write-actions to comply with IDE threading policies. - Architecture & Refactoring: - Renamed base package from com.sdk.dynformTools to com.sdk.dynform across the entire project for structural consistency. - Converted Application-level settings/configurables to Project-level services. - Extracted and restored complex I18n folding and inlay hint logic that was previously overwritten, adapting it to use the new Project-level settings. - UI & Metadata: - Bumped plugin version to 3.2.0. - Rebranded settings page to "DynamicForm Tools". - Organized settings into logical "Internationalization" and "Schema Validation" groups.
DynamicFormTools
Project Overview
The DynamicFormTools is an IntelliJ Platform Plugin designed to automate the generation of Java ActionBean and Data Transfer Object (DTO) classes from a database schema. This plugin integrates directly into the IntelliJ IDE, allowing developers to select a database table and generate corresponding Java classes based on predefined FreeMarker templates.
Key Features:
- Database Schema Introspection: Utilizes IntelliJ's database tools to read table and column metadata.
- Code Generation: Generates
ActionBeanand DTO classes using FreeMarker templates. - Template-driven: Customizable code generation via FreeMarker templates (
actionBean.ftl,actionBean.extend.ftl,actionDTO.ftl,actionDTO.extend.ftl). - IDE Integration: Provides a context menu action ("Generate Action Models") in the Database View for easy access.
Core Technologies:
- Java: Primary development language.
- Kotlin: Configured in
build.gradle.kts, indicating potential for Kotlin usage. - Gradle (Kotlin DSL): Build automation system.
- IntelliJ Platform SDK: For IDE integration and database interaction.
- FreeMarker: Templating engine for code generation.
Building and Running
This project is an IntelliJ Platform Plugin built with Gradle.
Build the Plugin: To build the plugin, use the following Gradle command:
./gradlew build
This will produce a .zip plugin artifact in the build/distributions directory.
Run the Plugin in a Development IDE: To run a new IntelliJ IDE instance with this plugin installed for development and testing:
./gradlew runIde
Alternatively, you can use the "Run IDE with Plugin" run configuration provided in the .run directory within IntelliJ IDEA.
Development Conventions
- Language: Primarily Java, with Kotlin support configured.
- Build System: Gradle with Kotlin DSL (
.gradle.ktsfiles). - Code Generation: FreeMarker templates are located in
src/main/resources/templates/. Modifications to these templates will change the generated code structure. - IntelliJ Platform APIs: Development involves using IntelliJ Platform SDK for UI actions, virtual file system operations, and database schema access.
- Action Definition: New actions are defined in
src/main/resources/META-INF/plugin.xml.