Examples of ArtifactIdentifier


Examples of de.fraunhofer.fit.collabreview.core.ArtifactIdentifier

        list.add(latestVersion);
        list.add(page_views);
       
        Artifact artifact = CollabReviewSingleton.get().getRepository().getLatestForName(articleName, "");
        if (artifact != null) {
          ArtifactIdentifier aid = artifact.getId();
         
          float quality = CollabReviewSingleton.get().getMeasurementsManager().getArtifactQualityAssessor().assessQuality(aid);
          List<Review> wiki_reviews = (List<Review>) CollabReviewSingleton.get().getRepository().listReviews(aid.getName(), "");
          artifact.setRepository(CollabReviewSingleton.get().getRepository());
          NavigableMap<Author, Float> latest_contributions = CollabReviewSingleton.get().getMeasurementsManager().getArtifactResponsibility().listResponsibilities(artifact);
          ArrayList<String>authornames = new ArrayList();
          for (Review review : wiki_reviews) {
            if (review != null) {
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

  protected void executeSingleSearchStep() {
    if (!allArtifIterator.hasNext()) {
      setResult(bestSoFar);
      return;
    }
    ArtifactIdentifier aid = allArtifIterator.next();
    assert aid != null;
    Artifact potentialAncestor = getRepository().getArtifact(aid);
    assert potentialAncestor != null;
    ArtifactSimilarity.TransformInfo currentTransform = getArtifactSimilarity().findTransformScript(potentialAncestor, getNewArtifactContent(), Integer.MAX_VALUE);
    if (bestSoFar == null || currentTransform.getCost() < bestSoFar.getCost()) {
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

   * @return an ArtifactIdentifier with the requested information
   * @throws Exception if attempting to map fails with an exception
   */
  public ArtifactIdentifier getRegroupedIdentifier(String sourceName) throws Exception {
    Pair<String, String> names = getNameAndBranch(sourceName);
    return new ArtifactIdentifier(names.first, revision, names.second);
  }
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

  /**
   * @return a newly created ArtifactIdentifier for the targeted resource
   */
  public ArtifactIdentifier getArtifactIdentifier() {
    return new ArtifactIdentifier(targetPath, revision, targetBranch);
  }
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

    String originalName = artifactIdentifier.getName().contains("/") ? artifactIdentifier.getName().substring(artifactIdentifier.getName().lastIndexOf("/")) : artifactIdentifier.getName();
    originalName = originGrouping.getName() + originalName;
    String targetName = actionData.getSourcePath() + originalName.substring(oldPrefix.length());
    String targetGroupingName = targetName.substring(0, targetName.lastIndexOf("/"));
    try {
      ArtifactIdentifier newId = actionData.getRegroupedIdentifier(targetName);
      Artifact oldArtifactWithSameName = repository.getLatestForName(newId.getName(), newId.getBranch());
      if (oldArtifactWithSameName != null && !oldArtifactWithSameName.isObsolete() && oldArtifactWithSameName.getId().getRevision() != newId.getRevision()) {
        // Sanity check: there is already an artifact with that name in the database.
        // This means that a different artifact would be mapped by CollabReview onto the same artifact.
        // This is not good; prevent this.
        // TODO I hope this will detect the problem in the freecol repository which must be somewhere before revision 1952
        throw new IllegalArgumentException("Local name conflict for " + newId);
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

      public void visit(Grouping grouping, ArtifactIdentifier oldId) {
        String newName = oldId.getName();
        if (oldId.getName().startsWith(branches.oldPrefix)) {
          newName = branches.newPrefix + oldId.getName().substring(branches.oldPrefix.length());
        }
        ArtifactIdentifier newId = new ArtifactIdentifier(newName, actionData.getRevision(), branches.newBranch);
        importProgressInfo.setAtomicWorkUnitDescription("Changing artifact id from " + oldId + " to " + newId);
        Artifact oldArtifact = repository.getArtifact(oldId);
        oldArtifact.setObsoleteDate(actionData.getDate());
        repository.addArtifact(newId, actionData.getDate(), oldArtifact.getContent(), owner.getOrCreateAuthorForActionData(actionData));
      }
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

  private TokenbasedSimilarity ls;

  public void setUp() throws Exception {
    CollabReviewSingleton.get();
    a1 = new Artifact(new ArtifactIdentifier("a.java", 1, ""), null, null, s1);
    a2 = new Artifact(new ArtifactIdentifier("a.java", 2, ""), null, null, s2);
    a3 = new Artifact(new ArtifactIdentifier("a.java", 3, ""), null, null, s3);
    a4 = new Artifact(new ArtifactIdentifier("a.java", 4, ""), null, null, s4);
    a5 = new Artifact(new ArtifactIdentifier("a.java", 5, ""), null, null, s5);
    a6 = new Artifact(new ArtifactIdentifier("a.java", 6, ""), null, null, s6);
    a7 = new Artifact(new ArtifactIdentifier("a.java", 7, ""), null, null, s7);
    ls = new TokenbasedSimilarity(new LineTokenizerFactory());
  }
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

        ownerAuthor = authorManager.createAuthor(owner);
        authorManager.storeAuthor(ownerAuthor);
        authorManager.commit();
      }
      if (revision > 1) {
        repository.getArtifact(new ArtifactIdentifier(printPath, revision - 1, "")).setObsoleteDate(newRevisionDate);
      }
      repository.addArtifact(new ArtifactIdentifier(printPath, revision, ""),
          newRevisionDate,
          contentFromSetOfFileNames(incrementBySameOwner),
          ownerAuthor);
      repository.commit();
      revision++;
    }
    // => remove directory names from artifact in repository
    Set<String> removedFiles = new TreeSet<String>(filesInOldVersion);
    removedFiles.removeAll(filesInNewVersion);
    if (removedFiles.size() > 0) {
      logger.debug("Files were removed from " + printPath + ": " + removedFiles);
      Author authorWhoDeleted;
      if (owner != null) {
        // we don't know who removed the files but let's guess it was one of those who also added files, otherwise assume it was the owner of the directory himself
        authorWhoDeleted = authorManager.getAuthor(owner);
      } else {
        owner = getOwnerOfFile(file);
        if (owner == null) {
          logger.warn("Assuming someone else as owner of " + file + " instead.");
          owner = authorManager.listAuthorNames().iterator().next();
        }
        authorWhoDeleted = authorManager.getAuthor(owner);
        if (authorWhoDeleted == null) {
          logger.error("That's weird, there is still no author...");
        }
      }
      if (revision > 1) {
        repository.getArtifact(new ArtifactIdentifier(printPath, revision - 1, "")).setObsoleteDate(newRevisionDate);
      }
      repository.addArtifact(new ArtifactIdentifier(printPath, revision, ""),
          new Date(file.lastModified()),
          newRevisionContent,
          authorWhoDeleted);
      repository.commit();
    }
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

    int microEditsFound = 0;
    // look for micro edits as long as...
    while (currentTime > latestTime - surveyTimeFrameDuration // currentTime is not before the start of surveyTimeFrame
        && revision > 0 ) { // we did not hit the bottom of the repository)
      revision--;
      nextArtifact = repository.getArtifact(new ArtifactIdentifier(name, revision, branch));
      if (nextArtifact == null) {
        continue;
      }
      // only test for streaks if we have already reached the surveyTimeFrame
      if (currentArtifact.getDate().getTime() <= latestTime) {
View Full Code Here

Examples of net.sf.collabreview.core.ArtifactIdentifier

      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");
    }
    switch (command) {
      case load:
        Review review = CollabReviewSingleton.get().getRepository().getReview(target.getName(), target.getBranch(), author);
        if (review != null) {
          result.setProperty("rating", "" + review.getRating());
          result.setProperty("text", review.getReviewText());
          result.setProperty("anonymous", "" + review.getIsAnonymous());
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.