Project

General

Profile

« Previous | Next » 

Revision 631

Added by berkley about 24 years ago

changed replication interface to make it easier to see the servers.

View differences:

lib/replMain.html
33 33
  </tr>
34 34
  <tr>
35 35
    <td rowspan="2" width="50%">
36
    <form action="@replication-path@" method="POST">
36
    <form action="@replication-path@" method="POST" target="bottom">
37 37
      <input type="radio"  name="action" value="start">Start 
38 38
      &nbsp;&nbsp; Delta T: <input value="30" size="4" name="rate"> seconds<br>
39 39
      <input type="radio"  name="action" value="stop">Stop <br><br>
40
      <input type="submit" value="Submit">
40
      <input type="submit" value="Submit" target="bottom">
41 41
    </form>
42 42
    </td>
43 43
  </tr>
......
49 49
  </tr>
50 50
  <tr>
51 51
    <td rowspan="2" width="50%">
52
    <form action="@replication-path@" method="POST">
52
    <form action="@replication-path@" method="POST" target="bottom">
53 53
      <input type="radio"  name="action" value="getall"> Get All - bring all updated
54 54
      documents from remote hosts to this server<br><br>
55 55
      
56
      <input type="submit" value="Submit">
56
      <input type="submit" value="Submit" target="bottom">
57 57
    </form>
58 58
    </td>
59 59
  </tr>
......
65 65
  </tr>
66 66
  <tr>
67 67
    <td rowspan="2" width="50%">
68
    <form action="@replication-path@" method="POST">
68
    <form action="@replication-path@" method="POST" target="bottom">
69 69
      <input type="hidden" name="action" value="servercontrol">
70 70
      <input type="radio" name="subaction" value="delete"> Remove this server<br>
71 71
      <input type="radio" name="subaction" value="add"> Add this server<br>
72 72
      <input size="30" name="server" > <br>Replicate To (1 or 0)?:
73 73
      <input size="2" name="replicate">
74 74
      <br><br>
75
      <input type="submit" value="Submit">
75
      <input type="submit" value="Submit" target="bottom">
76 76
    </form>
77
    <form action="@replication-path@" method="POST">
78 77
    </td>
79 78
  </tr>
80 79
</table>
src/edu/ucsb/nceas/metacat/MetacatReplication.java
85 85
      if(((String[])params.get("action"))[0].equals("stop"))
86 86
      { //stop the replication server
87 87
        replicationDaemon.cancel();
88
        replicationDaemon = new Timer(true);
88 89
        out.println("Replication Handler Stopped");
89 90
        System.out.println("Replication Handler Stopped");
90 91
        MetacatReplication.replLog("deltaT handler stopped");
......
121 122
      else if(((String[])params.get("action"))[0].equals("getall"))
122 123
      { //updates this server exactly once
123 124
        replicationDaemon.schedule(new ReplicationHandler(out), 0);
125
        response.setContentType("text/html");
124 126
        out.println("<html><body>\"Get All\" Done</body></html>");
125 127
      }
126 128
      else if(((String[])params.get("action"))[0].equals("forcereplicate"))
......
186 188
                "last_checked, replicate) values ('" + server + "', to_date(" +
187 189
                "'01/01/00', 'MM/DD/YY'), '" + replicate + "')");
188 190
        pstmt.execute();
189
        out.println("server " + server + " added"); 
191
        out.println("Server says: server " + server + " added"); 
192
        response.setContentType("text/html");
193
        out.println("<html><body><table border=\"1\">");
194
        out.println("<tr><td><b>server</b></td><td><b>last_checked</b></td><td>");
195
        out.println("<b>replicate</b></td></tr>");
196
        pstmt = conn.prepareStatement("select * from xml_replication");
197
        pstmt.execute();
198
        ResultSet rs = pstmt.getResultSet();
199
        boolean tablehasrows = rs.next();
200
        while(tablehasrows)
201
        {
202
          out.println("<tr><td>" + rs.getString(2) + "</td><td>");
203
          out.println(rs.getString(3) + "</td><td>");
204
          out.println(rs.getString(4) + "</td></tr>");
205
          tablehasrows = rs.next();
206
        }
207
        out.println("</table></body></html>");
190 208
      }
191 209
      else if(subaction.equals("delete"))
192 210
      {
......
194 212
        pstmt = conn.prepareStatement("delete from xml_replication where " +
195 213
                "server like '" + server + "'");
196 214
        pstmt.execute();
197
        out.println("server " + server + " deleted");
215
        out.println("Server says: server " + server + " deleted");
216
        response.setContentType("text/html");
217
        out.println("<html><body><table border=\"1\">");
218
        out.println("<tr><td><b>server</b></td><td><b>last_checked</b></td><td>");
219
        out.println("<b>replicate</b></td></tr>");
220
        pstmt = conn.prepareStatement("select * from xml_replication");
221
        pstmt.execute();
222
        ResultSet rs = pstmt.getResultSet();
223
        boolean tablehasrows = rs.next();
224
        while(tablehasrows)
225
        {
226
          out.println("<tr><td>" + rs.getString(2) + "</td><td>");
227
          out.println(rs.getString(3) + "</td><td>");
228
          out.println(rs.getString(4) + "</td></tr>");
229
          tablehasrows = rs.next();
230
        }
231
        out.println("</table></body></html>");
198 232
      }
199 233
      else if(subaction.equals("list"))
200 234
      {

Also available in: Unified diff