Package com.google.gdata.client

Examples of com.google.gdata.client.Query


        + "/private/full/" + eventId;
    // Selection criteria to fetch only the attendee status of specified user.
    String selectAttendee =
        "@gd:etag,title,gd:who[@email='" + uname + "']";

    Query partialQuery = new Query(new URL(eventEntryUrl));
    partialQuery.setFields(selectAttendee);

    CalendarEventEntry event = service.getEntry(partialQuery.getUrl(),
        CalendarEventEntry.class);
    // The participant list will contain exactly one attendee matching
    // above partial query selection criteria.
    event.getParticipants().get(0).setAttendeeStatus(selection);
View Full Code Here


   * @throws ServiceException If the service is unable to handle the request.
   * @throws IOException Error communicating with the server.
   */
  private static void fullTextQuery(CalendarService service, String query)
      throws ServiceException, IOException {
    Query myQuery = new Query(eventFeedUrl);
    myQuery.setFullTextQuery("Tennis");

    CalendarEventFeed resultFeed = service.query(myQuery,
        CalendarEventFeed.class);

    System.out.println("Events matching " + query + ":");
View Full Code Here

   *
   * @param parameters parameter for contact quest
   */
  private void queryEntries(ContactsExampleParameters parameters)
      throws IOException, ServiceException {
    Query myQuery = new Query(feedUrl);
    if (parameters.getUpdatedMin() != null) {
      DateTime startTime = DateTime.parseDateTime(parameters.getUpdatedMin());
      myQuery.setUpdatedMin(startTime);
    }
    if (parameters.getMaxResults() != null) {
      myQuery.setMaxResults(parameters.getMaxResults().intValue());
    }
    if (parameters.getStartIndex() != null) {
      myQuery.setStartIndex(parameters.getStartIndex());
    }
    if (parameters.isShowDeleted()) {
      myQuery.setStringCustomParameter("showdeleted", "true");
    }
    if (parameters.getRequireAllDeleted() != null) {
      myQuery.setStringCustomParameter("requirealldeleted",
          parameters.getRequireAllDeleted());
    }
    if (parameters.getSortorder() != null) {
      myQuery.setStringCustomParameter("sortorder", parameters.getSortorder());
    }
    if (parameters.getOrderBy() != null) {
      myQuery.setStringCustomParameter("orderby", parameters.getOrderBy());
    }
    if (parameters.getGroup() != null) {
      myQuery.setStringCustomParameter("group", parameters.getGroup());
    }
    try {
      if (parameters.isGroupFeed()) {
        ContactGroupFeed groupFeed = service.query(
            myQuery, ContactGroupFeed.class);
View Full Code Here

      url = buildUrl(URL_DEFAULT + URL_DOCLIST_FEED + URL_CATEGORY_FOLDER);
    } else {
      throw new DocumentListException("invaild category");
    }

    Query qry = new Query(url);

    for (String key : searchParameters.keySet()) {
      qry.setStringCustomParameter(key, searchParameters.get(key));
    }

    return service.query(qry, DocumentListFeed.class);
  }
View Full Code Here

   * Print title, url of user's videos.
   */
  private void printVideos(YouTubeService service)
      throws IOException, ServiceException {

    Query query = new Query(new URL(UPLOADS_URL));
    query.setFields("title,entry(title, media:group/media:player)");
    VideoFeed videoFeed = service.query(query, VideoFeed.class);

    output.println(videoFeed.getTitle() + ":");
    int count = 1;
    for (VideoEntry entry : videoFeed.getEntries()) {
View Full Code Here

    String videoID = readVideoID();
    URL entryUrl = new URL(UPLOADS_URL + "/" + videoID);

    // Select fields to update
    String fields = "@gd:etag,media:group/media:keywords";
    Query query = new Query(entryUrl);
    query.setFields(fields);

    // Get representation for the interested fields
    VideoEntry videoEntry = null;
    try {
      videoEntry = service.getEntry(query.getUrl(), VideoEntry.class);
    } catch (ServiceException se) {
      // an invalid video ID was used.
    }
    if (videoEntry == null) {
      output.println("Sorry, the video ID you entered was not valid.\n");
View Full Code Here

  public static void printDateRangeQueryResults(BloggerService myService,
      DateTime startTime, DateTime endTime) throws ServiceException,
      IOException {
    // Create query and submit a request
    URL feedUrl = new URL(feedUri + POSTS_FEED_URI_SUFFIX);
    Query myQuery = new Query(feedUrl);
    myQuery.setUpdatedMin(startTime);
    myQuery.setUpdatedMax(endTime);
    Feed resultFeed = myService.query(myQuery, Feed.class);

    // Print the results
    System.out.println(resultFeed.getTitle().getPlainText() + " posts between "
        + startTime + " and " + endTime);
View Full Code Here

  private ListGlossariesCommand() {
  }

  public void execute(GttService service, String[] args)
      throws IOException, ServiceException {
    Query query = createQueryFromArgs(args);

    System.out.print("Fetching glossaries....");
    System.out.flush();

    GlossaryFeed resultFeed
View Full Code Here

  private Query createQueryFromArgs(String[] args)
      throws IOException {
    SimpleCommandLineParser parser = new SimpleCommandLineParser(args);

    URL feedUrl = FeedUris.getGlossariesFeedUrl();
    Query query = new Query(feedUrl);

    return query;
  }
View Full Code Here

    }
   
   
    @Test
    public void testClientQuery() throws Exception {
        Query myQuery = new Query(new URL("http://www.google.com/calendar/feeds/haibotuscany@gmail.com/private/full"));
        myQuery.setMaxResults(100);
        //myQuery.setUpdatedMin(startTime);
        myQuery.setUpdatedMax(DateTime.now());
       
        //Google Calendar service supports full-text search
        String queryString = "event0";
        myQuery.setFullTextQuery(queryString);
       
        Feed resultFeed = testService.clientQuery(myQuery);       
        //System.out.println("Query result feed title: " + resultFeed.getTitle().getPlainText());   
        //System.out.println("Query result entry number: "+ resultFeed.getEntries().size());
        //assertEquals("gdata binding tuscany test", resultFeed.getTitle().getPlainText());
View Full Code Here

TOP

Related Classes of com.google.gdata.client.Query

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.