Package com.google.gdata.data.projecthosting

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


    if (issueJdoEntry != null) {
      String content = blip.getContent();

      // Login using the authsub token.
      projectHostingHelper.login(authSubToken);
      IssueCommentsEntry commentEntry = projectHostingHelper.createComment(issueJdoEntry
          .getProjectName(), issueJdoEntry.getIssueId(), user, content);
      issueJdoEntry.setLocalCommentsCount(issueJdoEntry.getLocalCommentsCount() + 1);
      util.persistJdo(issueJdoEntry);

      int commentId = projectHostingHelper.getCommentEntryId(commentEntry.getId(), issueJdoEntry
          .getProjectName(), issueJdoEntry.getIssueId() + "");
    }
  }
View Full Code Here


    }
    return issuesEntry;
  }

  public IssueCommentsEntry createComment(String project, int issueId, String name, String content) {
    IssueCommentsEntry entry = new IssueCommentsEntry();
    entry.setContent(new HtmlTextConstruct(content));

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

    URL postUrl;
    try {
      postUrl = new URL("http://code.google.com/feeds/issues/p/" + project + "/issues/" + issueId
          + "/comments/full");
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 addComment(String issueId, IssueCommentsEntry issueComment)
      throws IOException, ServiceException {
    IssueCommentsEntry commentInserted = client.insertComment(
        issueId, issueComment);
    String commentId = client.getCommentId(commentInserted.getId());
    System.out.println("Comment #" + commentId + " added in issue #" + issueId);
  }
View Full Code Here

    updates.addLabel(new Label("Milestone-2010"));
    updates.addLabel(new Label("Type-Enhancement"));
    updates.addCcUpdate(new CcUpdate("-" + username));

    // Create issue comment entry
    IssueCommentsEntry entry = new IssueCommentsEntry();
    entry.getAuthors().add(author);
    entry.setContent(new HtmlTextConstruct("some comment"));
    entry.setUpdates(updates);
    entry.setSendEmail(new SendEmail("False"));

    return entry;
  }
View Full Code Here

  protected IssueCommentsEntry makePlainComment() {
    Person author = new Person();
    author.setName(username);

    // Create issue comment entry
    IssueCommentsEntry entry = new IssueCommentsEntry();
    entry.getAuthors().add(author);
    entry.setContent(new HtmlTextConstruct("Some comment"));
    entry.setSendEmail(new SendEmail("False"));

    return entry;
  }
View Full Code Here

    // Set the Status as Fixed
    Updates updates = new Updates();
    updates.setStatus(new Status("Fixed"));

    // Create issue comment entry
    IssueCommentsEntry entry = new IssueCommentsEntry();
    entry.getAuthors().add(author);
    entry.setContent(new HtmlTextConstruct("This was fixed last week."));
    entry.setUpdates(updates);
    entry.setSendEmail(new SendEmail("False"));

    return entry;
  }
View Full Code Here

    private RepositoryResponse updateIssue(TaskRepository repository, TaskData taskData,
            Set<TaskAttribute> oldAttributes, IProgressMonitor monitor) throws CoreException {

        IGoogleCodeClient client = getClient(repository);
        IssueCommentsEntry entry = new IssueCommentsEntry();
        Updates updates = new Updates();

        String summary = getStringValue(taskData, GoogleCodeAttribute.SUMMARY);
        updates.setSummary(new Summary(summary));

        String issueId = getIssueId(taskData);

        String comment = getNewComment(taskData);

        String currentPriority = getPriority(taskData);
        String oldPriority = getOldPriority(oldAttributes);
        if (!currentPriority.equals(oldPriority)) {
            if (oldPriority != null) {
                updates.addLabel(new Label('-' + oldPriority));
            }
            updates.addLabel(new Label(currentPriority));
        }

        String ownerName = getStringValue(taskData, GoogleCodeAttribute.USER_ASSIGNED);
        String oldOwner = getOldOwner(oldAttributes);
        if (!(ObjectUtils.equals(ownerName, oldOwner) || (StringUtils.isEmpty(ownerName) && StringUtils
                .isEmpty(oldOwner)))) {
            OwnerUpdate ownerUpdate;
            if (!StringUtils.isEmpty(ownerName)) {
                ownerUpdate = new OwnerUpdate(ownerName);
            } else {
                // remove the owner
                // FIXME broken, doesn't work, null doesn't work as well
                ownerUpdate = new OwnerUpdate(StringUtils.EMPTY);
            }
            updates.setOwnerUpdate(ownerUpdate);
        }

        updates.setStatus(new Status(getStringValue(taskData, GoogleCodeAttribute.STATUS)));

        computeBlockedOnDifference(taskData, oldAttributes, updates);

        entry.getAuthors().add(client.getCurrentUser());
        if (!StringUtils.isEmpty(comment)) {
            entry.setContent(new HtmlTextConstruct(comment));
        }
        entry.setSendEmail(new SendEmail("False"));
        entry.setUpdates(updates);
        client.updateIssue(issueId, entry, monitor);
        return new RepositoryResponse(ResponseKind.TASK_UPDATED, issueId);
    }
View Full Code Here

TOP

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

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.