package performa.form;

import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.servlets.forms.NavigationFP;
import oneit.servlets.forms.*;
import oneit.utils.*;
import performa.orm.Job;
 

public class SignInCandidateFP extends NavigationFP
{
    @Override
    public SuccessfulResult processForm(SubmissionDetails submission, Map params) throws BusinessException
    {
        HttpServletRequest  request = submission.getRequest();
        Job                 job     = (Job) request.getAttribute("Job");
        
        return super.processForm(submission, params);
    }
    

    @Override
    protected Map validate(SubmissionDetails submission, MultiException exceptions) 
    {
        HttpServletRequest  request = submission.getRequest();
        Job                 job     = (Job) request.getAttribute("Job");
        
        BusinessObjectParser.assertFieldCondition(job.getEmail()!= null,
                                            job,
                                            job.FIELD_Email,
                                            "mandatory",
                                            exceptions,
                                            true,
                                            request);
        
        return super.validate(submission, exceptions);
    }
}