Changeset 1126


Ignore:
Timestamp:
Jun 15, 2009, 2:02:54 PM (12 years ago)
Author:
Nicklas Nordborg
Message:

References #221: Configure GenePattern? server

Added field for URL to BASE. This seems to be the easiest way to let the plug-in know about
the BASE web server. Also moved the "test" button back to it's previous location.

Location:
extensions/net.sf.basedb.genepattern/trunk
Files:
3 edited

Legend:

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

    r1117 r1126  
    5454if (presetsXml != null) presets.loadFrom(presetsXml);
    5555Preset server = gpServer == null ? presets.getDefault() : presets.getPreset(gpServer);
     56if (server.getSetting("base.url") == null)
     57{
     58  final String scheme = request.getScheme();
     59  final String serverName = request.getServerName();
     60  final int serverPort = request.getServerPort();
     61  server.setSetting("base.url", scheme + "://" + serverName + ":" + serverPort);
     62}
    5663String title = "Options for " + (gpServer == null ? "new" : gpServer);
    5764%>
     
    7279      alert('A login must be specified');
    7380      frm.gpServer.focus();
     81      return false;
     82    }
     83    else if (frm.baseUrl.value == '')
     84    {
     85      alert('The URL to BASE must be specified');
     86      frm.baseUrl.focus();
    7487      return false;
    7588    }
     
    120133      testStatus = 'Test failed';
    121134      var stacktrace = response.getElements()[0]['stacktrace'];
    122       testReport = '<div class="error stacktrace" style="width: 420px; height: 15em; overflow: auto;">' + stacktrace + '</div>';
     135      testReport = '<div class="error stacktrace" style="width: 350px; height: 15em; overflow: auto;">' + stacktrace + '</div>';
    123136    }
    124137    else
     
    141154    <table class="form" cellspacing="0" width="100%">
    142155    <tr>
    143       <td class="prompt">Server URL</td>
    144       <td><input class="text required" type="text" name="gpServer" size="50"
    145           value="<%=HTML.encodeTags(server.getName())%>"></td>
    146     </tr>
    147     <tr>
    148       <td class="prompt">Login</td>
    149       <td><input class="text required" type="text" name="gpLogin" size="50"
    150           value="<%=HTML.encodeTags(server.getSetting("server.login"))%>"></td>
    151     </tr>
    152     <tr>
    153       <td class="prompt">Password</td>
     156      <td class="prompt">GenePattern server</td>
     157      <td colspan="2"><input class="text required" type="text" name="gpServer" size="45"
     158        value="<%=HTML.encodeTags(server.getName())%>"
     159        title="The URL to the GenePattern server"></td>
     160    </tr>
     161    <tr>
     162      <td class="subprompt">-login</td>
     163      <td colspan="2"><input class="text required" type="text" name="gpLogin" size="45"
     164        value="<%=HTML.encodeTags(server.getSetting("server.login"))%>"
     165        title="Your login to the above GenePattern server"></td>
     166    </tr>
     167    <tr>
     168      <td class="subprompt">-password</td>
    154169      <td><input class="text" type="password" name="gpPassword" size="30"
    155           value="<%=HTML.encodeTags(server.getSetting("server.password"))%>">
     170        value="<%=HTML.encodeTags(server.getSetting("server.password"))%>"
     171        title="Leave empty if no password is needed">
     172      </td>
     173      <td>
     174        <table border="0" cellspacing="0" cellpadding="0">
     175        <tr><td><base:button onclick="testServer();" title="Test"
     176          image="<%=homeUrl + "/images/genepattern.gif" %>" /></td></tr>
     177        </table>
     178      </td>
     179    </tr>
     180    <tr>
     181      <td class="prompt">BASE server</td>
     182      <td colspan="2"><input type="text" class="text required" name="baseUrl" size="45"
     183        value="<%=HTML.encodeTags(server.getSetting("base.url"))%>"
     184        title="The URL to this BASE server as seen from the GenePattern server">
    156185      </td>
    157186    </tr>
    158187    <tr>
    159188      <td class="prompt" id="testStatus"></td>
    160       <td id="testReport">
     189      <td id="testReport" colspan="2">
    161190      </td>
    162191    </tr>
     
    167196  <table align="center">
    168197  <tr>
    169     <td width="33%"><base:button onclick="testServer();" title="Test"
    170       image="<%=homeUrl + "/images/genepattern.gif" %>" /></td>
    171     <td width="33%"><base:button onclick="saveSettings();" title="Save" /></td>
    172     <td width="33%"><base:button onclick="window.close();" title="Cancel" /></td>
     198    <td width="50%"><base:button onclick="saveSettings();" title="Save" /></td>
     199    <td width="50%"><base:button onclick="window.close();" title="Cancel" /></td>
    173200  </tr>
    174201  </table>
  • extensions/net.sf.basedb.genepattern/trunk/resources/submit.jsp

    r1108 r1126  
    107107    server.setSetting("server.login", request.getParameter("gpLogin"));
    108108    server.setSetting("server.password", request.getParameter("gpPassword"));
     109    server.setSetting("base.url", request.getParameter("baseUrl"));
    109110    savePreset(dc, presets);
    110111    dc.commit();
     
    121122    savePreset(dc, presets);
    122123    dc.commit();
    123     message = gpServer + " deleted";   
     124    message = gpServer + " deleted";
    124125  }
    125126  else
     
    141142}
    142143%>
    143 
  • extensions/net.sf.basedb.genepattern/trunk/src/net/sf/basedb/genepattern/GPServer.java

    r1117 r1126  
    6060  }
    6161 
     62  /**
     63    Get the URL to the current BASE server as seen from
     64    the GenePattern server.
     65  */
     66  public String getBaseUrl()
     67  {
     68    return preset.getSetting("base.url");
     69  }
    6270 
    6371}
Note: See TracChangeset for help on using the changeset viewer.