HistoryFormatUtils.kt@Service providing formatting utilities for history display. Translates group/user ID lists into human-readable names, handles property name translation via i18n, formats embedded collection entries with positional prefixes (e.g., pos#1:propertyName), and processes DisplayHistoryEntry objects for frontend rendering.Injects GroupService and UserService to resolve ID lists into sorted, comma-separated names:
"GroupIds": resolves to group names via groupService.getGroupNames(value)"UserIds": resolves to user names via userService.getUserNames(value)"null" values gracefully| Method | Description |
|---|---|
getPlainPropertyName(attr) | Strips internal format; delegates to HistoryOldFormatConverter if outdated |
translatePropertyName(clazz, propertyName) | Looks up @PropertyInfo annotation for i18n key, translates it, or returns raw name |
Used for list-type properties (e.g., AuftragDO.positionen) to show positional context in history:
getPropertyNameForEmbedded(propertyName, "pos", 1) → "pos#1" or "pos#1:propertyName"
getPropertyNameForEmbedded(propertyName, Pair("pos", 1), Pair("kost1", 3)) → "pos#1.kost1#3:propertyName"
setNumberAsPropertyNameForListEntries(historyEntries, prefix, number) — applies display names to all entries/attrs in a collectionvararg prefixes: Pair<String, Number?> overload for multi-level nestingHistoryOldFormatConverter.getPlainPropertyName() — normalizes legacy formattranslatePropertyName() — i18n translation via @PropertyInfo annotationreplaceGroupAndUserIdsValues() — resolves ID lists to namessetNumberAsPropertyNameForListEntries() — prefixes position numbers868d6abb7 2025 -> 2026 63081666f Source file headers: 2024-> 2025. 18bf92219 WIP: History entries handling. VisitorBookDao. 9e3c523c7 Migration stuff in progress... (all tests OK). c97135a57 Migration stuff in progress... f408da8a8 Migration stuff in progress... (all tests OK). d18c899b5 Refactoring of history entries, FlatDisplayHistoryEntries and DisplayHistoryEntries... b79a1edca Migration stuff in progress... (all tests OK).