Package org.davinci.server.review.user

Examples of org.davinci.server.review.user.Reviewer


  public Reviewer getReviewer(String email) throws IOException {
    return getReviewer(null, email);
  }
 
  public Reviewer getReviewer(String name, String email) throws IOException {
    Reviewer reviewer = reviewers.get(email);
    if (null == reviewer) {
      reviewer = loadReviewer(name, email);
    }
    return reviewer;
  }
View Full Code Here


   
    return designerUser;
  }
 
  private Reviewer loadReviewer(String name, String email) throws IOException {
    Reviewer reviewer = new Reviewer(name, email);
    IStorage versionFile = getReviewerVersionFile(reviewer);
    if (versionFile.exists()) {
      ReviewerVersionFile file = new ReviewerVersionFile();
      List<ReviewerVersion> versions = file.load(versionFile);
      for (ReviewerVersion version : versions) {
        reviewer.addReviewerVersion(version);
      }
    }
    reviewers.put(email, reviewer);
    return reviewer;
  }
View Full Code Here

            sdf.setCalendar(Calendar.getInstance(new SimpleTimeZone(0, "GMT")));
            returnValue = sdf.format((Date) returnValue);
          }
          if ("email".equals(fieldName)) {
            ReviewManager commentingManager = ReviewManager.getReviewManager();
            Reviewer reviewerUser = commentingManager.getReviewer(returnValue.toString());
            String displayName = reviewerUser.getDisplayName();
            writer.addField("displayName", null != displayName ? displayName: returnValue.toString());
          }
        } catch (Exception e) {
          returnValue = new Object();
          e.printStackTrace();
View Full Code Here

      //no longer part of the review and persist the changes
    }
   
    //Deal with reviewers the designer has added to the review
    ReviewerVersion reviewerVersion = new ReviewerVersion(user.getUserID(), version.getTime());
    Reviewer tmpReviewer = null;
    for (int i = 0; i < emails.length; i++) {
      String email = emails[i];
      if (!email.equals(user.getPerson().getEmail())) {
        tmpReviewer = ReviewManager.getReviewManager().getReviewer("", email);
        tmpReviewer.addReviewerVersion(reviewerVersion);
        reviewers.add(tmpReviewer);
      }
    }

    //Add the designer as a reviewer
    tmpReviewer = ReviewManager.getReviewManager().getReviewer(user.getUserID(), user.getPerson().getEmail());
    tmpReviewer.addReviewerVersion(reviewerVersion);
    reviewers.add(tmpReviewer);

    //Handle fake reviewer (if necessary)
    String fakeReviewer = ServerManager.getServerManager().getDavinciProperty(Constants.FAKE_REVIEWER);
    if (fakeReviewer != null) {
      tmpReviewer = ReviewManager.getReviewManager().getReviewer("fakeReviewer", fakeReviewer);
      tmpReviewer.addReviewerVersion(reviewerVersion);
      reviewers.add(tmpReviewer);
    }

    version.setDraft(savingDraft);
    version.setDueDate(dueDate);
View Full Code Here

    String designerIDParm = (String) req.getParameter("designer");
   
    ReviewManager commentingManager = ReviewManager.getReviewManager();

    String userEmail = user.getPerson().getEmail();
    Reviewer reviewerUser = commentingManager.getReviewer(userEmail);

    JSONWriter writer = new JSONWriter(true);
    Iterator<ReviewerVersion> iterator = reviewerUser.getReviewerVersions();
    while (iterator.hasNext()) {
      ReviewerVersion reviewerVersion = iterator.next();

      String reviewDesignerID = reviewerVersion.getDesignerID();
      String reviewTime = reviewerVersion.getTimeVersion();
View Full Code Here

TOP

Related Classes of org.davinci.server.review.user.Reviewer

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.