예제 #1
0
파일: History.java 프로젝트: hurims/yobi
 private static void buildPostingHistory(
     String userName, Project project, List<Posting> postings, List<History> histories) {
   for (Posting posting : postings) {
     History postingHistory = new History();
     String authorName = posting.authorName;
     postingHistory.setWho(authorName);
     setUserPageUrl(postingHistory, User.findByLoginId(posting.authorLoginId));
     postingHistory.setWhen(posting.createdDate);
     postingHistory.setWhere(project.name);
     postingHistory.setWhat("post");
     postingHistory.setShortTitle("#" + posting.number);
     postingHistory.setHow(posting.title);
     postingHistory.setUrl("/" + userName + "/" + project.name + "/post/" + posting.number);
     histories.add(postingHistory);
   }
 }
예제 #2
0
파일: History.java 프로젝트: hurims/yobi
 private static void buildIssueHistory(
     String userName, Project project, List<Issue> issues, List<History> histories) {
   for (Issue issue : issues) {
     History issueHistory = new History();
     String authorName = issue.authorName;
     issueHistory.setWho(authorName);
     setUserPageUrl(issueHistory, User.findByLoginId(issue.authorLoginId));
     issueHistory.setWhen(issue.createdDate);
     issueHistory.setWhere(project.name);
     issueHistory.setWhat("issue");
     issueHistory.setShortTitle("#" + issue.number);
     issueHistory.setHow(issue.title);
     issueHistory.setUrl("/" + userName + "/" + project.name + "/issue/" + issue.number);
     histories.add(issueHistory);
   }
 }
예제 #3
0
파일: History.java 프로젝트: hurims/yobi
 private static void buildPullRequestsHistory(
     String userName, Project project, List<PullRequest> pullRequests, List<History> histories) {
   for (PullRequest pull : pullRequests) {
     History pullHistory = new History();
     User contributor = pull.contributor;
     pullHistory.setWho(contributor.loginId);
     setUserPageUrl(pullHistory, User.findByLoginId(contributor.loginId));
     pullHistory.setWhen(pull.created);
     pullHistory.setWhere(project.name);
     pullHistory.setWhat("pullrequest");
     pullHistory.setShortTitle("#" + pull.number);
     pullHistory.setHow(pull.title);
     pullHistory.setUrl("/" + userName + "/" + project.name + "/pullRequest/" + pull.number);
     histories.add(pullHistory);
   }
 }
예제 #4
0
파일: History.java 프로젝트: hurims/yobi
 private static void buildCommitHistory(
     String userName, Project project, List<Commit> commits, List<History> histories) {
   if (commits != null) {
     for (Commit commit : commits) {
       History commitHistory = new History();
       String authorEmail = commit.getAuthorEmail();
       if (User.isEmailExist(authorEmail)) {
         setUserPageUrl(commitHistory, User.findByEmail(authorEmail));
       } else {
         commitHistory.setWho(commit.getAuthorName());
       }
       commitHistory.setWhen(commit.getCommitterDate());
       commitHistory.setWhere(project.name);
       commitHistory.setWhat("commit");
       commitHistory.setShortTitle(commit.getShortId());
       commitHistory.setHow(commit.getShortMessage());
       commitHistory.setUrl("/" + userName + "/" + project.name + "/commit/" + commit.getId());
       histories.add(commitHistory);
     }
   }
 }
예제 #5
0
파일: History.java 프로젝트: hurims/yobi
 private static void setUserPageUrl(History history, User user) {
   history.setWho(user.name);
   history.setUserPageUrl("/" + user.loginId);
   history.setUserAvatarUrl(user.avatarUrl());
 }