Package com.google.gdata.data.projecthosting

Examples of com.google.gdata.data.projecthosting.IssuesEntry


    int issueId = -1;

    UserInfo userInfo = util.getUserInfo(author);
    String authSubToken = userInfo.getAuthSubToken();

    IssuesEntry entry = null;

    try {
      projectHostingHelper.login(authSubToken);
      entry = projectHostingHelper.createIssue(project, title, content, tags.iterator(), author);
    } catch (ServiceException e) {
      LOG.log(Level.WARNING, "ProjectHosting newIssue() failed.", e);
    } catch (IOException e) {
      LOG.log(Level.WARNING, "ProjectHosting newIssue() failed.", e);
    } finally {
      if (entry != null) {
        // Save the issue as IssueJdoEntry, to maintain comment counts for syncing.
        issueId = Integer.parseInt(entry.getId().replaceAll(
            "http://code.google.com/feeds/issues/p/" + project + "/issues/full/", ""));
      }
    }
    return issueId;
  }
View Full Code Here


    this.service.setAuthSubToken(authSubToken);
  }

  public IssuesEntry createIssue(String project, String title, String content,
      Iterator<String> labels, String user) throws ServiceException, IOException {
    IssuesEntry entry = new IssuesEntry();
    entry.setTitle(new PlainTextConstruct(title));
    entry.setContent(new HtmlTextConstruct(content));
    entry.setStatus(new Status("New"));
    Owner owner = new Owner();
    owner.setUsername(new Username(user));

    Person author = new Person();
    author.setName(user);
    entry.getAuthors().add(author);

    while (labels.hasNext()) {
      String label = labels.next();
      if (!label.trim().equals("")) {
        entry.addLabel(new Label(label));
      }
    }

    URL postUrl = new URL("http://code.google.com/feeds/issues/p/" + project + "/issues/full");
    return service.insert(postUrl, entry);
View Full Code Here

    }
    return resultFeed;
  }

  public IssuesEntry getIssuesEntry(String project, int issueId) {
    IssuesEntry issuesEntry = null;
    URL feedUrl;
    try {
      feedUrl = new URL("http://code.google.com/feeds/issues/p/" + project + "/issues/full?id="
          + issueId);
      IssuesFeed issuesFeed = service.getFeed(feedUrl, IssuesFeed.class);
View Full Code Here

   * @throws IOException if there is a problem communicating with the server
   * @throws ServiceException if the service is unable to handle the request
   */
  private void run() throws IOException, ServiceException {
    // Create an issue
    IssuesEntry issueInserted = client.insertIssue(makeNewIssue());

    String issueId = client.getIssueId(issueInserted.getId());
    System.out.println("Issue #" + issueId + " created");

    // Add comments and updates to the issue created
    addComment(issueId, makeUpdatingComment());
    addComment(issueId, makePlainComment());
View Full Code Here

    owner.setUsername(new Username(username));

    Cc cc = new Cc();
    cc.setUsername(new Username(username));

    IssuesEntry entry = new IssuesEntry();
    entry.getAuthors().add(author);

    // Uncomment the following line to set the owner along with issue creation.
    // It's intentionally commented out so we can demonstrate setting the owner
    // field using setOwnerUpdate() as shown in makeUpdatingComment() below.
    // entry.setOwner(owner);

    entry.setContent(new HtmlTextConstruct("issue description"));
    entry.setTitle(new PlainTextConstruct("issue summary"));
    entry.setStatus(new Status("New"));
    entry.addLabel(new Label("Priority-High"));
    entry.addLabel(new Label("Milestone-2009"));
    entry.addCc(cc);
    entry.setSendEmail(new SendEmail("False"));

    return entry;
  }
View Full Code Here

    private RepositoryResponse insertIssue(TaskRepository repository, TaskData taskData,
            IProgressMonitor monitor) throws CoreException {

        IGoogleCodeClient client = getClient(repository);

        IssuesEntry entry = new IssuesEntry();
        entry.addLabel(new Label(getPriority(taskData)));
        String summary = getStringValue(taskData, GoogleCodeAttribute.SUMMARY);

        String description = getStringValue(taskData, GoogleCodeAttribute.DESCRIPTION_NEW);
        entry.getAuthors().add(client.getCurrentUser());

        String ownerName = getStringValue(taskData, GoogleCodeAttribute.USER_ASSIGNED);
        if (!StringUtils.isEmpty(ownerName)) {
            Owner owner = new Owner();
            owner.setUsername(new Username(ownerName));
            entry.setOwner(owner);
        }

        entry.setContent(new HtmlTextConstruct(description));
        entry.setTitle(new PlainTextConstruct(summary));
        entry.setStatus(new Status("New"));
        entry.setSendEmail(new SendEmail("False"));

        IssuesEntry created = client.createIssue(entry, monitor);
        String issueId = getIssueId(created);

        return new RepositoryResponse(ResponseKind.TASK_CREATED, issueId);
    }
View Full Code Here

    }

    @Override
    public TaskData getTaskData(TaskRepository taskRepository, String taskId,
            IProgressMonitor monitor) throws CoreException {
        IssuesEntry issue = this.getClient(taskRepository).getEntry(taskId, monitor);
        return this.taskDataHandler.updateTaskData(taskRepository, issue, monitor);
    }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.projecthosting.IssuesEntry

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.