Package com.google.gdata.client.calendar

Examples of com.google.gdata.client.calendar.CalendarQuery


   
    ArrayList<Meeting> aMeetings = new ArrayList<Meeting>();
   
    URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/private/full");
 
    CalendarQuery myQuery = new CalendarQuery(feedUrl);
    myQuery.setMinimumStartTime(new DateTime(dtFrom));
    myQuery.setMaximumStartTime(new DateTime(dtTo));

  CalendarEventFeed oFeed = oCalSrv.query(myQuery, CalendarEventFeed.class);   

  ResultSet oRSet;
    PreparedStatement oStmm = oConn.prepareStatement("SELECT "+DB.gu_meeting+" FROM "+DB.k_meetings+" WHERE "+DB.gu_workarea+"=? AND "+DB.id_icalendar+"=?", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
View Full Code Here


      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))) {
View Full Code Here

  if (!oMeet.isNull(DB.id_icalendar)) {
      URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/private/full");
    URL postUrl = new URL("https://www.google.com/calendar/feeds/"+sEMail+"/private/full");

      CalendarQuery myQuery = new CalendarQuery(feedUrl);

    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) {
        myQuery.setMinimumStartTime(new DateTime(oMeet.getDate(DB.dt_start)));
        myQuery.setMaximumStartTime(new DateTime(oMeet.getDate(DB.dt_end)));
      if (DebugFile.trace) DebugFile.writeln("CalendarQuery.query("+feedUrl.toString()+","+oMeet.getDateTime24(DB.dt_start)+","+oMeet.getDateTime24(DB.dt_end)+", without time zone)");
      } 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);
        myQuery.setMinimumStartTime(new DateTime(oMeet.getDate(DB.dt_start),oTmz));
        myQuery.setMaximumStartTime(new DateTime(oMeet.getDate(DB.dt_end),oTmz));
      if (DebugFile.trace) DebugFile.writeln("CalendarQuery.query("+feedUrl.toString()+","+oMeet.getDateTime24(DB.dt_start)+","+oMeet.getDateTime24(DB.dt_end)+", GMT "+oTmz.getID()+")");
      }

    CalendarEventFeed oFeed = oCalSrv.query(myQuery, CalendarEventFeed.class);   
    for (int i = 0; i < oFeed.getEntries().size(); i++) {
View Full Code Here

    return null;
  }

  public CalendarEventFeed getEventsRangeFeed(Date startDate, Date endDate) throws IOException, ServiceException {
    SimpleDateFormat logFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    CalendarQuery query = new CalendarQuery(calendarFeedUri);
    query.setMinimumStartTime(DateTime.parseDateTime(logFormatter.format(startDate)));
    query.setMaximumStartTime(DateTime.parseDateTime(logFormatter.format(endDate)));
    return service.query(query, CalendarEventFeed.class);
  }
View Full Code Here

     * @throws IOException If error retrieving data
     * @throws ServiceException If error retrieving data
     */
    private CalendarEventEntry nextEvent(String userEmail) throws IOException, ServiceException {
        URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/private/full");
        CalendarQuery query = new CalendarQuery(feedUrl);
        query.setMinimumStartTime(DateTime.now());
        query.setMaxResults(1);
        query.addCustomParameter(new Query.CustomParameter("orderby", "starttime"));
        query.addCustomParameter(new Query.CustomParameter("sortorder","a"));
        query.addCustomParameter(new Query.CustomParameter("singleevents","true"));
        query.addCustomParameter(new Query.CustomParameter("xoauth_requestor_id", userEmail));

        CalendarEventFeed results = calendarService.query(query, CalendarEventFeed.class);
        if (!results.getEntries().isEmpty()) {
            return results.getEntries().get(0);
        } else {
View Full Code Here

     * @throws IOException If error retrieving data
     * @throws ServiceException If error retrieving data
     */
    private CalendarEventEntry nextEvent(UserInfo user) throws IOException, ServiceException {
        URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/private/full");
        CalendarQuery query = new CalendarQuery(feedUrl);
        query.setMinimumStartTime(DateTime.now());
        query.setMaxResults(1);
        query.addCustomParameter(new Query.CustomParameter("orderby", "starttime"));
        query.addCustomParameter(new Query.CustomParameter("sortorder","a"));
        query.addCustomParameter(new Query.CustomParameter("singleevents","true"));
        query.addCustomParameter(new Query.CustomParameter("xoauth_requestor_id", user.getEmail()));

        CalendarEventFeed results = calendarService.query(query, CalendarEventFeed.class);
        if (!results.getEntries().isEmpty()) {
            return results.getEntries().get(0);
        } else {
View Full Code Here

    String eventsFeedUrl = CALENDAR_FEEDS_PREFIX
        + uname + "/private/composite";
    String fields = "entry(@gd:etag,id,title,gd:who[@email='" + uname + "'])";

    CalendarQuery partialQuery = new CalendarQuery(new URL(eventsFeedUrl));
    partialQuery.setFields(fields);
    DateTime startTime = DateTime.now();
    partialQuery.setMinimumStartTime(startTime);
    partialQuery.setMaximumStartTime(
        new DateTime(startTime.getValue() + 604800000, startTime.getTzShift()));

    CalendarEventFeed events = service.query(
        partialQuery, CalendarEventFeed.class);
    for (CalendarEventEntry event : events.getEntries()) {
View Full Code Here

   * @throws IOException Error communicating with the server.
   */
  private static void dateRangeQuery(CalendarService service,
      DateTime startTime, DateTime endTime) throws ServiceException,
      IOException {
    CalendarQuery myQuery = new CalendarQuery(eventFeedUrl);
    myQuery.setMinimumStartTime(startTime);
    myQuery.setMaximumStartTime(endTime);

    // Send the request and receive the response:
    CalendarEventFeed resultFeed = service.query(myQuery,
        CalendarEventFeed.class);

View Full Code Here

            CalendarService service = new CalendarService(
                "Dashboard");
            service.setUserCredentials(username, password);

            CalendarQuery calendarQuery = new CalendarQuery(
                new URL(
                    "https://www.google.com/calendar/feeds/default/owncalendars/full"));
            CalendarFeed calendarFeed = service.query(
                calendarQuery, CalendarFeed.class);
            for (CalendarEntry curCalendar : calendarFeed
View Full Code Here

        URL feedUrl = new URL("http://www.google.com/calendar/feeds/"
            + calendarId + "/private/full");

        try {
          CalendarQuery myQuery = new CalendarQuery(feedUrl);
          Calendar cal = Calendar.getInstance();
          myQuery.setMinimumStartTime(dateToGDateTime(cal.getTime()));
          cal.add(Calendar.MONTH, 3);
          myQuery.setMaximumStartTime(dateToGDateTime(cal.getTime()));
          cal.add(Calendar.MONTH, -2);
          myQuery.setMaxResults(100);
          myQuery.setIntegerCustomParameter("max-results", 100);

          // Send the request and receive the response:
          CalendarEventFeed resultFeed = service.query(myQuery,
              CalendarEventFeed.class);
View Full Code Here

TOP

Related Classes of com.google.gdata.client.calendar.CalendarQuery

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.