Package net.sf.collabreview.core.users

Examples of net.sf.collabreview.core.users.Author


    timeFrame = Integer.parseInt(config.getValue("seconds", "300")) * 1000;
    message = config.getValue("message", "Micro edits detected");
    reviewerName = config.getValue("author", getProposedName());
    logger.debug("Review author name: " + reviewerName);
    AuthorManager authorManager = agentManager.getCollabReview().getAuthorManager();
    Author author = authorManager.getAuthor(reviewerName);
    if (author == null) {
      logger.info("Registering a new author for the MicroEditCastigator: " + reviewerName);
      author = authorManager.createAuthor(reviewerName);
      authorManager.storeAuthor(author);
    }
View Full Code Here


    logger.info("Hibernate Author Manager created");
  }

  public synchronized Author getAuthor(String name) {
    assert name != null;
    Author a = (Author) HibernateUtil.getCurrentSession().get(Author.class, name);
    if (a != null && a.isAdministrator()) {
      hasAdministrator = true;
    }
    return a;
  }
View Full Code Here

  }

  @SuppressWarnings({"deprecation"})
  @Override
  public Author createAuthor(String name) {
    return new Author(name);
  }
View Full Code Here

    StringBuilder sb = new StringBuilder();
    Integer rating = generateReview(sb, artifact);
    if (rating == null) {
      return;
    }
    Author reviewer = getReviewerIdentity();
    repository.setReview(artifact.getId(), reviewer, rating, sb.toString(), false);
    repository.commit();
  }
View Full Code Here

    reviewComment.append(String.format("Total compliance: %.1f%%", ratio * 100));
    return rating;
  }

  private Author getReviewerIdentity() {
    Author reviewer = agentManager.getCollabReview().getAuthorManager().getAuthor(reviewerName);
    if (reviewer == null) {
      reviewer = agentManager.getCollabReview().getAuthorManager().createAuthor(reviewerName);
      agentManager.getCollabReview().getAuthorManager().storeAuthor(reviewer);
      agentManager.getCollabReview().getAuthorManager().commit();
    }
View Full Code Here

      if( reviews.size() == 0 ) {
        continue;
      }
      result.append(artifactIdentifier.getName()).append(" (rev. ").append(artifactIdentifier.getRevision()).append(")\n--------------------------------------------------\n");
      Map<Author, Float> responsibilities = collabReview.getMeasurementsManager().getArtifactResponsibility().listResponsibilities(artifact);
      Author mainContributor = responsibilities.keySet().iterator().next();
      result.append(String.format("Main contributor: %s (%.1f%%)\n", mainContributor.getName(), responsibilities.get(mainContributor) * 100));
      for (Review review : reviews) {
        result.append(String.format("Review (rated %d): %s", review.getRating(), review.getReviewText()));
      }
      result.append("******\n\n\n");
    }
 
View Full Code Here

  public Review setReview(ArtifactIdentifier artifactIdentifier, Author author, int rating, String comment, boolean anonymous) {
    // make sure involved objects exist
    Artifact target = getArtifact(artifactIdentifier);
    assert target != null;
    assert author != null;
    Author loadedAuthor = getCollabReview().getAuthorManager().getAuthor(author.getName());
    assert loadedAuthor != null;
    // update or new review?
    Review review = getReview(artifactIdentifier.getName(), artifactIdentifier.getBranch(), author);
    Review oldReview = null;
    boolean mustAdd = false;
View Full Code Here

      AuthorManager authorManager = artifact.getRepository().getCollabReview().getAuthorManager();
      for (float aContributionShare : contributionShare) {
        if (artifactPointer.getCreatorName() != null) {
          name = artifactPointer.getCreatorName();
        }
        Author author = authorManager.getAuthor(name);
        int weight = (int) (aContributionShare * 1000);
        if (shareForAuthor.containsKey(author)) {
          shareForAuthor.put(author, aContributionShare + shareForAuthor.get(author));
        } else {
          shareForAuthor.put(author, aContributionShare);
View Full Code Here

    for (int i = startRev; i < endRev; i++) {
      Artifact old = repository.getLatestForName(artifactIdentifiers[i].getName(), artifactIdentifiers[i].getBranch());
      if (old != null) {
        old.setObsoleteDate(new Date(i));
      }
      Author author = authorManager.getAuthor(authors[i]);
      repository.addArtifact(artifactIdentifiers[i], new Date(i), contents[i], author);
    }
    repository.commit();
    System.out.println("data inserted");
  }
View Full Code Here

    logger.debug("Command: " + command);
    if (command == null) {
      throw new IllegalArgumentException("Illegal null command");
    }
    // check author is non-null
    Author author = getAuthorAndCheckAuthentication(request);
    // identify target resource
    ArtifactIdentifier target = identifyResource(request);
    if (target == null) {
      throw new IllegalArgumentException("document not found");
    }
View Full Code Here

TOP

Related Classes of net.sf.collabreview.core.users.Author

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.