Changes to JSON serialization and parsing (as of 2.3)

As of 2.3.x, we have made several changes to how JSON is serialized and parsed.

If you created custom extensions using the MDEXStateManager, MDEXSecurityManager, or QueryFunctions, or have built custom components, you will need to update them.

The changes are:

To reflect these changes, you will need to update your custom QueryFunctions. As a reminder, make sure you load all custom QueryFunctions into the global classloader.

The required changes are:

  1. Remove the string setters for non-string properties. To do this, either:
    • Delete the string overload, or
    • Add @ org.codehaus.jackson.annotate.JsonIgnore to any methods that include both String and the actual datatype.

      For example:

      void setIsShown(boolean shown) { ... }
      void @JsonIgnore setIsShown(String shown) { ... }
  2. Remove all getGetters and getSetters.
  3. For com.endeca.portal.data.functions.QueryFunction.getInstanceMove, move customizations to:
    com.endeca.portal.data.functions.utils.QueryFunctionUtils.fromString/fromJSONObject

    For com.endeca.portal.data.functions.QueryFunction.toJSON, move customizations to:

    com.endeca.portal.data.functions.utils.QueryFunctionUtils.toString/toJSONObject

    Update any custom MDEXStateManagers that relied on these removed QueryFunction interfaces.

  4. Update any customized versions of the MDEXSecurityManager to reflect the change to the serialization and parsing of QueryFunctions.
  5. Instead of scanning the com.endeca.mdex.conversation.Results object's passthrough elements for filters, look in MDEXState/DataSource.getQueryState().