Uploaded image for project: 'Directory Studio'
  1. Directory Studio
  2. DIRSTUDIO-293

Values of attributes of the syntax 'Generalized Time' must have the g-time-zone 'Z' and minutes and seconds set to be interpreted and shown as a date instead of the raw value

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.1, 1.1.0
    • Fix Version/s: 1.3.0
    • Component/s: studio-ldapbrowser
    • Labels:
      None
    • Environment:

      Description

      1.) Create some entry in your directory containing an attribute of the syntax 'Generalized Time'
      2.) Set that to a value containing the 'g-time-zone' 'Z' and vlues for 'minute' and 'second', eg '20080309234300Z'
      3.) When viewing the entry in the LDAP browser this value will be interpreted as a date and shown as '09.03.2008 23:45 CET (..'
      4.) Now remove the 'second' or replace the 'g-time-zone' with eg '+02'
      5.) When viewing the entry in the LDAP browser after changing it according to (4.) only the raw value for the 'Generalized Time' will be shown.

      According to RFC4517 ยง3.3.13, the syntax 'Generalized Time' only requires values for 'century', 'year', 'month', 'day' and 'hour' plus the 'g-time-zome' which can be 'Z' or a 'g-differential' ((+/-)hour[minute]) representing a local time zone, so the LDAP browser should be able to interpret those values.

        Activity

        Hide
        seelmann Stefan Seelmann added a comment -

        Fixed in trunk:
        http://svn.apache.org/viewvc?rev=686730&view=rev

        Now we use the new GeneralizedTime class from shared-ldap to convert generalized time syntax to an java.util.Date.

        Show
        seelmann Stefan Seelmann added a comment - Fixed in trunk: http://svn.apache.org/viewvc?rev=686730&view=rev Now we use the new GeneralizedTime class from shared-ldap to convert generalized time syntax to an java.util.Date.
        Hide
        elecharny Emmanuel Lecharny added a comment -

        I had the exact same idea, but sadly it's just a Date -> String converter. Not enough, but can be extended easily.

        Show
        elecharny Emmanuel Lecharny added a comment - I had the exact same idea, but sadly it's just a Date -> String converter. Not enough, but can be extended easily.
        Hide
        akarasulu Alex Karasulu added a comment -

        I think I have something that does this in shared-ldap. Take a look at this:

        http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DateUtils.java?view=markup

        Might not be exactly what you like.

        Show
        akarasulu Alex Karasulu added a comment - I think I have something that does this in shared-ldap. Take a look at this: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DateUtils.java?view=markup Might not be exactly what you like.
        Hide
        seelmann Stefan Seelmann added a comment -

        Postpone to 1.3.0. We have to create a converter between LDAP timestamp format and Java Date/Calendar format.

        Show
        seelmann Stefan Seelmann added a comment - Postpone to 1.3.0. We have to create a converter between LDAP timestamp format and Java Date/Calendar format.
        Hide
        elecharny Emmanuel Lecharny added a comment -

        We don't have converter for Generalized Time ... We don't even have a comparator for it ! And the associated normalizer just consider it as a String...

        It has to be extended !

        Show
        elecharny Emmanuel Lecharny added a comment - We don't have converter for Generalized Time ... We don't even have a comparator for it ! And the associated normalizer just consider it as a String... It has to be extended !
        Hide
        seelmann Stefan Seelmann added a comment -

        I checked RFC4517, the 'Generalized Time" syntax is a much more complex than expected. The current implementation expects the 'second' field, for the g-time-zone it also expects the 'minute' field. We have to change the convertion from 'Generalized Time' syntax to a java.util.Date object.

        Let's postpone this to 1.2.0. There will be too much changes, I want to avoid the impact of the change to the 1.1.0 release.

        @Emmanuel:
        Do we have a converter from RFC4517 'Generalized Time' syntax to java.util.Date in shared-ldap?

        Show
        seelmann Stefan Seelmann added a comment - I checked RFC4517, the 'Generalized Time" syntax is a much more complex than expected. The current implementation expects the 'second' field, for the g-time-zone it also expects the 'minute' field. We have to change the convertion from 'Generalized Time' syntax to a java.util.Date object. Let's postpone this to 1.2.0. There will be too much changes, I want to avoid the impact of the change to the 1.1.0 release. @Emmanuel: Do we have a converter from RFC4517 'Generalized Time' syntax to java.util.Date in shared-ldap?

          People

          • Assignee:
            seelmann Stefan Seelmann
            Reporter:
            nirkus Linus van Geuns
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development