Package org.fenixedu.academic.domain.exceptions

Examples of org.fenixedu.academic.domain.exceptions.DomainException


    @Override
    protected void init(IndividualCandidacyProcessBean bean) {
        checkParameters(bean.getCandidacyProcess());

        if (bean.getPublicCandidacyHashCode() == null) {
            throw new DomainException("error.IndividualCandidacy.hash.code.is.null");
        }

        if (existsIndividualCandidacyProcessForDocumentId(bean.getCandidacyProcess(), bean.getPersonBean().getIdDocumentType(),
                bean.getPersonBean().getDocumentIdNumber())) {
            throw new DomainException("error.IndividualCandidacy.exists.for.same.document.id");
        }

        if (!StringUtils.isEmpty(bean.getPersonBean().getEidentifier())
                && existsIndividualCandidacyProcessForEidentifier(bean.getCandidacyProcess(), bean.getPersonBean()
                        .getEidentifier())) {
            throw new DomainException("error.individualCandidacy.exists.for.same.eIdentifier");
        }

        setCandidacyProcess(bean.getCandidacyProcess());
        createIndividualCandidacy(bean);
View Full Code Here


    }

    @Override
    protected void checkParameters(final CandidacyProcess process) {
        if (process == null || process.getCandidacyPeriod() == null) {
            throw new DomainException("error.SecondCycleIndividualCandidacyProcess.invalid.candidacy.process");
        }
    }
View Full Code Here

        }

        Student student = Student.readStudentByNumber(Integer.valueOf(bean.getPersonNumber()));

        if (student == null) {
            throw new DomainException("error.degreeTransfer.person.number.is.not.empty.but.check.for.enrollment.on.institution");
        }

        ExecutionYear candidacyExecutionInterval = bean.getCandidacyExecutionInterval();

        for (Registration registration : student.getRegistrationsSet()) {
View Full Code Here

        super.setDfaAmountPerEnrolment(dfaAmountPerEnrolment);
    }

    private void checkParameters(Money dfaAmountPerEnrolment) {
        if (dfaAmountPerEnrolment == null) {
            throw new DomainException(
                    "error.accounting.postingRules.gratuity.DFAGratuityByAmountPerEctsPR.dfaAmountPerEnrolment.cannot.be.null");
        }
    }
View Full Code Here

                dfaGratuity.getRegistration().getEnrolments(dfaGratuity.getExecutionYear()).size());
    }

    @Override
    public void setDfaAmountPerEnrolment(Money dfaAmountPerEnrolment) {
        throw new DomainException(
                "error.accounting.postingRules.gratuity.DFAGratuityByEnrolmentsPR.cannot.modify.dfaAmountPerEnrolment");
    }
View Full Code Here

                continue;
            }

            final Enrolment enrolment = (Enrolment) iEnrolment;
            if (enrolment.getStudentCurricularPlan() != studentCurricularPlan) {
                throw new DomainException("error.InternalSubstitution.invalid.enrolment");
            }
        }
    }
View Full Code Here

    private void checkParameters(final MobilityApplicationPeriod period, final MobilityProgram program,
            final MobilityEmailTemplateType type, final String subject, final String body) {

        if (period == null) {
            throw new DomainException("error.mobility.MobilityEmailTemplate.period.is.required");
        }

        if (program == null) {
            throw new DomainException("error.mobility.MobilityEmailTemplate.program.is.required");
        }

        if (period.hasEmailTemplateFor(program, type) && period.getEmailTemplateFor(program, type) != this) {
            throw new DomainException("error.mobility.MobilityEmailTemplate.for.type.already.exists");
        }

        if (StringUtils.isEmpty(subject)) {
            throw new DomainException("error.mobility.MobilityEmailTemplate.subject.is.required");
        }

        if (StringUtils.isEmpty(body)) {
            throw new DomainException("error.mobility.MobilityEmailTemplate.body.is.required");
        }

    }
View Full Code Here

        super.setDfaPartialAcceptedPercentage(dfaPartialAcceptedPercentage);
    }

    private void checkParameters(Money dfaTotalAmount, BigDecimal dfaPartialAcceptedPercentage) {
        if (dfaTotalAmount == null) {
            throw new DomainException("error.accounting.postingRules.gratuity.DFAGratuityPR.dfaTotalAmount.cannot.be.null");
        }

        if (dfaPartialAcceptedPercentage == null) {
            throw new DomainException(
                    "error.accounting.postingRules.gratuity.DFAGratuityPR.dfaPartialAcceptedPercentage.cannot.be.null");
        }
    }
View Full Code Here

        }
    }

    @Override
    public void setDfaTotalAmount(Money dfaTotalAmount) {
        throw new DomainException("error.accounting.postingRules.gratuity.DFAGratuityPR.cannot.modify.dfaTotalAmount");
    }
View Full Code Here

        throw new DomainException("error.accounting.postingRules.gratuity.DFAGratuityPR.cannot.modify.dfaTotalAmount");
    }

    @Override
    public void setDfaPartialAcceptedPercentage(BigDecimal dfaPartialAcceptedPercentage) {
        throw new DomainException(
                "error.accounting.postingRules.gratuity.DFAGratuityPR.cannot.modify.dfaPartialAcceptedPercentage");
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.exceptions.DomainException

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.