Changeset 1117


Ignore:
Timestamp:
Jun 10, 2009, 1:13:21 PM (12 years ago)
Author:
Nicklas Nordborg
Message:

References #221: Configure GenePattern? server

Changed the AJAX calls to a new servlet. Now requires BASE 2.13 since that depends on new functionality in BASE.

Location:
extensions/net.sf.basedb.genepattern/trunk
Files:
2 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.genepattern/trunk/META-INF/servlets.xml

    r1107 r1117  
    22<servlets xmlns="http://base.thep.lu.se/servlets.xsd">
    33  <servlet>
    4     <servlet-name>TestServer</servlet-name>
    5     <servlet-class>net.sf.basedb.genepattern.servlet.TestServer</servlet-class>
    6     <!--
    7       Specify the name of a GenePattern module that should be used with
    8       the "Test server" function in the GUI. This function tests that
    9       the user has entered a correct url, login and password and requires
    10       an existing module on the server.
    11     -->
    12     <init-param>
    13       <param-name>moduleToCheck</param-name>
    14       <param-value>ComparativeMarkerSelection</param-value>
    15     </init-param>
     4    <servlet-name>Ajax</servlet-name>
     5    <servlet-class>net.sf.basedb.genepattern.servlet.Ajax</servlet-class>
    166  </servlet>
    177  <servlet>
  • extensions/net.sf.basedb.genepattern/trunk/README

    r1105 r1117  
    11== Requirements ==
    22
    3  1. BASE 2.12.1 or later.
     3 1. BASE 2.13 or later.
    44 
    55== Introduction ==
     
    3939To compile this package you also need:
    4040 
    41  1. Ant 1.7
     41 1. Ant 1.6
    4242 2. Java 1.6
    4343
  • extensions/net.sf.basedb.genepattern/trunk/build.xml

    r1106 r1117  
    2323  <property name="javac.target" value="1.5" />
    2424  <property name="javac.encoding" value="UTF-8" />
    25   <property name="depend.jars" value="http://base2.thep.lu.se/base/jars/2.12.0" />
     25  <property name="depend.jars" value="http://base2.thep.lu.se/base/jars/2.13.0" />
    2626  <property name="genepattern.jars" value="http://genepattern.broad.mit.edu/gp/downloads" />
    2727
  • extensions/net.sf.basedb.genepattern/trunk/resources/edit_server.jsp

    r1108 r1117  
    8585    if (!validate()) return;
    8686    var frm = document.forms['options'];
    87     var url = '<%=homeUrl%>/TestServer.servlet';
    88     url += '?server=' + encodeURIComponent(frm.gpServer.value);
     87    var url = '<%=homeUrl%>/Ajax.servlet?cmd=TestLogin';
     88    url += '&server=' + encodeURIComponent(frm.gpServer.value);
    8989    url += '&login=' + encodeURIComponent(frm.gpLogin.value);
    9090    url += '&password=' + encodeURIComponent(frm.gpPassword.value);
     
    9494    request.send(null);
    9595    document.getElementById('testStatus').innerHTML = 'Testing';
    96     document.getElementById('testReport').innerHTML = 'Please wait...';
     96    document.getElementById('testReport').innerHTML = 'Please wait. . .';
     97    setTimeout('testResult(null)', 15000);
     98    setTimeout('showProgress()', 250);
     99  }
     100  function showProgress()
     101  {
     102    var progress = document.getElementById('testReport');
     103    if (progress.innerHTML.indexOf('Please wait') == 0)
     104    {
     105      progress.innerHTML += ' .';
     106      setTimeout('showProgress()', 250);
     107    }
    97108  }
    98109
    99110  function testResult(request)
    100111  {
     112    if (document.getElementById('testReport').innerHTML.indexOf('Please wait') != 0) return;
    101113    var frm = document.forms['options'];
    102     var response = request.responseText; //.split('\n');
     114    var responseText = request != null ? request.responseText : 'status:error\nstacktrace:No response from server';
     115    var response = Ajax.parseResponse(responseText);
    103116    var testStatus;
    104117    var testReport;
    105     if (response == 'ok')
     118    if (response.isError())
     119    {
     120      testStatus = 'Test failed';
     121      var stacktrace = response.getElements()[0]['stacktrace'];
     122      testReport = '<div class="error stacktrace" style="width: 420px; height: 15em; overflow: auto;">' + stacktrace + '</div>';
     123    }
     124    else
    106125    {
    107126      testStatus = 'Test result';
    108127      testReport = 'Test of <b>' + frm.gpServer.value + '</b> was successful';
    109128    }
    110     else
    111     {
    112       testStatus = 'Test failed';
    113       testReport = '<div class="error stacktrace" style="width: 420px; height: 15em; overflow: auto;">' + response + '</div>';
    114     }
    115129    document.getElementById('testStatus').innerHTML = testStatus;
    116130    document.getElementById('testReport').innerHTML = testReport;
    117131  }
    118  
    119132  </script>
    120133</base:head>
     
    126139  <h3 class="docked"><%=HTML.encodeTags(title)%></h3>
    127140  <div class="boxedbottom">
    128     <table class="form" cellspacing=0>
     141    <table class="form" cellspacing="0" width="100%">
    129142    <tr>
    130143      <td class="prompt">Server URL</td>
    131       <td colspan="2"><input class="text required" type="text" name="gpServer" size="50"
     144      <td><input class="text required" type="text" name="gpServer" size="50"
    132145          value="<%=HTML.encodeTags(server.getName())%>"></td>
    133146    </tr>
    134147    <tr>
    135148      <td class="prompt">Login</td>
    136       <td colspan="2"><input class="text required" type="text" name="gpLogin" size="50"
     149      <td><input class="text required" type="text" name="gpLogin" size="50"
    137150          value="<%=HTML.encodeTags(server.getSetting("server.login"))%>"></td>
    138151    </tr>
     
    142155          value="<%=HTML.encodeTags(server.getSetting("server.password"))%>">
    143156      </td>
    144       <td>
    145         <table border=0 cellspacing=0 cellpadding=0 align="right"><tr><td>
    146         <base:button onclick="testServer();" title="Test"
    147         image="<%=homeUrl + "/images/genepattern.gif" %>"
    148         onclick="testServer()" />
    149         </td></tr></table>
    150       </td>
    151157    </tr>
    152158    <tr>
    153159      <td class="prompt" id="testStatus"></td>
    154       <td colspan="2" id="testReport">
     160      <td id="testReport">
    155161      </td>
    156162    </tr>
    157163    </table>
    158164  </div>
     165  </form>
    159166  <p>
    160167  <table align="center">
    161168  <tr>
    162     <td width="50%"><base:button onclick="saveSettings();" title="Save" /></td>
    163     <td width="50%"><base:button onclick="window.close();" title="Cancel" /></td>
     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>
    164173  </tr>
    165174  </table>
Note: See TracChangeset for help on using the changeset viewer.