Ignore:
Timestamp:
Jun 2, 2009, 9:34:10 AM (14 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #224: Add a "Test" button on the GenePattern? 'edit server' page

Now using Ajax to do the test which means that we don't need to 'forward' from the servlet and we only need BASE 2.12.0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.genepattern/trunk/resources/submit.jsp

    r1102 r1106  
    5353    Presets presets = new Presets();
    5454    if (presetsXml != null) presets.loadFrom(presetsXml);
     55    String originalGpServer = request.getParameter("originalGpServer");
    5556    String gpServer = request.getParameter("gpServer");
    5657    Preset server = presets.getPreset(gpServer);
     58    if ("".equals(originalGpServer))
     59    {
     60      // Adding a new server - check if one already exists
     61      if (server.getSetting("server.login") != null)
     62      {
     63        throw new WebException("popup", "Server exists", "The server {1} already exists", gpServer);
     64      }
     65    }
     66    else if (!gpServer.equals(originalGpServer))
     67    {
     68      // The URL of an existing server has been modified
     69      presets.deletePreset(originalGpServer);
     70    }
    5771    server.setSetting("server.login", request.getParameter("gpLogin"));
    5872    server.setSetting("server.password", request.getParameter("gpPassword"));
    5973    sc.setUserClientSetting("net.sf.basedb.genepattern.options", presets.asXml());
    60     message = gpServer + " stored ok";
     74    message = gpServer + " saved";
    6175  }
    6276  else if ("RemoveServer".equals(cmd))
Note: See TracChangeset for help on using the changeset viewer.