0 Replies Latest reply on Nov 23, 2016 5:43 PM by oicfar

    iCal4j 2.0.0 problem in Jive 8.0.3

    oicfar

      Hi,

       

      I'm testing some code in Jive.

       

      public void generateCalendar() {
        TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
      
        Calendar calendar = new Calendar();
        calendar.getProperties().add(new ProdId("-//Ben Fortuna//iCal4j 1.0//EN"));
        calendar.getProperties().add(Version.VERSION_2_0);
        calendar.getProperties().add(CalScale.GREGORIAN);
        calendar.getProperties().add(Method.REQUEST);
      
        TimeZone timeZone = registry.getTimeZone("Europe/Berlin");
        VTimeZone vTimeZone = timeZone.getVTimeZone();
        calendar.getComponents().add(vTimeZone);
      
        CalendarOutputter outputter = new CalendarOutputter();
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
         try {
        outputter.output(calendar, bout);
        } catch (IOException ex) {
        ex.printStackTrace();
      
         throw new RuntimeException(ex);
        } catch (ValidationException ve) {
        ve.printStackTrace();
      
         throw new RuntimeException(ve);
        }
      
        System.out.println(bout.toString());
      }
      

       

      This code is working fine in standalone Java application. This

       

      BEGIN:VCALENDAR
      PRODID:-//Ben Fortuna//iCal4j 1.0//EN
      VERSION:2.0
      CALSCALE:GREGORIAN
      METHOD:REQUEST
      BEGIN:VTIMEZONE
      TZID:Europe/Berlin
      TZURL:http://tzurl.org/zoneinfo/Europe/Berlin
      X-LIC-LOCATION:Europe/Berlin
      BEGIN:DAYLIGHT
      TZOFFSETFROM:+0100
      TZOFFSETTO:+0200
      TZNAME:CEST
      DTSTART:19810329T020000
      RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
      END:DAYLIGHT
      BEGIN:STANDARD
      TZOFFSETFROM:+0200
      TZOFFSETTO:+0100
      TZNAME:CET
      DTSTART:19961027T030000
      RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
      END:STANDARD
      BEGIN:STANDARD
      TZOFFSETFROM:+005328
      TZOFFSETTO:+0100
      TZNAME:CET
      DTSTART:18930401T000000
      RDATE:18930401T000000
      END:STANDARD
      BEGIN:DAYLIGHT
      TZOFFSETFROM:+0100
      TZOFFSETTO:+0200
      TZNAME:CEST
      DTSTART:19160430T230000
      RDATE:19160430T230000
      RDATE:19170416T020000
      RDATE:19180415T020000
      RDATE:19400401T020000
      RDATE:19430329T020000
      RDATE:19440403T020000
      RDATE:19450402T020000
      RDATE:19460414T020000
      RDATE:19470406T030000
      RDATE:19480418T020000
      RDATE:19490410T020000
      RDATE:19800406T020000
      END:DAYLIGHT
      BEGIN:STANDARD
      TZOFFSETFROM:+0200
      TZOFFSETTO:+0100
      TZNAME:CET
      DTSTART:19161001T010000
      RDATE:19161001T010000
      RDATE:19170917T030000
      RDATE:19180916T030000
      RDATE:19421102T030000
      RDATE:19431004T030000
      RDATE:19441002T030000
      RDATE:19451118T030000
      RDATE:19461007T030000
      RDATE:19471005T030000
      RDATE:19481003T030000
      RDATE:19491002T030000
      RDATE:19800928T030000
      RDATE:19810927T030000
      RDATE:19820926T030000
      RDATE:19830925T030000
      RDATE:19840930T030000
      RDATE:19850929T030000
      RDATE:19860928T030000
      RDATE:19870927T030000
      RDATE:19880925T030000
      RDATE:19890924T030000
      RDATE:19900930T030000
      RDATE:19910929T030000
      RDATE:19920927T030000
      RDATE:19930926T030000
      RDATE:19940925T030000
      RDATE:19950924T030000
      END:STANDARD
      BEGIN:DAYLIGHT
      TZOFFSETFROM:+0200
      TZOFFSETTO:+0300
      TZNAME:CEMT
      DTSTART:19450524T020000
      RDATE:19450524T020000
      RDATE:19470511T030000
      END:DAYLIGHT
      BEGIN:DAYLIGHT
      TZOFFSETFROM:+0300
      TZOFFSETTO:+0200
      TZNAME:CEST
      DTSTART:19450924T030000
      RDATE:19450924T030000
      RDATE:19470629T030000
      END:DAYLIGHT
      BEGIN:STANDARD
      TZOFFSETFROM:+0100
      TZOFFSETTO:+0100
      TZNAME:CET
      DTSTART:19460101T000000
      RDATE:19460101T000000
      RDATE:19800101T000000
      END:STANDARD
      END:VTIMEZONE
      END:VCALENDAR
      

       

      is the result.

       

      But if I add the code to my plugin it looks so:

       

      BEGIN:VCALENDAR
      PRODID:-//Ben Fortuna//iCal4j 1.0//EN
      VERSION:2.0
      CALSCALE:GREGORIAN
      BEGIN:VTIMEZONE
      TZID:Europe/London
      TZURL:http://tzurl.org/zoneinfo/Europe/London
      X-LIC-LOCATION:Europe/London
      BEGIN:DAYLIGHT
      TZOFFSETFROM:+0000
      TZOFFSETTO:+0100
      TZNAME:BST
      DTSTART:19810329T010000
      RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
      END:DAYLIGHT
      BEGIN:STANDARD
      TZOFFSETFROM:+0100
      TZOFFSETTO:+0000
      TZNAME:GMT
      DTSTART:19961027T020000
      RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
      END:STANDARD
      BEGIN:STANDARD
      TZOFFSETFROM:-000115
      TZOFFSETTO:+0000
      TZNAME:GMT
      DTSTART:18471201T000000
      RDATE:
      END:STANDARD
      BEGIN:DAYLIGHT
      TZOFFSETFROM:+0000
      TZOFFSETTO:+0100
      TZNAME:BST
      DTSTART:19160521T020000
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      END:DAYLIGHT
      BEGIN:STANDARD
      TZOFFSETFROM:+0100
      TZOFFSETTO:+0000
      TZNAME:GMT
      DTSTART:19161001T030000
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      END:STANDARD
      BEGIN:DAYLIGHT
      TZOFFSETFROM:+0100
      TZOFFSETTO:+0200
      TZNAME:BDST
      DTSTART:19410504T020000
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      END:DAYLIGHT
      BEGIN:DAYLIGHT
      TZOFFSETFROM:+0200
      TZOFFSETTO:+0100
      TZNAME:BST
      DTSTART:19410810T030000
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      RDATE:
      END:DAYLIGHT
      BEGIN:STANDARD
      TZOFFSETFROM:+0100
      TZOFFSETTO:+0100
      TZNAME:BST
      DTSTART:19681027T000000
      RDATE:
      END:STANDARD
      BEGIN:STANDARD
      TZOFFSETFROM:+0000
      TZOFFSETTO:+0000
      TZNAME:GMT
      DTSTART:19960101T000000
      RDATE:
      END:STANDARD
      END:VTIMEZONE
      END:VCALENDAR
      

       

      There are a lot of empty RDATE: lines.

       

      Has anyone same problem?

       

      I had the same problem wir iCal4j 1.0.7.

       

       

      Regards,

      Rafal