Advance Filter REST API

Dear Cuba Team,

Is there any REST API to do advance filter in Portal Client like in the Gui Filter Component ?

Hi,

no in fact it is not (when you talk about the REST v2 API) in the sense that the client can dynamically configure the filter for every request. This was able with the REST API v1 since you had the ability to use JPQL, which is gone in v2.

As an alternative you can use predefined JPQL queries, that will give you encapsulation and take a little bit of the flexibility.

Bye
Mario

Thanks Mario. I just read cuba doc about jpql & custom query. But that’s not what i m looking for.
I think Cuba should have an ability to dynamically query entity using some criteria, for example Search user with advance criteria :


POST /rest/$User/search HTTP/1.1
Accept: application/json
Content-Type: application/json
{
  "offset": 0,
  "limit": 10,
  "fields": ["username", "email"],
  "sortBy": ["created_at", "modified_at"],
  "data": {
    "criteria": {
      "operator": "or",
      "criteria": [{
        "fieldName": "email",
        "operator": "like",
        "value": "%gmail.com"
      }, {
        "fieldName": "lang",
        "operator": "=",
        "value": "FR"
      }, {
        "fieldName": "age",
        "operator": "between",
        "value": 18,
        "value2": 40
      }, {
        "operator": "and",
        "criteria": [{
          "fieldName": "firstName",
          "operator": "like",
          "value": "j%"
        }, {
          "fieldName": "lastName",
          "operator": "like",
          "value": "s%"
        }]
      }]
    }
  }
}

Hi,

We have such plans, but I can’t say when and how it will be implemented.

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-8727