Package com.google.gdata.client.gtt

Examples of com.google.gdata.client.gtt.DocumentQuery


  private ListDocumentsCommand() {
  }

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

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

    DocumentFeed resultFeed = service.getFeed(query, DocumentFeed.class);
View Full Code Here


    SimpleCommandLineParser parser = new SimpleCommandLineParser(args);

    System.out.println("You asked to list documents....");

    URL feedUrl = FeedUris.getDocumentsFeedUrl();
    DocumentQuery query = new DocumentQuery(feedUrl);

    if (parser.containsKey("onlydeleted")) {
      System.out.println("...that are deleted");
      query.setOnlydeleted(true);
    }

    if (parser.containsKey("onlyhidden")) {
      System.out.println("...that are hidden");
      Query.CategoryFilter filter = new Query.CategoryFilter();
      filter.addCategory(new HiddenCategory());
      query.addCategoryFilter(filter);
    }

    if (parser.containsKey("excludehidden")) {
      System.out.println("...that are not hidden");
      Query.CategoryFilter filter = new Query.CategoryFilter();
      filter.addExcludeCategory(new HiddenCategory());
      query.addCategoryFilter(filter);
    }

    String sharedWithEmail = parser.getValue("sharedwith");
    if (sharedWithEmail != null) {
      System.out.println("...that are shared with " + sharedWithEmail);
      query.setSharedWithEmailId(sharedWithEmail);
    }

    String startIndex = parser.getValue("start-index");
    if (startIndex != null) {
      System.out.println("...that start from position " + startIndex);
      query.setStartIndex(Integer.parseInt(startIndex));
    }

    String maxResults = parser.getValue("max-results");
    if (maxResults != null) {
      System.out.println("...and you don't want more than " + maxResults
          + " results");
      query.setMaxResults(Integer.parseInt(maxResults));
    }

    return query;
  }
View Full Code Here

TOP

Related Classes of com.google.gdata.client.gtt.DocumentQuery

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.