Package net.fortuna.ical4j.model

Examples of net.fortuna.ical4j.model.TimeZone


   *
   * @param rule
   * @return date of recurrence end
   */
  public static Date getRecurrenceEndDate(String rule) {
    TimeZone tz = TimeZoneRegistryFactory.getInstance().createRegistry().getTimeZone(java.util.Calendar.getInstance().getTimeZone().getID());
   
    if (rule != null) {
      try {
        Recur recur = new Recur(rule);
        Date dUntil = recur.getUntil();
View Full Code Here


   * @param recurrence
   * @param recurrenceEnd
   * @return rrule
   */
  public static String getRecurrenceRule(String recurrence, Date recurrenceEnd) {
    TimeZone tz = TimeZoneRegistryFactory.getInstance().createRegistry().getTimeZone(java.util.Calendar.getInstance().getTimeZone().getID());
   
    if (recurrence != null) { // recurrence available
      // create recurrence rule
      StringBuilder sb = new StringBuilder();
      sb.append("FREQ=");
View Full Code Here

   
    TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
   
    OmTimeZone omTimeZone = OmTimeZoneDaoImpl.getInstance().getOmTimeZone(jNametimeZone);
   
    TimeZone timeZone = registry.getTimeZone(omTimeZone.getIcal());

    startDate.setTimeZone(timeZone);
    endDate.setTimeZone(timeZone);
   
    DateTime start = new DateTime(startDate.getTime());
    DateTime end = new DateTime(endDate.getTime());
    VEvent meeting = new VEvent(start, end, name);

    log.debug("DateTime start addNewMeeting "+start);
    log.debug("DateTime end addNewMeeting "+end);
   
    // add timezone info..
    VTimeZone tz = timeZone.getVTimeZone();
   
    meeting.getProperties().add(tz.getTimeZoneId());
   
    meeting.getProperties().add(new Description(description));
   
View Full Code Here

     * @return ICal calendar object.
     */
    protected Calendar createTestCalendar() throws ParseException {
     // Create a TimeZone
        TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
        TimeZone timezone = registry.getTimeZone("America/New_York");
        VTimeZone tz = timezone.getVTimeZone();

         // Start Date is on: April 1, 2013, 9:00 am
        java.util.Calendar startDate = new GregorianCalendar();
        startDate.setTimeZone(timezone);
        startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
View Full Code Here

 
  public void simpleInvitionIcalLink() {
    // Create a TimeZone
    TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance()
        .createRegistry();
    TimeZone timezone = registry.getTimeZone("America/Mexico_City");
    VTimeZone tz = timezone.getVTimeZone();

    // Start Date is on: April 1, 2008, 9:00 am
    java.util.Calendar startDate = new GregorianCalendar();
    startDate.setTimeZone(timezone);
    startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
View Full Code Here

      throws Exception {

    TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance()
        .createRegistry();
   
    TimeZone timeZone = registry.getTimeZone(normalTimeZone.getID());

    DateTime start = new DateTime(startDate);
    start.setTimeZone(timeZone);
    DateTime end = new DateTime(endDate);
    end.setTimeZone(timeZone);
   
    VEvent meeting = new VEvent(start, end, name);

    meeting.getProperties().add(new Description(description));
    meeting.getProperties().add(new Sequence(0));
    meeting.getProperties().add(new Location(""));
    meeting.getProperties().add(Transp.OPAQUE);

    // generate unique identifier (if not submitted)
    Uid ui = null;
    if (uid == null || uid.length() < 1) {
      ui = new UidGenerator("uidGen").generateUid();
      log.debug("Generating Meeting UID : " + ui.getValue());
    } else {
      ui = new Uid(uid);
      log.debug("Using Meeting UID : " + ui.getValue());
    }

    meeting.getProperties().add(ui);

    for (int i = 0; i < attendees.size(); i++) {
      HashMap<String, String> oneAtt = attendees.get(i);

      Attendee uno = new Attendee(URI.create(oneAtt.get("uri")));

      String chair = oneAtt.get("chair");

      if (chair.equals("0"))
        uno.getParameters().add(Role.REQ_PARTICIPANT);
      else
        uno.getParameters().add(Role.CHAIR);

      uno.getParameters().add(new Cn(oneAtt.get("cn")));
      meeting.getProperties().add(uno);
    }

    Organizer orger = new Organizer(URI.create(organizer.get("uri")));
    orger.getParameters().add(new Cn(organizer.get("cn")));

    meeting.getProperties().add(orger);

    icsCalendar.getComponents().add(timeZone.getVTimeZone());
    icsCalendar.getComponents().add(meeting);

    return ui.getValue();

  }
View Full Code Here

 
  public void simpleInvitionIcalLink() {
    // Create a TimeZone
    TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance()
        .createRegistry();
    TimeZone timezone = registry.getTimeZone("America/Mexico_City");
    VTimeZone tz = timezone.getVTimeZone();

    // Start Date is on: April 1, 2008, 9:00 am
    java.util.Calendar startDate = new GregorianCalendar();
    startDate.setTimeZone(timezone);
    startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
View Full Code Here

      throws Exception {

    TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance()
        .createRegistry();
   
    TimeZone timeZone = registry.getTimeZone(normalTimeZone.getID());

    DateTime start = new DateTime(startDate);
    start.setTimeZone(timeZone);
    DateTime end = new DateTime(endDate);
    end.setTimeZone(timeZone);
   
    VEvent meeting = new VEvent(start, end, name);

    meeting.getProperties().add(new Description(description));
    meeting.getProperties().add(new Sequence(0));
    meeting.getProperties().add(new Location(""));
    meeting.getProperties().add(Transp.OPAQUE);

    // generate unique identifier (if not submitted)
    Uid ui = null;
    if (uid == null || uid.length() < 1) {
      ui = new UidGenerator("uidGen").generateUid();
      log.debug("Generating Meeting UID : " + ui.getValue());
    } else {
      ui = new Uid(uid);
      log.debug("Using Meeting UID : " + ui.getValue());
    }

    meeting.getProperties().add(ui);

    for (int i = 0; i < attendees.size(); i++) {
      HashMap<String, String> oneAtt = attendees.get(i);

      Attendee uno = new Attendee(URI.create(oneAtt.get("uri")));

      String chair = oneAtt.get("chair");

      if (chair.equals("0"))
        uno.getParameters().add(Role.REQ_PARTICIPANT);
      else
        uno.getParameters().add(Role.CHAIR);

      uno.getParameters().add(new Cn(oneAtt.get("cn")));
      meeting.getProperties().add(uno);
    }

    Organizer orger = new Organizer(URI.create(organizer.get("uri")));
    orger.getParameters().add(new Cn(organizer.get("cn")));

    meeting.getProperties().add(orger);

    icsCalendar.getComponents().add(timeZone.getVTimeZone());
    icsCalendar.getComponents().add(meeting);

    return ui.getValue();

  }
View Full Code Here

     * @return ICal calendar object.
     */
    protected Calendar createTestCalendar() throws ParseException {
     // Create a TimeZone
        TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
        TimeZone timezone = registry.getTimeZone("America/New_York");
        VTimeZone tz = timezone.getVTimeZone();

         // Start Date is on: April 1, 2013, 9:00 am
        java.util.Calendar startDate = new GregorianCalendar();
        startDate.setTimeZone(timezone);
        startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
View Full Code Here

      HashMap<String, String> organizer, String uid, java.util.TimeZone normalTimeZone)
      throws Exception {

    TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
   
    TimeZone timeZone = registry.getTimeZone(normalTimeZone.getID());

    DateTime start = new DateTime(startDate);
    start.setTimeZone(timeZone);
    DateTime end = new DateTime(endDate);
    end.setTimeZone(timeZone);
   
    VEvent meeting = new VEvent(start, end, name);

    meeting.getProperties().add(new Description(description));
    meeting.getProperties().add(new Sequence(0));
    meeting.getProperties().add(new Location(""));
    meeting.getProperties().add(Transp.OPAQUE);

    // generate unique identifier (if not submitted)
    Uid ui = null;
    if (uid == null || uid.length() < 1) {
      ui = new UidGenerator("uidGen").generateUid();
      log.debug("Generating Meeting UID : " + ui.getValue());
    } else {
      ui = new Uid(uid);
      log.debug("Using Meeting UID : " + ui.getValue());
    }

    meeting.getProperties().add(ui);

    for (int i = 0; i < attendees.size(); i++) {
      HashMap<String, String> oneAtt = attendees.get(i);

      Attendee uno = new Attendee(URI.create(oneAtt.get("uri")));

      String chair = oneAtt.get("chair");

      if (chair.equals("0"))
        uno.getParameters().add(Role.REQ_PARTICIPANT);
      else
        uno.getParameters().add(Role.CHAIR);

      uno.getParameters().add(new Cn(oneAtt.get("cn")));
      meeting.getProperties().add(uno);
    }

    Organizer orger = new Organizer(URI.create(organizer.get("uri")));
    orger.getParameters().add(new Cn(organizer.get("cn")));

    meeting.getProperties().add(orger);

    icsCalendar.getComponents().add(timeZone.getVTimeZone());
    icsCalendar.getComponents().add(meeting);

    return ui.getValue();

  }
View Full Code Here

TOP

Related Classes of net.fortuna.ical4j.model.TimeZone

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.