Class DescriptionsLists

×News: OpenXava 7.7 released - March 9 · Read more
java.lang.Object
org.openxava.web.DescriptionsLists

public class DescriptionsLists extends Object
Created on 21/08/2009
Author:
Ana Andres
  • Field Details

  • 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 values
      ref - MetaReference containing the reference definition
      value - String value containing the composite key
      qualifier - Qualifier for request attributes, can be null
      propertyPrefix - Prefix for property names in the map, can be null
      request - HttpServletRequest for setting attributes and parsing values
      errors - Messages object for error handling during parsing
      viewName - View name for editor formatting
      emptyIfNotBracketed - 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 values
      ref - MetaReference containing the reference definition
      value - String value containing the composite key
      qualifier - Qualifier for request attributes, can be null
      propertyPrefix - Prefix for property names in the map, can be null
      request - HttpServletRequest for setting attributes and parsing values
      errors - Messages object for error handling during parsing
      viewName - 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

      public static Map<String,Object> parseKeyValues(MetaModel metaModel, String value)
      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

      public static Map<String,Object> parseKeyValues(MetaModel metaModel, Collection<String> keyPropertiesNames, String value)
      Convenience overload to parse using provided key property names without request/view.
      Since:
      7.6
    • fillReferenceValues

      public static void fillReferenceValues(Map<String,Object> values, MetaModel metaModel, String value)
      Overload to fill a provided map with parsed key values using only MetaModel. Delegates to parseCompositeKeyValues to avoid duplicating parsing logic.
      Since:
      7.6
    • toKeyString

      public static String toKeyString(MetaModel metaModel, Map<String,Object> keyValues)
      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 from
      keyValues - Map from key property name to its value
      Returns:
      The formatted key string
      Since:
      7.7