Search in sources :

Example 1 with CorporateSignatureInfo

use of io.pivotal.cla.service.CorporateSignatureInfo in project pivotal-cla by pivotalsoftware.

the class CclaController method claForm.

@RequestMapping("/sign/{claName}/ccla")
public String claForm(@AuthenticationPrincipal User user, SignCorporateClaForm signCorporateClaForm, Map<String, Object> model) throws Exception {
    String claName = signCorporateClaForm.getClaName();
    Integer pullRequestId = signCorporateClaForm.getPullRequestId();
    String repositoryId = signCorporateClaForm.getRepositoryId();
    CorporateSignatureInfo corporateResponse = claService.findCorporateSignatureInfoFor(claName, user);
    ContributorLicenseAgreement cla = corporateResponse.getContributorLicenseAgreement();
    CorporateSignature signed = corporateResponse.getCorporateSignature();
    List<String> currentUserGitHubOrganizations = corporateResponse.getGitHubOrganizations();
    if (cla == null) {
        throw new ResourceNotFoundException();
    }
    if (cla.getSupersedingCla() != null) {
        cla = cla.getSupersedingCla();
    }
    signCorporateClaForm.setSigned(signed != null);
    signCorporateClaForm.setName(user.getName());
    signCorporateClaForm.setClaId(cla.getId());
    signCorporateClaForm.setRepositoryId(repositoryId);
    signCorporateClaForm.setPullRequestId(pullRequestId);
    signCorporateClaForm.setGitHubOrganizations(currentUserGitHubOrganizations);
    model.put("cla", cla);
    return "cla/ccla/sign";
}
Also used : ContributorLicenseAgreement(io.pivotal.cla.data.ContributorLicenseAgreement) CorporateSignature(io.pivotal.cla.data.CorporateSignature) CorporateSignatureInfo(io.pivotal.cla.service.CorporateSignatureInfo) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ContributorLicenseAgreement (io.pivotal.cla.data.ContributorLicenseAgreement)1 CorporateSignature (io.pivotal.cla.data.CorporateSignature)1 CorporateSignatureInfo (io.pivotal.cla.service.CorporateSignatureInfo)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1