Package com.google.gdata.data.projecthosting

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


          (HtmlTextConstruct) textContent.getContent();
      System.out.println("\tComment\n\t\t" + textConstruct.getHtml());
    }

    if (entry.hasUpdates()) {
      Updates updates = entry.getUpdates();

      if (updates.hasSummary()) {
        System.out.println("\tSummary\n\t\t" + updates.getSummary().getValue());
      }

      if (updates.hasStatus()) {
        System.out.println("\tStatus\n\t\t" + updates.getStatus().getValue());
      }

      if (updates.hasOwnerUpdate()) {
        System.out.println(
            "\tOwner\n\t\t" + updates.getOwnerUpdate().getValue());
      }

      if (updates.getLabels().size() > 0) {
        System.out.println("\tLabel");
        for (Label label : updates.getLabels()) {
          System.out.println("\t\t" + label.getValue());
        }
      }

      if (updates.getCcUpdates().size() > 0) {
        System.out.println("\tCC");
        for (CcUpdate cc : updates.getCcUpdates()) {
          System.out.println("\t\t" + cc.getValue());
        }
      }

      if (updates.getBlockedOnUpdates().size() > 0) {
        System.out.println("\tBlockedOnUpdate");
        for (BlockedOnUpdate blockedOnUpdate : updates.getBlockedOnUpdates()) {
          System.out.println("\t\t" + blockedOnUpdate.getValue());
        }
      }

      if (updates.hasMergedIntoUpdate()) {
        System.out.println(
            "\tMergedIntoUpdate\n\t\t" +
            updates.getMergedIntoUpdate().getValue());
      }
    }
  }
View Full Code Here


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

    // Create issue updates
    Updates updates = new Updates();
    updates.setSummary(new Summary("New issue summary"));
    updates.setStatus(new Status("Accepted"));
    updates.setOwnerUpdate(new OwnerUpdate(username));
    updates.addLabel(new Label("-Priority-High"));
    updates.addLabel(new Label("Priority-Low"));
    updates.addLabel(new Label("-Milestone-2009"));
    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"));
View Full Code Here

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

    // 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."));
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)) {
View Full Code Here

            // initialize with issue creation date in case we don't find any
            // comments
            DateTime closingDate = issueEntry.getPublished();
            for (IssueCommentsEntry comment : comments.getEntries()) {
                Updates updates = comment.getUpdates();
                if (updates != null && issueEntry.getStatus().equals(updates.getStatus())) {
                    closingDate = comment.getPublished();
                }
            }
            setAttributeValue(data, GoogleCodeAttribute.DATE_COMPLETION, closingDate);
        }
View Full Code Here

TOP

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

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.