Uploaded image for project: 'Syncope'
  1. Syncope
  2. SYNCOPE-1321

Search doesn't work for date attributes with conversion pattern with time zone

    XMLWordPrintableJSON

Details

    Description

      1.) I have date type PlainSchemaTO configured with conversion pattern 

      org.apache.cxf.jaxrs.ext.search.SearchUtils.TIMESTAMP_WITH_TIMEZONE_Z = "yyyy-MM-dd\'T\'HH:mm:ssZ"

      2.) For instance, I built a new query using

      org.apache.cxf.jaxrs.ext.search.client.FiqlSearchConditionBuilder with an appropriate settings for date format.

      3.) Query is built successfully, for instance

      "date_att=lt=2018-06-12T15:21:00+0300"

      but after its value being processed by URLDecoder in 

      org.apache.syncope.core.persistence.api.search.SearchCondVisitor, see line 79:

      value = SearchUtils.toSqlWildcardString(URLDecoder.decode(sc.getStatement().getValue().toString(), StandardCharsets.UTF_8.name()), false).replaceAll("\\\\_", "_");

      plus sign ('+') is replacing with space (' ') which leads to incorrect query processing in further Syncope code.

      I assume URLDecoder.decode should be removed, it should be already done by a servlet container.

      Currently, I'm using a quite ugly fix by double encoding date schema value on a client side and dealing with date values as string ones...

      Kind Regards,

      Alexey 

      Attachments

        1. after.PNG
          87 kB
          Alexey
        2. before.PNG
          63 kB
          Alexey

        Activity

          People

            ilgrosso Francesco Chicchiriccò
            moonworm Alexey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: