#1310: HistoryLoadContext.kt

projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/HistoryLoadContext.kt Service/Context Class, projectforge-business/.../persistence/history/HistoryLoadContext.kt 170 lines · 107 code · 29 comments · 34 blank
Thread-safe mutable context used during history entry loading and conversion. Stores raw history entries, loaded entities, and entry-attribute mappings; provides iteration state (current entry/attr) for converters and display formatters.

Architecture & Role

HistoryLoadContext serves as the central state-holder when history data is loaded from the database and transformed into human-/JSON-readable DisplayHistoryEntry objects. It is instantiated per load operation (not a singleton) and passed through the chain of history converters.

Key Inner Classes

ClassPurpose
HistoryEntryMapPairs a raw HistoryEntryDO with its display counterpart and a mutable extension map for custom data.
HistoryEntryAttrMapPairs a raw HistoryEntryAttrDO with its display counterpart and a mutable extension map.

State Management

The context maintains:

Delegation Methods

Delegates value resolution to historyValueService: getObjectValue() resolves string-encoded values to typed objects; getClass() resolves class names to Class<?>. User resolution delegates to UserGroupCache via getUser(id).

Git History

868d6abb7 2025 -> 2026
b7861b2ff Addresses: forced deletion fixed (after mgc migration): sipgate-contacts and history entries / attrs.
63081666f Source file headers: 2024-> 2025.
bbc198d03 Migration stuff in progress... (all tests of all packages: OK).
9e3c523c7 Migration stuff in progress... (all tests of all packages: OK).
c97135a57 Migration stuff in progress...
f408da8a8 Migration stuff in progress... (all tests of all packages: OK).