Database db = req.getDatabase();
try
{
AuthStatus authStatus = MolgenisServiceAuthenticationHelper.handleAuthentication(req, out);
if (!authStatus.isShowApi())
{
out.println("<html><body>");
out.println(authStatus.getPrintMe());
out.println("</body></html>");
}
else
{
// if no type selected: show data type choice
if (req.getString(INPUT_DATATYPE) == null)
{
out.println("<html><body>");
authStatus.getPrintMe();
if (req.getDatabase().getLogin().isAuthenticated())
{
out.println(MolgenisServiceAuthenticationHelper.displayLogoutForm());
}
showDataTypeChoice(out, req);
out.println("</body></html>");
}
// if no data provided, show csv input form
else if (req.get(INPUT_DATA) == null && req.get(INPUT_FILE) == null)
{
out.println("<html><body>");
authStatus.getPrintMe();
if (req.getDatabase().getLogin().isAuthenticated())
{
out.println(MolgenisServiceAuthenticationHelper.displayLogoutForm());
}
showCsvInputForm(out, req);