Package com.google.gdata.data.extensions

Examples of com.google.gdata.data.extensions.When


          c = CalendarToolbox.getEndAsCalendar(program);

          DateTime endTime = new DateTime(c.getTime(), c.getTimeZone());

          When eventTimes = new When();

          eventTimes.setStartTime(startTime);
          eventTimes.setEndTime(endTime);

          myEntry.addTime(eventTimes);

          if (settings.getExporterProperty(REMINDER, false)) {
            int reminderMinutes = 0;
View Full Code Here


    oEvnt = new CalendarEventEntry();
    oEvnt.setIcalUID(oMeet.getString(DB.gu_meeting)+"@hipergate.org");
    oEvnt.setTitle(new PlainTextConstruct(oMeet.getStringNull(DB.tx_meeting,"")));
      oEvnt.setContent(new PlainTextConstruct(oMeet.getStringNull(DB.de_meeting,"")));
   
    When oTimes = new When();
    String sTimeZone = DBCommand.queryStr(oConn, "SELECT "+DB.tx_timezone+" FROM "+DB.k_fellows+" WHERE "+DB.gu_fellow+"='"+oMeet.getString(DB.gu_fellow)+"'");
      if (null==sTimeZone) {
        oTimes.setStartTime(new DateTime(oMeet.getDate(DB.dt_start)));
      oTimes.setEndTime(new DateTime(oMeet.getDate(DB.dt_end)));
      } else {
        int lSign = sTimeZone.charAt(0)=='+' ? 1 : -1;
        String[] aTimeZone = Gadgets.split2(sTimeZone.substring(1),':');
        SimpleTimeZone oTmz = new SimpleTimeZone(lSign*(Integer.parseInt(aTimeZone[0])*3600000+Integer.parseInt(aTimeZone[1])*60000), sTimeZone);
        oTimes.setStartTime(new DateTime(oMeet.getDate(DB.dt_start),oTmz));
      oTimes.setEndTime(new DateTime(oMeet.getDate(DB.dt_end),oTmz));
      }
    oEvnt.addTime(oTimes);
    DBSubset oFlws = oMeet.getFellows(oConn);
    for (int f=0; f<oFlws.getRowCount(); f++) {
      if (!oFlws.isNull(4,f)) {
        EventWho oEwho = new EventWho();
        oEwho.setEmail(oFlws.getString(4,f));
        oEvnt.addParticipant(oEwho);
      } // fi
    } // next
    oEvnt = oCalSrv.insert(postUrl, oEvnt);

    if (!oMeet.isNull(DB.bo_private))
      oEvnt.getVisibility().setValue(oMeet.getShort(DB.bo_private)==0 ? Visibility.PUBLIC_VALUE : Visibility.PRIVATE_VALUE);     
   
    DBCommand.executeUpdate(oConn, "UPDATE "+DB.k_meetings+" SET "+DB.id_icalendar+"='"+oMeet.getString(DB.gu_meeting)+"@hipergate.org"+"' WHERE "+DB.gu_meeting+"='"+oMeet.getString(DB.gu_meeting)+"'");
  } else {
      URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/private/full");
      CalendarQuery myQuery = new CalendarQuery(feedUrl);
      myQuery.setMinimumStartTime(new DateTime(oMeet.getDate(DB.dt_start)));
      myQuery.setMaximumStartTime(new DateTime(oMeet.getDate(DB.dt_end)));

    CalendarEventFeed oFeed = oCalSrv.query(myQuery, CalendarEventFeed.class);   
    for (int i = 0; i < oFeed.getEntries().size(); i++) {
        oEvnt = oFeed.getEntries().get(i);
      if (oEvnt.getIcalUID().equals(oMeet.getString(DB.id_icalendar))) {
        oEvnt.setTitle(new PlainTextConstruct(oMeet.getStringNull(DB.tx_meeting,"")));
          oEvnt.setContent(new PlainTextConstruct(oMeet.getStringNull(DB.de_meeting,"")));
        if (oMeet.isNull(DB.bo_private))
          oEvnt.getVisibility().setValue(Visibility.DEFAULT_VALUE);
        else
          oEvnt.getVisibility().setValue(oMeet.getShort(DB.bo_private)==0 ? Visibility.PUBLIC_VALUE : Visibility.PRIVATE_VALUE);     
        When oTimes = new When();
          oTimes.setStartTime(new DateTime(oMeet.getDate(DB.dt_start)));
        oTimes.setEndTime(new DateTime(oMeet.getDate(DB.dt_end)));
        oEvnt.addTime(oTimes);
        DBSubset oFlws = oMeet.getFellows(oConn);
        for (int f=0; f<oFlws.getRowCount(); f++) {
          if (!oFlws.isNull(4,f)) {
            EventWho oEwho = new EventWho();
View Full Code Here

        reminder.setMethod(Reminder.Method.SMS);
        entry.getReminder().add(reminder);
    }

    private static void setupWhen(CalendarEventEntry entry) {
        When when = new When();

        Calendar startTime = new GregorianCalendar();
        startTime.add(Calendar.MINUTE, 2);

        Calendar endTime = new GregorianCalendar();
        endTime.add(Calendar.MINUTE, 3);

        when.setStartTime(new DateTime(startTime.getTime(), TimeZone.getDefault()));
        when.setEndTime(new DateTime(endTime.getTime(), TimeZone.getDefault()));

        entry.addTime(when);
    }
View Full Code Here

                    }
                  }
                  eventEntry.setContent(new PlainTextConstruct(content));
                  DateTime startTime = DateTime.parseDateTime(calFormatter.format(ad.getStartTime()));
                  DateTime endTime = DateTime.parseDateTime(calFormatter.format(ad.getEndTime()));
                  When eventTimes = new When();
                  eventTimes.setStartTime(startTime);
                  eventTimes.setEndTime(endTime);
                  eventEntry.addTime(eventTimes);
                  entriesToInsert.add(eventEntry);
                  log.info("Added event: " + title + "\tFrom: " + startTime + "\tto: " + endTime);
                }
              }
View Full Code Here

    }

    // set data on event
    entry.setTitle(new PlainTextConstruct(event.getTitle()));
    entry.setContent(new PlainTextConstruct(event.getDescription()));
    When when = new When();
    DateTime startDateTime = new DateTime(event.getStartDate());
    startDateTime.setDateOnly(true);

    // we must add 1 day to the event as the end-date is exclusive
    Calendar endDateCal = new GregorianCalendar();
    endDateCal.setTime(event.getEndDate());
    endDateCal.add(Calendar.DATE, 1);
    DateTime endDateTime = new DateTime(endDateCal.getTime());
    endDateTime.setDateOnly(true);

    when.setStartTime(startDateTime);
    when.setEndTime(endDateTime);
    entry.getTimes().add(when);
    if (event.getCalendarUrl() != null) {
      // updating event
      entry.update()
    } else {
View Full Code Here

      return;
    }
    extProfile.declare(Event.class, new ExtensionDescription(When.class,
        new XmlNamespace("gd", "http://schemas.google.com/g/2005"), "when",
        true, false, false));
    new When().declareExtensions(extProfile);
  }
View Full Code Here

      calendar.add(Calendar.MINUTE, 30);
      DateTime endTime = new DateTime(calendar.getTime(),
          TimeZone.getDefault());

      When eventTimes = new When();
      eventTimes.setStartTime(startTime);
      eventTimes.setEndTime(endTime);
      myEntry.addTime(eventTimes);
    } else {
      Recurrence recur = new Recurrence();
      recur.setValue(recurData);
      myEntry.setRecurrence(recur);
View Full Code Here

      DateTime nowPlusOffset = new DateTime().plusDays(offset);
     
      com.google.gdata.data.DateTime time =
        com.google.gdata.data.DateTime.parseDateTime(nowPlusOffset.toString());
      When eventTimes = new When();
        eventTimes.setStartTime(time);
        eventTimes.setEndTime(time);
      myEntry.addTime(eventTimes);
     
      entries.offer(myEntry);
     
      logger.trace("added new entry '{}' for item '{}' to upload queue", myEntry.getTitle().getPlainText(), item.getName());
View Full Code Here

TOP

Related Classes of com.google.gdata.data.extensions.When

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.