Class DescriptionsLists
×News: OpenXava 7.7 released - March 9 · Read more
java.lang.Object
org.openxava.web.DescriptionsLists
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidOverload to fill a provided map with parsed key values using only MetaModel.static voidfillReferenceValues(Map referenceValues, MetaReference ref, String value, String qualifier, String propertyPrefix, javax.servlet.http.HttpServletRequest request, Messages errors, String viewName) Fills a map with reference values from a composite key string.static voidfillReferenceValues(Map referenceValues, MetaReference ref, String value, String qualifier, String propertyPrefix, javax.servlet.http.HttpServletRequest request, Messages errors, String viewName, boolean emptyIfNotBracketed) Fills a map with reference values from a composite key string.parseKeyValues(MetaModel metaModel, String value) Convenience overload to parse composite key values without providing request/view.parseKeyValues(MetaModel metaModel, String value, javax.servlet.http.HttpServletRequest request, Messages errors, String viewName, boolean emptyIfNotBracketed) Parses a key string using MetaModel key properties.parseKeyValues(MetaModel metaModel, Collection<String> keyPropertiesNames, String value) Convenience overload to parse using provided key property names without request/view.parseKeyValues(MetaModel metaModel, Collection<String> keyPropertiesNames, String value, javax.servlet.http.HttpServletRequest request, Messages errors, String viewName, boolean emptyIfNotBracketed) Parses a key string using the given key property names instead of the MetaModel primary key.static voidresetDescriptionsCache(javax.servlet.http.HttpSession session) static StringtoKeyString(MetaModel metaModel, Map<String, Object> keyValues) Formats key values into the standard key string representation.
-
Field Details
-
COMPOSITE_KEY_SUFFIX
- See Also:
-
-
Constructor Details
-
DescriptionsLists
public DescriptionsLists()
-
-
Method Details
-
resetDescriptionsCache
public static void resetDescriptionsCache(javax.servlet.http.HttpSession session) -
fillReferenceValues
public static void fillReferenceValues(Map referenceValues, MetaReference ref, String value, String qualifier, String propertyPrefix, javax.servlet.http.HttpServletRequest request, Messages errors, String viewName, boolean emptyIfNotBracketed) Fills a map with reference values from a composite key string.- Parameters:
referenceValues- Map to be filled with reference valuesref- MetaReference containing the reference definitionvalue- String value containing the composite keyqualifier- Qualifier for request attributes, can be nullpropertyPrefix- Prefix for property names in the map, can be nullrequest- HttpServletRequest for setting attributes and parsing valueserrors- Messages object for error handling during parsingviewName- View name for editor formattingemptyIfNotBracketed- If true and value doesn't start with '[', value is set to empty string. If false and value doesn't start with '[', value is wrapped with "[." and ".]".- Since:
- 7.6
-
fillReferenceValues
public static void fillReferenceValues(Map referenceValues, MetaReference ref, String value, String qualifier, String propertyPrefix, javax.servlet.http.HttpServletRequest request, Messages errors, String viewName) Fills a map with reference values from a composite key string. This is a convenience method that uses the default behavior for Tab.- Parameters:
referenceValues- Map to be filled with reference valuesref- MetaReference containing the reference definitionvalue- String value containing the composite keyqualifier- Qualifier for request attributes, can be nullpropertyPrefix- Prefix for property names in the map, can be nullrequest- HttpServletRequest for setting attributes and parsing valueserrors- Messages object for error handling during parsingviewName- View name for editor formatting
-
parseKeyValues
public static Map<String,Object> parseKeyValues(MetaModel metaModel, String value, javax.servlet.http.HttpServletRequest request, Messages errors, String viewName, boolean emptyIfNotBracketed) Parses a key string using MetaModel key properties.It can be a composite key like "[.1.4.]" or a simple key like "1". Values are parsed via WebEditors.parse() to ensure consistency with editors.
- Since:
- 7.6
-
parseKeyValues
Convenience overload to parse composite key values without providing request/view.It can be a composite key like "[.1.4.]" or a simple key like "1". Uses default behavior for Tab (wrap with brackets if needed).
- Since:
- 7.6
-
parseKeyValues
public static Map<String,Object> parseKeyValues(MetaModel metaModel, Collection<String> keyPropertiesNames, String value, javax.servlet.http.HttpServletRequest request, Messages errors, String viewName, boolean emptyIfNotBracketed) Parses a key string using the given key property names instead of the MetaModel primary key. Reuses the same parsing logic to keep behavior consistent.- Since:
- 7.6
-
parseKeyValues
-
fillReferenceValues
-
toKeyString
Formats key values into the standard key string representation.For a single key property, returns the raw value as a string (e.g. "2"). For multiple key properties, returns the composite format "[.v1.v2.]" (e.g. "[.1.4.]"). The key properties are obtained from the MetaModel, so nested keys are supported.
- Parameters:
metaModel- MetaModel to obtain key property names fromkeyValues- Map from key property name to its value- Returns:
- The formatted key string
- Since:
- 7.7
-