Class FieldsSettingsService
java.lang.Object
sk.iway.iwcm.system.datatable.settings.fields.rest.FieldsSettingsService
Caches field settings by class and domain and discovers annotated entities for autocomplete.
Shares class discovery with custom fields; autocomplete metadata comes from annotations and domain-scoped tab settings.
-
Constructor Summary
ConstructorsConstructorDescriptionFieldsSettingsService(FieldsSettingsRepository repository, TabsSettingsService tabsSettingsService) -
Method Summary
Modifier and TypeMethodDescriptionvoidclearCache(String cacheKey) Removes cached settings locally and requests invalidation on the other cluster nodes.getCacheKey(String className, int domainId) Builds a fixed-length cache key from the class name and domain ID.getClassOptions(String term) Returns sorted entity class names containing the search term and at least one datatable column.Returns custom-field class suggestions while retaining literal substring matching.getFieldOptions(String term, String className, Prop prop) Returns localized column titles with field paths as labels and raw field paths as values, excluding ID columns.getFieldsSettings(String className, int domainId) Loads settings for a class and domain, caching the result for one hour.getTabOptions(String term, String className, Prop prop) Returns localized tab titles from the selected class's annotations and current-domain settings with raw IDs as values.booleanChecks a tab ID against the entity's editor metadata and settings in the supplied domain.booleanChecks a tab ID while excluding a persisted setting that is being changed.
-
Constructor Details
-
FieldsSettingsService
public FieldsSettingsService(FieldsSettingsRepository repository, TabsSettingsService tabsSettingsService)
-
-
Method Details
-
getFieldsSettings
Loads settings for a class and domain, caching the result for one hour.- Parameters:
className- fully qualified entity class namedomainId- domain owning the settings- Returns:
- the cached settings array, empty when no overrides exist
-
getCacheKey
Builds a fixed-length cache key from the class name and domain ID.- Parameters:
className- fully qualified entity class namedomainId- domain owning the settings- Returns:
- the settings prefix followed by the SHA-256 hash of the class/domain pair
-
clearCache
Removes cached settings locally and requests invalidation on the other cluster nodes.- Parameters:
cacheKey- key returned bygetCacheKey(String, int)
-
getClassOptions
Returns sorted entity class names containing the search term and at least one datatable column.- Parameters:
term- search text, or%or*to return all eligible class names- Returns:
- case-insensitively sorted matching class names, or an empty list for an empty term
-
getCustomFieldClassOptions
Returns custom-field class suggestions while retaining literal substring matching.- Parameters:
term- substring to match;*and%do not expand to all classes- Returns:
- case-insensitively sorted matching class names, or an empty list for blank input
-
getFieldOptions
Returns localized column titles with field paths as labels and raw field paths as values, excluding ID columns.- Parameters:
term- search text, or%or*to return all field namesclassName- fully qualified selected class nameprop- translations for the current request- Returns:
- options matching the title or field name, or an empty list for empty input or an unknown class
-
getTabOptions
Returns localized tab titles from the selected class's annotations and current-domain settings with raw IDs as values.- Parameters:
term- search text, or%or*to return all tab IDsclassName- fully qualified selected class nameprop- translations for the current request- Returns:
- options matching the title or tab ID, or an empty list for empty input or no matching tabs
-
hasTab
Checks a tab ID against the entity's editor metadata and settings in the supplied domain.- Parameters:
className- fully qualified selected class nametabId- raw tab ID to validatedomainId- domain owning the settings- Returns:
- whether the tab exists for this entity and domain
-
hasTab
Checks a tab ID while excluding a persisted setting that is being changed. Declared or inferred tabs remain available even if their saved override is excluded.- Parameters:
className- fully qualified selected class nametabId- raw tab ID to validatedomainId- domain owning the settingsexcludedSettingsId- persisted tab setting being edited, or null to include all settings- Returns:
- whether the tab still exists without the excluded setting
-