Package com.google.gdata.client.projecthosting

Examples of com.google.gdata.client.projecthosting.IssuesQuery


   *
   * @throws IOException if there is a problem communicating with the server
   * @throws ServiceException if the service is unable to handle the request
   */
  private void addAndRunQuery() throws IOException, ServiceException {
    IssuesQuery query = new IssuesQuery(client.getIssuesFeedUrl());
    while (true) {
      System.out.println(
          DIVIDER
          + "Set query parameters. Choose [1] when you're done.\n"
          + "[0] Return to the main menu\n"
          + "[1] Done. Query issues now.\n"
          + "[2] Set full-text query\n"
          + "[3] Set published-min\n"
          + "[4] Set published-max\n"
          + "[5] Set updated-min\n"
          + "[6] Set updated-max\n"
          + "[7] Set start-index\n"
          + "[8] Set max-results\n"
          + "[9] Set owner\n"
          + "[10] Set reporter\n"
          + "[11] Set status\n"
          + "[12] Set label\n"
          + "[13] Set canned-query");
      int choice = readInteger("action");
      switch (choice) {
        case 0:
          return;
        case 1:
          IssuesFeed resultFeed = client.queryIssues(query);
          int numResult = resultFeed.getEntries().size();
          System.out.println(
              "Query returned " + numResult + " matching issues.");
          client.printIssues(resultFeed);
          return;
        case 2:
          String textQuery = readString("full-text query");
          query.setFullTextQuery(textQuery);
          break;
        case 3:
          String publishedMin = readString("published-min");
          query.setPublishedMin(DateTime.parseDate(publishedMin));
          break;
        case 4:
          String publishedMax = readString("published-max");
          query.setPublishedMax(DateTime.parseDate(publishedMax));
          break;
        case 5:
          String updatedMin = readString("updated-min");
          query.setUpdatedMin(DateTime.parseDate(updatedMin));
          break;
        case 6:
          String updatedMax = readString("updated-max");
          query.setUpdatedMax(DateTime.parseDate(updatedMax));
          break;
        case 7:
          int startIndex = readInteger("start-index");
          query.setStartIndex(startIndex);
          break;
        case 8:
          int maxResults = readInteger("max-results");
          query.setMaxResults(maxResults);
          break;
        case 9:
          String owner = readString("owner");
          query.setOwner(owner);
          break;
        case 10:
          String reporter = readString("reporter");
          query.setAuthor(reporter);
          break;
        case 11:
          String status = readString("status");
          query.setStatus(status);
          break;
        case 12:
          String label = readString("label");
          query.setLabel(label);
          break;
        case 13:
          String cannedQuery = readString("canned-query");
          query.setCan(cannedQuery);
          break;
        default:
          System.out.println("Invalid choice " + choice);
          break;
      }
View Full Code Here


    }

    public IssuesQuery createNewIssuesQuery() {
        String issuesUrl = this.getIssuesUrl();
        try {
            return new IssuesQuery(new URL(issuesUrl));
        } catch (MalformedURLException e) {
            throw new RuntimeException("invalid url:" + issuesUrl, e);
        }
    }
View Full Code Here

            IGoogleCodeClient client = getClient(repository);
            IssuesFeed issues;
            if (mylynQuery.getAttributes().isEmpty()) {
                issues = client.getAllIssues(monitor);
            } else {
                IssuesQuery googleQuery = client.createNewIssuesQuery();
                QueryUtils.copyAttributes(mylynQuery, googleQuery);
                googleQuery.setMaxResults(Integer.MAX_VALUE);
                issues = client.getQueryIssues(googleQuery, monitor);
            }
            for (IssuesEntry issue : issues.getEntries()) {
                TaskData data = this.taskDataHandler.updateTaskData(repository, issue, monitor);
                collector.accept(data);
View Full Code Here

TOP

Related Classes of com.google.gdata.client.projecthosting.IssuesQuery

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.