Migration Plan: Bootstrap 4 to Bootstrap 5 Java Wrapper
December 23, 2025 · View on GitHub
Based on analysis of the ph-oton-bootstrap4 project, this document provides a comprehensive plan to create the same functionality for Bootstrap 5.
Project Overview
The Bootstrap 4 wrapper consists of 5 modules:
- ph-oton-bootstrap4 - Core Java wrapper for Bootstrap 4 controls
- ph-oton-bootstrap4-uictrls - Special UI controls
- ph-oton-bootstrap4-pages - Predefined UI pages
- ph-oton-bootstrap4-stub - Servlet stub for web applications
- ph-oton-bootstrap4-demo - Demo web application
Step-by-Step Migration Plan
Phase 1: Project Setup & Infrastructure
1.1 Create Maven Multi-Module Structure
- Create parent POM (
pom.xml) similar to bootstrap4 parent - Update artifact IDs:
ph-oton-bootstrap5-parent-pom - Set up 5 child modules:
ph-oton-bootstrap5ph-oton-bootstrap5-uictrlsph-oton-bootstrap5-pagesph-oton-bootstrap5-stubph-oton-bootstrap5-demo
1.2 Update Project Metadata
- Update SCM URLs to point to
ph-oton-bootstrap5repository - Update Maven coordinates (groupId stays:
com.helger.photon) - Set initial version (e.g.,
1.0.0-SNAPSHOT) - Update README.md with Bootstrap 5 information
1.3 Setup Build Configuration
- Configure same build plugins (jscompress, csscompress, bundle plugin)
- Set Java 17+ requirement
- Configure JakartaEE 10 dependencies
Phase 2: Core Module (ph-oton-bootstrap5)
2.1 Bootstrap 5 Assets ✅ COMPLETED
- ✅ Downloaded Bootstrap 5.3.8 (latest stable) CSS and JS files
- ✅ Placed in
src/main/resources/external/bootstrap/5.3.8/ - ✅ Included both regular versions (minified versions created via ph-csscompress-maven-plugin)
- ✅ Created
MainExtractBootstrap5CSSClasses.java(based onMainExtractBootstrap4CSSClasses.java)- ✅ Updated the class to read from Bootstrap 5 CSS path
- ✅ Changed
EBootstrapCSSPathProvider.BOOTSTRAPreference to point to Bootstrap 5 CSS - ✅ Ran the extraction tool to generate CSS class constants
- ✅ Generated 2,024 CSS class constants to /tmp/bootstrap5-css-classes.txt
2.2 Update Constants ✅ COMPLETED
- ✅ CBootstrap.java: Updated version constant to Bootstrap 5.3.8 (BOOTSTRAP_VERSION_538)
- ✅ CBootstrapCSS.java: Extracted all 2,024 Bootstrap 5 CSS classes (2,060 lines)
- ✅ Removed deprecated classes (jumbotron-, media-, etc.)
- ✅ Added new classes (offcanvas-*, accordion-flush, etc.)
- ✅ Updated utility classes (fw-bold, fst-italic, font-monospace, etc.)
- ✅ Added XXL breakpoint classes (col-xxl-*, etc.)
2.3 Key Bootstrap 5 Changes to Implement
Bootstrap 4 Component Inventory (121 classes across 17 packages):
- alert/ (9 classes): AbstractBootstrapAlert, BootstrapBox, BootstrapDangerBox, BootstrapErrorBox, BootstrapInfoBox, BootstrapQuestionBox, BootstrapSuccessBox, BootstrapWarnBox, EBootstrapAlertType
- badge/ (3 classes): BootstrapBadge, BootstrapBadgeLink, EBootstrapBadgeType
- breadcrumb/ (4 classes): BootstrapBreadcrumb, BootstrapBreadcrumbItem, BootstrapBreadcrumbList, BootstrapBreadcrumbProvider
- button/ (6 classes): BootstrapButton, BootstrapLinkButton, BootstrapResetButton, BootstrapSubmitButton, EBootstrapButtonSize, EBootstrapButtonType
- buttongroup/ (4 classes): BootstrapButtonGroup, BootstrapButtonToolbar, EBootstrapButtonGroupSize, EBootstrapButtonGroupType
- card/ (7 classes): BootstrapCard, BootstrapCardBody, BootstrapCardColumns, BootstrapCardDeck, BootstrapCardFooter, BootstrapCardGroup, BootstrapCardHeader
- dropdown/ (6 classes): BootstrapDropdownDivider, BootstrapDropdownHeader, BootstrapDropdownItem, BootstrapDropdownMenu, BootstrapDropdownText, EBootstrapDropType
- form/ (12 classes): BootstrapForm, BootstrapFormCheck, BootstrapFormCheckInline, BootstrapFormGroup, BootstrapFormGroupRendererTextOnly, BootstrapFormHelper, BootstrapInvalidFeedback, BootstrapViewForm, DefaultBootstrapFormGroupRenderer, EBootstrapFormType, IBootstrapFormGroupContainer, IBootstrapFormGroupRenderer
- grid/ (12 classes): BootstrapCol, BootstrapGridSpec, BootstrapRow, EBootstrapColOrder, EBootstrapGridLG, EBootstrapGridMD, EBootstrapGridSM, EBootstrapGridType, EBootstrapGridXL, EBootstrapGridXS, EBootstrapRowVerticalAlign, IBootstrapGridElement
- inputgroup/ (2 classes): BootstrapInputGroup, EBootstrapInputGroupSize
- jumbotron/ (1 class): BootstrapJumbotron
- listgroup/ (1 class): BootstrapListGroup
- modal/ (4 classes): BootstrapModal, BootstrapModalCloseButton, EBootstrapModalOptionBackdrop, EBootstrapModalSize
- nav/ (5 classes): BootstrapNav, BootstrapNavItem, BootstrapNavLink, BootstrapTabBox, EBootstrapNavType
- navbar/ (7 classes): BootstrapNavbar, BootstrapNavbarNav, BootstrapNavbarText, BootstrapNavbarToggleable, BootstrapNavbarToggler, EBootstrapNavbarColorSchemeType, EBootstrapNavbarExpandType
- table/ (2 classes): AbstractBootstrapTable, BootstrapTable
- tooltip/ (5 classes): BootstrapTooltip, EBootstrapTooltipBoundary, EBootstrapTooltipFallbackPlacement, EBootstrapTooltipPosition, EBootstrapTooltipTrigger
- utils/ (29 classes): Utility helpers for borders, spacing, display, colors, etc.
Bootstrap 5 Migration Changes:
Components to Remove:
- jumbotron/BootstrapJumbotron → Document migration to utility classes
- card/BootstrapCardDeck → Use grid system instead
- card/BootstrapCardColumns → Use grid system instead
New Components to Add:
- offcanvas/ package (NEW)
- BootstrapOffcanvas
- BootstrapOffcanvasHeader
- BootstrapOffcanvasBody
- EBootstrapOffcanvasPosition (start, end, top, bottom)
- form/ additions
- BootstrapFloatingLabel (new form control variant)
- BootstrapValidFeedback (counterpart to InvalidFeedback)
Components Requiring Major Updates:
- Forms (12 classes → ~14 classes with additions)
- Custom form controls merged with native controls
- Add floating label support
- Update validation feedback styling
- Remove custom-* CSS class patterns
- Buttons (6 classes)
- Remove
.btn-blocksupport (deprecated) - Document use of
.d-gridinstead
- Remove
- Grid (12 classes → add XXL breakpoint)
- Add
EBootstrapGridXXLenum (≥1400px) - Update all grid-related classes to support XXL
- Add
- Navbar (7 classes)
- Update
EBootstrapNavbarExpandTypeto include XXL - Simplify data attributes (data-bs-* prefix)
- Update
Components Requiring Minor Updates:
- Badge (3 classes) - Replace badge-pill with rounded-pill utility
- Dropdown (6 classes) - Update data attributes (data-bs-* prefix)
- Modal (4 classes) - Update data attributes, add new fullscreen modes
- Tooltip (5 classes) - Update for Popper.js v2, data-bs-* prefix
- Alert (9 classes) - Minimal CSS class updates
- Breadcrumb (4 classes) - Minimal changes
- Button Group (4 classes) - Minimal changes
- Input Group (2 classes) - Simplified markup
- List Group (1 class) - Minimal changes
- Nav (5 classes) - Minor CSS updates, add nav-underline support
- Table (2 classes) - Add new table variants (striped-columns, etc.)
2.4 Update Path Providers ✅ COMPLETED
- ✅ EBootstrapCSSPathProvider.java: Updated to Bootstrap 5.3.8
- ✅ EBootstrapJSPathProvider.java: Created with Bootstrap 5.3.8 paths
- ✅ BOOTSTRAP: external/bootstrap/5.3.8/bootstrap.js (requires Popper.js separately)
- ✅ BOOTSTRAP_BUNDLE: external/bootstrap/5.3.8/bootstrap.bundle.js (includes Popper.js - recommended)
- ✅ BOOTSTRAP_PH: ph-oton/bootstrap5-ph.js (custom extensions)
- ✅ Note: Bootstrap 5 uses Popper.js v2 (jQuery no longer required!)
2.5 Migrate Component Classes (Package by Package)
Migration Priority Order:
Phase 2.5.1 - Minimal Changes (Quick Wins) ✅ COMPLETED
- ✅ alert/ (9 classes) - Migrated, CSS class references updated
- ✅ breadcrumb/ (4 classes) - Migrated, minimal CSS updates applied
- ✅ buttongroup/ (4 classes) - Migrated, minimal changes
- ✅ listgroup/ (1 class) - Migrated, minimal changes
Phase 2.5.2 - Minor Updates ✅ COMPLETED 5. ✅ badge/ (3 classes) - Migrated (badge-pill → rounded-pill update needed) 6. ✅ inputgroup/ (2 classes) - Migrated, simplified markup patterns 7. ✅ nav/ (5 classes) - Migrated (nav-underline support to be added) 8. ✅ table/ (2 classes) - Migrated (new table variants to be added) 9. ✅ tooltip/ (5 classes) - Migrated (Popper.js v2 and data-bs-* updates needed)
Phase 2.5.3 - Moderate Updates ✅ COMPLETED 10. ✅ dropdown/ (6 classes) - Migrated (data-toggle → data-bs-toggle updates needed) 11. ✅ modal/ (4 classes) - Migrated (data attributes and fullscreen modes to be added) 12. ✅ navbar/ (7 classes) - Migrated (XXL breakpoint and data attributes to be updated) 13. ✅ card/ (7 classes) - Migrated (CardDeck & CardColumns deprecation to be documented)
Phase 2.5.4 - Major Updates
14. ✅ button/ (6 classes) - Migrated (btn-block removal and d-grid alternative to be documented)
15. ✅ grid/ (12 classes) - Migrated (EBootstrapGridXXL addition pending)
16. ✅ form/ (12 classes) - Migrated (floating labels and validation updates pending)
Phase 2.5.5 - Deprecations & New Components 17. ✅ jumbotron/ (1 class) - Migrated (@Deprecated marker and migration docs pending) 18. offcanvas/ (NEW package, ~4 classes) - TO BE CREATED
Phase 2.5.6 - Utilities & Base ✅ COMPLETED 19. ✅ utils/ (29 classes) - Migrated, updated EBootstrapFontType for BS5 utility class names (fw-, fst-) 20. ✅ base/ (2 classes) - Migrated (AbstractBootstrapDiv, AbstractBootstrapObject) 21. ✅ config/ (1 class) - Migrated (ThirdPartyModuleProvider_ph_oton_bootstrap5)
Migration Summary:
- Migrated Packages: 18/18 packages (including base and utils)
- Total Classes Migrated: 121 classes
- Additional Files Created: BootstrapCustomConfig.java, ThirdPartyModuleProvider_ph_oton_bootstrap5.java, SPI service registration
- Compilation Status: ✅ BUILD SUCCESS
- Tests Status: ✅ All path provider tests passing
- Known CSS Updates Needed:
- EBootstrapFontType: ✅ Updated (FONT_WEIGHT_BOLD → FW_BOLD, TEXT_MONOSPACE → FONT_MONOSPACE, etc.)
- Badge pill classes: badge-pill → rounded-pill (pending)
- Button block: btn-block → d-grid + gap utilities (pending)
- Data attributes: data-* → data-bs-* throughout (pending)
- Grid XXL breakpoint: Add EBootstrapGridXXL enum (pending)
2.6 Configuration & Third-Party Module Provider ✅ COMPLETED
- ✅ BootstrapCustomConfig.java: Created - allows customization of Bootstrap CSS/JS paths
- ✅ Updated to use BOOTSTRAP_BUNDLE by default (includes Popper.js v2)
- ✅ Removed jQuery dependency (Bootstrap 5 doesn't require it)
- ✅ Thread-safe configuration with read-write locks
- ✅ config/ThirdPartyModuleProvider_ph_oton_bootstrap5.java: Created SPI implementation
- ✅ Registers Bootstrap 5.3.8 as third-party module
- ✅ MIT License declaration
- ✅ Documentation link to Bootstrap 5.3 docs
- ✅ META-INF/services/com.helger.base.thirdparty.IThirdPartyModuleProviderSPI: Created SPI registration file
Phase 3: UI Controls Module (ph-oton-bootstrap5-uictrls)
Bootstrap 4 UI Controls Inventory (32+ classes across 8 packages):
- config/ (1 class): ThirdPartyModuleProvider_ph_oton_bootstrap4_uictrls
- datatables/ (6 classes): BootstrapDataTables, BootstrapDataTablesDom, BootstrapDataTablesLayout, BootstrapDataTablesScrollerDom, BootstrapDTColAction, IBootstrapDataTablesConfigurator
- datatables/plugins/ (9 classes): BootstrapDataTablesPluginAutoFill, BootstrapDataTablesPluginButtons, BootstrapDataTablesPluginColumnReorder, BootstrapDataTablesPluginFixedColumns, BootstrapDataTablesPluginFixedHeader, BootstrapDataTablesPluginKeyTable, BootstrapDataTablesPluginResponsive, BootstrapDataTablesPluginScroller, BootstrapDataTablesPluginSelect
- datetimepicker/ (10 classes): Bootstrap4DateTimePickerFormatBuilder, Bootstrap4DateTimePickerJS, Bootstrap4DateTimePickerSpecialNodeListModifier, BootstrapDateTimePicker, EBootstrap4DateTimePickerMode, EBootstrap4DateTimePickerSpecialFormats, EBootstrap4DateTimePickerTexts, EBootstrap4DateTimePickerViewModeType, EDateTimePickerDayOfWeek, EMomentsDateTimePickerFormatToken
- ext/ (10 classes): BootstrapCardCollapsible, BootstrapFileUpload, BootstrapLoginHTMLProvider, BootstrapLoginManager, BootstrapMenuItemRenderer, BootstrapMenuItemRendererHorz, BootstrapPageRenderer, BootstrapSecurityUI, BootstrapSimpleTooltip, BootstrapTechnicalUI
- prism/ (1 class): BootstrapPrismJS
- select2/ (1 class): BootstrapSelect2
- treeview/ (2 classes): BootstrapTreeView, BootstrapTreeViewItem
- typeahead/ (1 class): BootstrapTypeahead
Migration Priority Order (by ascending complexity):
- Phase 3.1 - Prism.js (1 class) - Easiest: framework-agnostic, just syntax highlighting
- Phase 3.2 - Select2 (1 class) - Easy: framework-agnostic, add BS5 theme
- Phase 3.3 - Typeahead (1 class) - Easy: framework-agnostic, minimal input styling
- Phase 3.4 - DataTables (15 classes) - Moderate: framework-agnostic, many files but straightforward
- Phase 3.5 - Custom Extensions (10 classes) - Moderate: update data-bs-* attributes and CSS
- Phase 3.6 - TreeView (2 classes) - Moderate-Hard: may need BS5 compatible library
- Phase 3.7 - DateTimePicker (10 classes) - Hardest: migrate to Tempus Dominus v6.10.4, complete API rewrite
- Phase 3.8 - Configuration (1 class) - Final: register all dependencies
3.1 Syntax Highlighting - Prism.js (1 class) - EASIEST ✅ COMPLETED
Status: Prism.js is framework-agnostic - minimal changes
Migration Tasks:
- ✅ Copy BootstrapPrismJS class
- ✅ Update package names (bootstrap4 → bootstrap5)
- ✅ Copy/update Prism.js CSS and JS resources from bootstrap4-uictrls
- ✅ Verify Prism.js CSS compatibility with BS5 (framework-agnostic, no changes needed)
- ✅ Update resource path providers (using generic PRISMJS constant)
- ⏭️ Migrate unit tests for BootstrapPrismJS (no tests found in bootstrap4-uictrls)
- ✅ Test with BS5 code blocks (compilation successful)
Classes migrated:
- ✅ BootstrapPrismJS
Resources migrated:
- ✅ bootstrap-ext.css (Bootstrap extension CSS)
- ✅ bootstrap-ext.min.css (minified version)
- ℹ️ Prism.js core CSS/JS managed by ph-oton-uictrls dependency
Tests migrated:
- N/A (no unit tests exist for this class)
Notes:
- Prism.js is completely framework-agnostic
- Using generic EUICtrlsCSSPathProvider.PRISMJS constant
- Bootstrap-specific styling is minimal, handled by bootstrap-ext.css
3.2 Select2 Integration (1 class) - EASY ✅ COMPLETED
Status: Select2 is framework-agnostic; Bootstrap 5 theme applied
Migration Tasks:
- ✅ Copy BootstrapSelect2 class
- ✅ Update package names (bootstrap4 → bootstrap5)
- ✅ Use Select2 Bootstrap 5 theme (theme = "bootstrap-5")
- ✅ Register CSS resources via ph-oton-uictrls: SELECT2 + SELECT2_BOOTSTRAP5
- ✅ Update resource path providers (EUICtrlsCSSPathProvider constants)
- ⏭️ Unit tests (none existed in bootstrap4-uictrls)
- ✅ Compile with BS5 (BUILD SUCCESS)
- ✅ Manual check: dropdown styling with BS5
Classes migrated:
- ✅ BootstrapSelect2
Resources used (from ph-oton-uictrls dependency):
- Select2 core CSS/JS
- Select2 Bootstrap 5 theme CSS (select2-bootstrap-5-theme.css)
- Select2 language files (if needed via dependency)
Tests migrated:
- N/A (no Select2 tests in bootstrap4-uictrls)
3.3 Typeahead Integration (1 class) - EASY ✅ COMPLETED
Status: Twitter Typeahead is framework-agnostic; BS5 wrapper uses Bootstrap 5 CSS include
Migration Tasks:
- ✅ Copy BootstrapTypeahead class
- ✅ Update package names (bootstrap4 → bootstrap5)
- ✅ Register BS5 CSS include via EUICtrlsCSSPathProvider.TYPEAHEAD_BOOTSTRAP5
- ✅ Compile with BS5 (BUILD SUCCESS)
- ⏭️ Unit tests (none existed in bootstrap4-uictrls)
- ✅ Manual check: dropdown positioning compatible with BS5 inputs
Classes migrated:
- ✅ BootstrapTypeahead
Resources used (from ph-oton-uictrls dependency):
- Typeahead CSS for Bootstrap 5 theme
- Typeahead JS bundle and Bloodhound (provided by dependency)
Tests migrated:
- N/A (no Typeahead tests in bootstrap4-uictrls)
3.4 DataTables Integration (15 classes) - MODERATE ✅ COMPLETED
Status: DataTables wired to Bootstrap 5 path providers; BS5 spacing utilities applied
Migration Tasks:
- ✅ Copy datatables + plugins classes
- ✅ Update package names (bootstrap4 → bootstrap5)
- ✅ Switch to B5 path providers (EDataTablesB5CSS/JSPathProvider)
- ✅ Drop BS4-only PH CSS include (no B5 equivalent)
- ✅ Update DOM spacing utilities (mr/ml → me/ms)
- ✅ Compile & test module (BUILD SUCCESS)
- ⏭️ Unit tests (none existed in bootstrap4-uictrls)
Classes migrated:
- ✅ BootstrapDataTables
- ✅ BootstrapDataTablesDom
- ✅ BootstrapDataTablesLayout
- ✅ BootstrapDataTablesScrollerDom
- ✅ BootstrapDTColAction
- ✅ IBootstrapDataTablesConfigurator
- ✅ BootstrapDataTablesPluginAutoFill
- ✅ BootstrapDataTablesPluginButtons
- ✅ BootstrapDataTablesPluginColumnReorder
- ✅ BootstrapDataTablesPluginFixedColumns
- ✅ BootstrapDataTablesPluginFixedHeader
- ✅ BootstrapDataTablesPluginKeyTable
- ✅ BootstrapDataTablesPluginResponsive
- ✅ BootstrapDataTablesPluginScroller
- ✅ BootstrapDataTablesPluginSelect
Resources used (from ph-oton-datatables dependency):
- DataTables core + Bootstrap 5 integration CSS/JS
- Plugin CSS/JS for AutoFill, Buttons, ColReorder, FixedColumns, FixedHeader, KeyTable, Responsive, Scroller, Select
Tests migrated:
- N/A (no DataTables tests in bootstrap4-uictrls)
3.5 Custom Extensions (10 classes) - MODERATE ✅ COMPLETED
Status: All extension classes migrated to Bootstrap 5 syntax and structure.
Migration Tasks:
- ✅ BootstrapCardCollapsible: Updated for BS5 collapse behavior (
data-bs-toggle,data-bs-target), updated icons to FontAwesome 5. - ✅ BootstrapFileUpload: Refactored to use standard
.form-control(BS5 dropped.custom-file), added label support. - ✅ BootstrapLoginHTMLProvider: Updated form grouping, spacing utilities (
ml->ms), and package imports. - ✅ BootstrapLoginManager: Updated to use new HTML provider.
- ✅ BootstrapMenuItemRenderer: Verified nav/dropdown classes, updated imports.
- ✅ BootstrapMenuItemRendererHorz: Verified horizontal nav styling, updated imports.
- ✅ BootstrapPageRenderer: Updated spacing utilities (
ml-4->ms-4) for RTL support, updated breadcrumb/system message imports. - ✅ BootstrapSecurityUI: Ported with updated imports.
- ✅ BootstrapSimpleTooltip: Updated to use
EFontAwesome5IconandBootstrapTooltip(Popper.js v2). - ✅ BootstrapTechnicalUI: Ported with updated imports.
- ✅ EBootstrapUICtrlsCSSPathProvider: Created to provide
bootstrap-ext.csspath.
Classes migrated:
- ✅ BootstrapCardCollapsible
- ✅ BootstrapFileUpload
- ✅ BootstrapLoginHTMLProvider
- ✅ BootstrapLoginManager
- ✅ BootstrapMenuItemRenderer
- ✅ BootstrapMenuItemRendererHorz
- ✅ BootstrapPageRenderer
- ✅ BootstrapSecurityUI
- ✅ BootstrapSimpleTooltip
- ✅ BootstrapTechnicalUI
Resources migrated:
- ✅
bootstrap-ext.css(viaEBootstrapUICtrlsCSSPathProvider)
Tests migrated:
- ⏭️ Unit tests (none existed in bootstrap4-uictrls for these specific classes)
3.6 TreeView (2 classes) ✅ COMPLETED
Status: Replaced with Quercus.js (v0.3.1)
Migration Tasks:
- ✅ Find Bootstrap 5 compatible TreeView library (Selected Quercus.js)
- ✅ Update BootstrapTreeView and BootstrapTreeViewItem
- ✅ Copy/update TreeView CSS and JS resources (v0.3.1)
- ✅ Update CSS classes for BS5
- ✅ Update resource path providers
- ✅ Update icon classes if using FontAwesome
- ✅ Migrate unit tests for TreeView classes
- ✅ Test expand/collapse functionality
Classes to migrate:
- BootstrapTreeView
- BootstrapTreeViewItem
Resources to migrate:
- Quercus.js CSS files (v0.3.1)
- Quercus.js JavaScript files (v0.3.1)
- Bootstrap TreeView JavaScript files
- TreeView icons/images
Tests to migrate:
- BootstrapTreeViewTest (if exists)
- BootstrapTreeViewItemTest (if exists)
3.7 DateTimePicker (10 classes) - HARDEST - MAJOR REWRITE ✅ COMPLETED
Status: Migrated to Tempus Dominus v6.9.4 (latest stable)
Library Information:
- Name: Tempus Dominus
- Version: v6.9.4
- Repository: https://github.com/Eonasdan/tempus-dominus
- Documentation: https://getdatepicker.com/
- License: MIT
- Key Changes from v4/v5:
- No jQuery dependency (native JavaScript)
- No Bootstrap dependency (can work standalone)
- No Moment.js dependency (uses native Date/Intl)
- Only requires Popper.js v2 for positioning
- Written in TypeScript
- Completely new API
Migration Tasks:
- ✅ Resources:
- ✅ Downloaded Tempus Dominus v6.9.4 from GitHub releases.
- ✅ Files:
tempus-dominus.min.css,tempus-dominus.min.js. - ✅ Removed old
bootstrap-datetimepickerresources. - ✅ Updated
EBootstrapUICtrlsCSSPathProviderandEBootstrapUICtrlsJSPathProvider.
- ✅ Java Implementation (Major Rewrite):
- ✅ BootstrapDateTimePicker:
- Rewrote initialization to use
new tempusDominus.TempusDominus(element, options). - Refactored option generation to match the new nested JSON structure (
display,restrictions,localization,hooks). - Icons: Explicitly configured FontAwesome 4 icons (default is FA6).
- Rewrote initialization to use
- ✅ BootstrapDateTimePickerJS:
- Updated to generate vanilla JS initialization script.
- ✅ Format Handling:
- EMomentsDateTimePickerFormatToken: Renamed to
ETempusDominusFormatToken. - CRITICAL: Mapped Moment.js tokens to Intl.DateTimeFormat tokens (e.g.,
YYYY->yyyy,DD->dd). - Updated
Bootstrap5DateTimePickerFormatBuilderlogic.
- EMomentsDateTimePickerFormatToken: Renamed to
- ✅ Enums:
- Renamed
EBootstrap4...toEBootstrap5.... - Updated
EBootstrap5DateTimePickerViewModeType.
- Renamed
- ✅ BootstrapDateTimePicker:
- ✅ Localization:
- Verified that
Intlhandles most localization. - Added support for custom localization options via
localizationobject.
- Verified that
- ⏭️ Testing:
- Need to rewrite unit tests for the new format builder and option generation.
Classes migrated:
- ✅ Bootstrap4DateTimePickerFormatBuilder → Bootstrap5DateTimePickerFormatBuilder
- ✅ Bootstrap4DateTimePickerJS → Bootstrap5DateTimePickerJS
- ✅ Bootstrap4DateTimePickerSpecialNodeListModifier → Bootstrap5DateTimePickerSpecialNodeListModifier
- ✅ BootstrapDateTimePicker
- ✅ EBootstrap4DateTimePickerMode → EBootstrap5DateTimePickerMode
- ✅ EBootstrap4DateTimePickerSpecialFormats → EBootstrap5DateTimePickerSpecialFormats
- ✅ EBootstrap4DateTimePickerTexts → EBootstrap5DateTimePickerTexts
- ✅ EBootstrap4DateTimePickerViewModeType → EBootstrap5DateTimePickerViewModeType
- ✅ EDateTimePickerDayOfWeek
- ✅ EMomentsDateTimePickerFormatToken → ETempusDominusFormatToken
Resources migrated:
- ❌ Removed old Bootstrap DateTimePicker CSS/JS (v5.39.0)
- ✅ Added Tempus Dominus v6.9.4 CSS files
- ✅ Added Tempus Dominus v6.9.4 JavaScript files
- ✅ Updated external/tempusdominus/ directory structure
Tests to completely rewrite:
- Bootstrap5DateTimePickerFormatBuilderTest
- Bootstrap5DateTimePickerJSTest
- BootstrapDateTimePickerTest
- All enum tests (mode, formats, texts, view mode)
- Format token tests
- Localization tests
3.8 Configuration & Third-Party Modules (1 class) - FINAL ✅ COMPLETED
Status: Created ThirdPartyModuleProvider and verified configuration.
Migration Tasks:
- ✅ ThirdPartyModuleProvider:
- Created
ThirdPartyModuleProvider_ph_oton_bootstrap5_uictrls. - Registered
TEMPUS_DOMINUS(v6.9.4). - Registered
QUERCUS_JS(v0.3.1). - Created SPI registration file
META-INF/services/com.helger.base.thirdparty.IThirdPartyModuleProviderSPI.
- Created
- ✅ Configuration:
- Verified
BootstrapCustomConfigin core module. - Confirmed it uses
BOOTSTRAP_BUNDLE(Popper included) and no jQuery.
- Verified
- ✅ Other Modules:
- BootstrapSelect2: Verified it uses
bootstrap-5theme and registers correct CSS. - BootstrapTagsInput: Not present in source project.
- BootstrapToggle: Not present in source project.
- BootstrapSelect2: Verified it uses
Classes created:
- ✅ ThirdPartyModuleProvider_ph_oton_bootstrap5_uictrls
Phase 4: Pages Module (ph-oton-bootstrap5-pages)
4.1 Update Base Pages ✅ COMPLETED
Status: Base page classes and menu configurator created.
Migration Tasks:
- ✅ Base Classes:
- Created
BootstrapWebPageUIHandler(updated imports). - Created
AbstractBootstrapWebPage(updated imports). - Created
AbstractBootstrapWebPageForm(updated imports). - Created
AbstractBootstrapWebPageSimpleForm(updated imports).
- Created
- ✅ Menu Configurator:
- Created
BootstrapPagesMenuConfigurator(updated imports). - Note: This class currently has compilation errors because the referenced page classes (in subpackages) are not yet created. These will be resolved in subsequent steps.
- Created
Classes created:
- ✅ BootstrapWebPageUIHandler
- ✅ AbstractBootstrapWebPage
- ✅ AbstractBootstrapWebPageForm
- ✅ AbstractBootstrapWebPageSimpleForm
- ✅ BootstrapPagesMenuConfigurator
4.2 Handler Classes (7 classes)
Classes to migrate:
AbstractBootstrapWebPageActionHandlerAbstractBootstrapWebPageActionHandlerDeleteAbstractBootstrapWebPageActionHandlerMultiAbstractBootstrapWebPageActionHandlerMultiDeleteAbstractBootstrapWebPageActionHandlerMultiUndeleteAbstractBootstrapWebPageActionHandlerUndeleteAbstractBootstrapWebPageActionHandlerWithQuery
4.3 AppInfo Pages (9 classes)
Classes to migrate:
BasePageAppInfoAjaxFunctionsBasePageAppInfoAPIBasePageAppInfoConfigurationFilesBasePageAppInfoGlobalScopeBasePageAppInfoGoBasePageAppInfoPathMapperBasePageAppInfoSchedulerBasePageAppInfoServletStatusBasePageAppInfoWebSiteResourceBundles
4.4 Data Pages (4 classes)
Classes to migrate:
BasePageDataCountriesBasePageDataCurrenciesBasePageDataLanguagesBasePageDataTimeZones
4.5 Monitoring Pages (7 classes)
Classes to migrate:
BasePageMonitoringAuditBasePageMonitoringFailedMailsBasePageMonitoringLockedObjectsBasePageMonitoringLoginInfoBasePageMonitoringSessionsBasePageMonitoringStatisticsBasePageMonitoringSystemMigrations
4.6 Security Pages (8 classes)
Classes to migrate:
AbstractWebPageSecurityObjectWithAttributesAbstractWebPageSecurityTokenBasePageSecurityChangePasswordBasePageSecurityRoleManagementBasePageSecurityUserGroupManagementBasePageSecurityUserManagementBasePageSecurityUserTokenManagementSecurityUIHelper
4.7 Settings Pages (6 classes)
Classes to migrate:
BasePageSettingsGlobalBasePageSettingsHTMLBasePageSettingsLogLevelBasePageSettingsSMTPBasePageSettingsSystemMessageInternalLog4J2Handler
4.8 SysInfo Pages (10 classes)
Classes to migrate:
BasePageSysInfoCACertsBasePageSysInfoEnvironmentVariablesBasePageSysInfoNetworkBasePageSysInfoRequestBasePageSysInfoSecurityBasePageSysInfoServletContextBasePageSysInfoSystemPropertiesBasePageSysInfoThirdPartyLibrariesBasePageSysInfoThreadsNetworkInterfaceHelper
4.9 Utils Pages (4 classes)
Classes to migrate:
BasePageUtilsBase64DecodeBasePageUtilsBase64EncodeBasePageUtilsHttpClientBasePageUtilsPortChecker
Phase 5: Stub Module (ph-oton-bootstrap5-stub)
5.1 Servlet Configuration
- Update
PhotonStubServletInitializer - Update
PhotonStubServletContextListener - Update
PhotonStubServletContainerInitializer
5.2 Default Configurations
- Update CSS/JS path references
- Update initialization code
Phase 6: Demo Module (ph-oton-bootstrap5-demo)
6.1 Create Demo Application
- Port demo pages from bootstrap4-demo
- Showcase all Bootstrap 5 components
- Add examples of new components (offcanvas, etc.)
6.2 Configuration
- Update
web.xmlfor JakartaEE 10 - Update Jetty configuration (12.x)
- Test with Tomcat 10.1+
Phase 7: Testing & Documentation
7.1 Testing
- Unit tests for all components
- Integration tests for demo app
- Browser compatibility testing
- Responsive design testing
7.2 Documentation
- Update README with Bootstrap 5 specific info
- Document breaking changes from Bootstrap 4
- Create migration guide
- Update JavaDoc
7.3 Examples & Samples
- Create example code for each component
- Document new Bootstrap 5 features
- Add comparison examples (B4 vs B5)
Critical Bootstrap 5 Breaking Changes to Address
1. jQuery Removal
Bootstrap 5 no longer requires jQuery
- Update all JavaScript interactions
- Use vanilla JavaScript or keep jQuery as optional
2. Data Attributes
data-* → data-bs-*
- Update all data attribute setters
- Example:
data-toggle→data-bs-toggle
3. Form Controls
Complete restructuring
- Custom forms merged with native controls
- New floating labels
- Updated validation
4. Grid
New XXL breakpoint
- Add
EBootstrapGridType.XXL - Update
BootstrapGridSpec
5. Removed Components
- Jumbotron (use utilities)
- Card deck/columns (use grid)
- Media object (use flex)
6. Color System
New color utilities
- Updated theme colors
- New accent colors for tables
7. Popper.js
Upgraded to v2
- Update tooltip/popover/dropdown positioning
8. Utilities
Enhanced utility API
- New utility classes
- Responsive utilities
Recommended Implementation Order
| Timeline | Tasks |
|---|---|
| Week 1-2 | Project setup, parent POM, core module structure |
| Week 3-4 | Bootstrap 5 assets, constants (CBootstrap, CBootstrapCSS) |
| Week 5-6 | Basic components (alert, badge, button, card, grid) |
| Week 7-8 | Forms, input groups, validation |
| Week 9-10 | Modal, dropdown, navbar, new offcanvas |
| Week 11-12 | UI controls module, pages module |
| Week 13-14 | Stub module, demo application |
| Week 15-16 | Testing, documentation, refinement |
Tools & Resources Needed
- Bootstrap 5.3.x official documentation
- Bootstrap 4 to 5 migration guide
- CSS class extraction tool (for
CBootstrapCSS.java) - Browser testing tools
- Maven 3.8+
- Java 17+
Summary
This plan provides a systematic approach to migrating your Bootstrap 4 Java wrapper to Bootstrap 5, maintaining the same architectural patterns while accommodating Bootstrap 5's significant changes.