Package br.edu.utfpr.cm.JGitMinerWeb.model.miner

Examples of br.edu.utfpr.cm.JGitMinerWeb.model.miner.EntityIssue


        EntityRepository repository = dao.findByID(repositoryToMinerId, EntityRepository.class);
        int i = 0;
        calculeSubProgress(i, gitIssues.size());
        while (!canceled && i < gitIssues.size()) {
            Issue gitIssue = gitIssues.get(i);
            EntityIssue issue = minerIssue(gitIssue, repository);
            if (minerEventsOfIssues) {
                minerEventsIssue(issue, gitRepo);
            }
            if (minerCommentsOfIssues && issue.getCommentsCount() > issue.getComments().size()) {
                minerCommentsOfIssue(issue, gitRepo);
            }
            EntityPullRequest pull = PullRequestServices.getPullRequestByNumber(gitIssue.getNumber(), repository, dao);
            if (pull != null) {
                pull.setIssue(issue);
                issue.setPullRequest(pull);
                dao.edit(pull);
            }
            repository.addIssue(issue);
            dao.edit(issue);
            i++;
View Full Code Here


            calculeSubProgress(i, gitIssues.size());
        }
    }

    private EntityIssue minerIssue(Issue gitIssue, EntityRepository repository) {
        EntityIssue issue = null;
        try {
            issue = IssueServices.createEntity(gitIssue, repository, dao);
            out.printLog("Isseu gravada com sucesso: " + gitIssue.getTitle() + " - ID: " + gitIssue.getId());
        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

        calculeSubProgress(i, gitPullRequests.size());
        while (!canceled && i < gitPullRequests.size()) {
            PullRequest gitPull = gitPullRequests.get(i);
            EntityPullRequest pullRequest = minerPullRequest(gitPull);
            if (pullRequest.getIssue() == null) {
                EntityIssue issue = IssueServices.getIssueByNumber(gitPull.getNumber(), repository, dao);
                if (issue != null) {
                    issue.setPullRequest(pullRequest);
                    pullRequest.setIssue(issue);
                }
            }
            if (pullRequest.getRepositoryCommits().isEmpty()) {
                out.printLog("Baixando commits do Pull Request...");
View Full Code Here

    public static EntityIssue createEntity(Issue gitIssue, EntityRepository repository, GenericDao dao) {
        if (gitIssue == null) {
            return null;
        }

        EntityIssue issue = getIssueByIdIssue(gitIssue.getId(), dao);

        if (issue == null) {
            issue = new EntityIssue();
        }

        issue.setMineredAt(new Date());
        issue.setIdIssue(gitIssue.getId());
        issue.setClosedAt(gitIssue.getClosedAt());
        issue.setCreatedAt(gitIssue.getCreatedAt());
        issue.setUpdatedAt(gitIssue.getUpdatedAt());
        issue.setNumber(gitIssue.getNumber());
        issue.setCommentsCount(gitIssue.getComments());
        LabelServices.addLabels(issue, gitIssue.getLabels(), dao);
        issue.setMilestone(MilestoneServices.createEntity(gitIssue.getMilestone(), repository, dao));
        issue.setBody(JsfUtil.filterChar(gitIssue.getBody()));
        issue.setBodyHtml(gitIssue.getBodyHtml());
        issue.setBodyText(gitIssue.getBodyText());
        issue.setHtmlUrl(gitIssue.getHtmlUrl());
        issue.setStateIssue(gitIssue.getState());
        issue.setTitle(JsfUtil.filterChar(gitIssue.getTitle()));
        issue.setUrl(gitIssue.getUrl());
        issue.setAssignee(UserServices.createEntity(gitIssue.getAssignee(), dao, false));
        issue.setUserIssue(UserServices.createEntity(gitIssue.getUser(), dao, false));



        if (issue.getId() == null || issue.getId().equals(0l)) {
            dao.insert(issue);
        } else {
            dao.edit(issue);
        }
View Full Code Here

TOP

Related Classes of br.edu.utfpr.cm.JGitMinerWeb.model.miner.EntityIssue

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.