package net.sourceforge.fenixedu.domain.serviceRequests.documentRequests; import com.linkare.commons.metainfo.Linkare; import net.sourceforge.fenixedu.dataTransferObject.serviceRequests.DocumentRequestCreateBean; import net.sourceforge.fenixedu.domain.accounting.EventType; import net.sourceforge.fenixedu.domain.exceptions.DomainException; public class SchoolRegistrationCertificateRequest extends SchoolRegistrationCertificateRequest_Base { protected SchoolRegistrationCertificateRequest() { super(); } public SchoolRegistrationCertificateRequest(final DocumentRequestCreateBean bean) { this(); super.init(bean); checkRulesToCreate(bean); } private void checkRulesToCreate(final DocumentRequestCreateBean bean) { if (bean.getExecutionYear() == null) { throw new DomainException( "error.serviceRequests.documentRequests.SchoolRegistrationCertificateRequest.executionYear.cannot.be.null"); } else if (!bean.getRegistration().isRegistered(bean.getExecutionYear())) { throw new DomainException( "SchoolRegistrationCertificateRequest.registration.not.in.registered.state.in.given.executionYear"); } } @Linkare(author = "Paulo Zenida", comments = "Changed the modifiers order according to the JLS suggestions") @Override public final DocumentRequestType getDocumentRequestType() { return DocumentRequestType.SCHOOL_REGISTRATION_CERTIFICATE; } @Linkare(author = "Paulo Zenida", comments = "Changed the modifiers order according to the JLS suggestions") @Override public final String getDocumentTemplateKey() { return getClass().getName(); } @Linkare(author = "Paulo Zenida", comments = "Changed the modifiers order according to the JLS suggestions") @Override public final EventType getEventType() { return EventType.SCHOOL_REGISTRATION_CERTIFICATE_REQUEST; } @Linkare(author = "Paulo Zenida", comments = "Changed the modifiers order according to the JLS suggestions") @Override public final Integer getNumberOfUnits() { return 0; } @Override public boolean isAvailableForTransitedRegistrations() { return true; } @Override public boolean hasPersonalInfo() { return true; } }