Package pt.utl.ist.fenix.tools.resources

Examples of pt.utl.ist.fenix.tools.resources.LabelFormatter


    }

    @Override
    public int doEndTag() throws JspException {

        final LabelFormatter labelFormatter =
                (LabelFormatter) TagUtils.getInstance().lookup(this.pageContext, this.name, this.property, this.scope);

        final JspWriter out = this.pageContext.getOut();

        try {
            out.write(labelFormatter.toString(new StrutsMessageResourceProvider(this.properties, getUserLocale(),
                    this.pageContext.getServletContext(), (HttpServletRequest) this.pageContext.getRequest())));
        } catch (IOException e) {
            throw new JspException(e);
        }
View Full Code Here


                        "error.accounting.postingRules.gratuity.DFAGratuityPR.amount.being.payed.must.be.equal.to.amout.in.debt",
                        event.getDescriptionForEntryType(getEntryType()));
            }
        } else {
            if (!isPayingTotalAmount(event, when, amountToAdd) && !isPayingPartialAmount(event, when, amountToAdd)) {
                final LabelFormatter percentageLabelFormatter = new LabelFormatter();
                percentageLabelFormatter.appendLabel(getDfaPartialAcceptedPercentage().multiply(BigDecimal.valueOf(100))
                        .toString());

                throw new DomainExceptionWithLabelFormatter(
                        "error.accounting.postingRules.gratuity.DFAGratuityPR.invalid.partial.payment.value",
                        event.getDescriptionForEntryType(getEntryType()), percentageLabelFormatter);
View Full Code Here

                        "error.accounting.postingRules.gratuity.SpecializationDegreeGratuityPR.amount.being.payed.must.be.equal.to.amout.in.debt",
                        event.getDescriptionForEntryType(getEntryType()));
            }
        } else {
            if (!isPayingTotalAmount(event, when, amountToAdd) && !isPayingPartialAmount(event, when, amountToAdd)) {
                final LabelFormatter percentageLabelFormatter = new LabelFormatter();
                percentageLabelFormatter.appendLabel(getSpecializationDegreePartialAcceptedPercentage().multiply(
                        BigDecimal.valueOf(100)).toString());

                throw new DomainExceptionWithLabelFormatter(
                        "error.accounting.postingRules.gratuity.SpecializationDegreeGratuityPR.invalid.partial.payment.value",
                        event.getDescriptionForEntryType(getEntryType()), percentageLabelFormatter);
View Full Code Here

    private void validateSocialSecurityNumber(List<LabelFormatter> result) {
        final Party party = PartySocialSecurityNumber.readPartyBySocialSecurityNumber(socialSecurityNumber);
        final User user = User.findByUsername(username);
        if (party != null && party != user.getPerson()) {
            result.add(new LabelFormatter().appendLabel(
                    "error.candidacy.workflow.PersonalInformationForm.socialSecurityNumber.already.exists", "application"));
        }
    }
View Full Code Here

        }
    }

    private void checkGrantOwnerType(final List<LabelFormatter> result) {
        if (getGrantOwnerType().equals(GrantOwnerType.OTHER_INSTITUTION_GRANT_OWNER) && getGrantOwnerProvider() == null) {
            result.add(new LabelFormatter().appendLabel(
                    "error.candidacy.workflow.PersonalInformationForm.grant.owner.must.choose.granting.institution",
                    "application"));
        }
    }
View Full Code Here

    @Override
    public List<LabelFormatter> validate() {
        if (getCountryOfBirth().isDefaultCountry()) {
            if (StringUtils.isEmpty(getDistrictOfBirth()) || StringUtils.isEmpty(getDistrictSubdivisionOfBirth())
                    || StringUtils.isEmpty(getParishOfBirth())) {
                return Collections.singletonList(new LabelFormatter(
                        "error.candidacy.workflow.FiliationForm.zone.information.is.required.for.national.students",
                        "application"));
            }
        }
View Full Code Here

    }

    @Override
    public List<LabelFormatter> validate() {
        if (!StringUtils.isEmpty(this.notesAboutApplianceForResidence) && !isToApplyForResidence) {
            return Collections.singletonList(new LabelFormatter().appendLabel(
                    "error.candidacy.workflow.ResidenceApplianceInquiryForm.notes.can.only.be.filled.in.case.of.appliance",
                    "application"));
        }

        return Collections.emptyList();
View Full Code Here

    }

    @Override
    public List<LabelFormatter> validate() {
        if (schoolLevel == SchoolLevelType.OTHER && StringUtils.isEmpty(otherSchoolLevel)) {
            return Collections.singletonList(new LabelFormatter().appendLabel(
                    "error.candidacy.workflow.OriginInformationForm.otherSchoolLevel.must.be.filled", "candidate"));
        }

        LocalDate now = new LocalDate();
        if (now.getYear() < conclusionYear) {
            return Collections.singletonList(new LabelFormatter().appendLabel("error.personalInformation.year.after.current",
                    "candidate"));
        }

        if (conclusionYear < getBirthYear()) {
            return Collections.singletonList(new LabelFormatter().appendLabel("error.personalInformation.year.before.birthday",
                    "candidate"));
        }

        return Collections.emptyList();
View Full Code Here

        return result;
    }

    private void checkAddressInformationForForeignStudents(final List<LabelFormatter> result) {
        if (!getCountryOfResidence().isDefaultCountry() && !this.dislocatedFromPermanentResidence) {
            result.add(new LabelFormatter()
                    .appendLabel(
                            "error.candidacy.workflow.ResidenceInformationForm.non.nacional.students.should.select.dislocated.option.and.fill.address",
                            "application"));
        }
    }
View Full Code Here

        }
    }

    private void checkAddressInformationForNationalStudents(final List<LabelFormatter> result) {
        if (getCountryOfResidence().isDefaultCountry() && !isResidenceInformationFilled()) {
            result.add(new LabelFormatter()
                    .appendLabel(
                            "error.candidacy.workflow.ResidenceInformationForm.address.national.students.should.supply.complete.address.information",
                            "application"));
        }
    }
View Full Code Here

TOP

Related Classes of pt.utl.ist.fenix.tools.resources.LabelFormatter

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.