package com.capgemini.reports.r15;

import com.capgemini.reports.common.AbstractSubmitServletForItemRevision;
import com.capgemini.reports.definition.r15r16r17reports.r15r17reports.r15report.ExecutionR15;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;

/**
 * This class receives demands to perform a R15 report.<br>
 * It prepares the data and creates the appropriate {@link ExecutionR15} instance that will carry out the job.
 */
@WebServlet("/report_r15/submit")
public class SubmitServletR15 extends AbstractSubmitServletForItemRevision<ExecutionR15> {

  private static final long serialVersionUID = 4464210712946664940L;

  @Override
  protected ExecutionR15 prepareReport(final String partId, final String partRevision, final HttpServletRequest request) {
    // Obtain report parameters
    String langue = request.getParameter("langue");

    return new ExecutionR15(partId, partRevision, langue);
  }
}
