Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    com.isomorphic.criteria.AdvancedCriteria.decodeClientCriteria issue with ranges

    v11.1p_2021-06-29/Pro Deployment (built 2021-06-29)

    Following on from my previous question about serializing FilterBuilder criteria. Can you confirm if the following server-side API is meant to correctly decode all client-generated JSON?
    https://www.smartclient.com/smartgwt...a.lang.String-

    Such that the following is expected to work?

    Code:
    FilterBuilder fb = new FilterBuilder();
    String json = fb.getCriteria().asString();
    
    // Send json String to server
    
    com.isomorphic.criteria.AdvancedCriteria ac = com.isomorphic.criteria.AdvanceCriteria.decodeClientCriteria(json);
    It appears to work for most criteria we've tried to-date, but I've found a valid criteria that I can generate via the client, that the server-side AdvanceCriteria class appears to throw an error for and wanted to check if it was bad usage on our part, or a bug.

    Working examples

    Code:
    { \"_constructor\":\"AdvancedCriteria\", \"operator\":\"and\", \"criteria\":[ { \"fieldName\":\"theDate\", \"operator\":\"equals\", \"value\":isc.DateUtil.createLogicalDate(2021, 7, 31) } ] }

    Code:
    { \"_constructor\":\"AdvancedCriteria\", \"operator\":\"and\", \"criteria\":[ { \"fieldName\":\"theDate\", \"operator\":\"equals\", \"value\":{ \"_constructor\":\"RelativeDate\", \"value\":\"$today\" } } ] }

    Broken example - uses a range

    Code:
    { \"_constructor\":\"AdvancedCriteria\", \"operator\":\"and\", \"criteria\":[ { \"operator\":\"iBetweenInclusive\", \"fieldName\":\"theDate\", \"start\":{ \"_constructor\":\"RelativeDate\", \"value\":\"$today\", \"rangePosition\":\"start\" }, \"end\":isc.DateUtil.createLogicalDate(2021, 7, 31) } ] }
    generates error

    ERROR RangeOperator - Unknown class for range comparison class org.apache.commons.collections4.map.LinkedMap

    #2
    Apologies for the delay. Yes, these server-side API should decode any client-generated criteria, including range operator containing criteria. This is a bug and it is fixed in the latest nightly builds.

    Comment

    Working...
    X