Package org.molgenis.framework.server

Examples of org.molgenis.framework.server.AuthStatus


    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);
View Full Code Here


    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
      {

        String entityName = req.getRequest().getPathInfo().substring(req.getServicePath().length());

        if (entityName.startsWith("/"))
        {
          entityName = entityName.substring(1);
        }

        if (entityName.equals(""))
        {
          out.println("<html><body>");
          out.println(authStatus.getPrintMe());
          if (req.getDatabase().getLogin().isAuthenticated())
          {
            out.println(MolgenisServiceAuthenticationHelper.displayLogoutForm());
          }
          showAvailableDownloads(out, db, req);
          out.println("</body></html>");
        }
        else
        {
          // Check if this entity exists and is downloadable
          List<org.molgenis.model.elements.Entity> downloadableEntities = getDownloadableEntities(db);
          boolean found = false;
          for (int i = 0; i < downloadableEntities.size() && !found; i++)
          {
            String name = downloadableEntities.get(i).getName();
            if ((name != null) && name.equals(entityName))
            {
              found = true;
            }
          }

          if (!found)
          {
            res.getResponse().sendError(404);// NOT FOUND
            return;
          }

          if (req.getRequest().getQueryString() != null
              && req.getRequest().getQueryString().equals("__showQueryDialogue=true"))
          {
            out.println("<html><body>");
            out.println(authStatus.getPrintMe());
            if (req.getDatabase().getLogin().isAuthenticated())
            {
              out.println(MolgenisServiceAuthenticationHelper.displayLogoutForm());
            }
            showFilterableDownload(out, entityName, db);
View Full Code Here

TOP

Related Classes of org.molgenis.framework.server.AuthStatus

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.