From 28f2cb12f6be619dfc0afaaf89d0a51b5c99f70c Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Mon, 31 Oct 2005 09:01:17 +0000
Subject: [PATCH] Added support for TimerService if available. Added user
 interface for load balancing

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4179 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../CMFActivity/dtml/manageLoadBalancing.dtml | 153 ++++++++++++++++++
 1 file changed, 153 insertions(+)
 create mode 100755 product/CMFActivity/dtml/manageLoadBalancing.dtml

diff --git a/product/CMFActivity/dtml/manageLoadBalancing.dtml b/product/CMFActivity/dtml/manageLoadBalancing.dtml
new file mode 100755
index 0000000000..eee2ecf78b
--- /dev/null
+++ b/product/CMFActivity/dtml/manageLoadBalancing.dtml
@@ -0,0 +1,153 @@
+<dtml-comment>
+Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
+                    Jean-Paul Smets <jp@nexedi.com>
+
+WARNING: This program as such is intended to be used by professional
+programmers who take the whole responsability of assessing all potential
+consequences resulting from its eventual inadequacies and bugs
+
+This program as such is not intended to be used by end users. End
+users who are looking for a ready-to-use solution with commercial
+garantees and support are strongly adviced to contract a Free Software
+Service Company
+
+This program is Free Software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+</dtml-comment>
+
+<dtml-var manage_page_header>
+<dtml-var manage_tabs>
+
+<p class="form-help">
+  This tab defines the Load Balancing of Activities.
+  To provide high performance, the activities are distributed over several ZEO Servers, called <i>nodes</i>,
+  so that they can be processed in parallel. Nodes can either run on different machines or on one machine
+  with different Port Numbers.
+  The format to adress a node in this configuration is therfore
+  <code>IP-Address</code>:<code>Port-Number</code>.
+</p>
+
+<p class="form-help">
+  The interval of distribution and activation of the activities is per default 5 seconds. This can be
+  changed by altering the value of <i>interval</i> in the section <i>time-server</i> in the
+  Zope Configuration File <i>zope.conf</i>.
+</p>
+
+<p class="form-help">
+    The <i>Distributing node</i> is responsible for the Load Distribution. The default value is empty
+    which means that every existing node will try to do the distribution, which is fine when there
+    is only one ZServer running.
+    To change the Distributing Node, edit the value and click &quot;Change&quot;.
+</p>
+
+<form action="&dtml-URL1;">
+
+<table cellspacing="0" cellpadding="2" border="0" width="100%">
+  <tr class="list-header">
+    <td align="left" valign="top" colspan=2>
+      <div class="form-label">Distributing Node</div>
+    </td>
+  </tr>
+  <tr>
+    <td>
+      <div class="form-label">IP:Port</div>
+    </td>
+    <td align="left">
+      <div class="form-item">
+        <input type="text" name="distributingNode" value="&dtml-getDistributingNode;" size="19" />
+      </div>
+    </td>
+  </tr>
+  <tr>
+    <td>&nbsp;</td>
+    <td align="left">
+      <div class="form-element">
+        <input type="submit" class="form-element" name="manage_setDistributingNode:method" value=" Change ">
+     </div>
+    </td>
+  </tr>
+  <tr>
+    <td>&nbsp;</td>
+    <td>&nbsp;</td>
+  </tr>
+  <tr>
+    <td align="left" colspan=2>
+      <p class="form-help">
+        The following list defines the nodes the Load ist currently distributed to. Per default this list is empty
+        which means that every existing node will try to process all activities, which is fine, when ther is only one
+        ZServer running.
+        To delete a node from the list, activate the checkbox on the left of that node and click the &quot;Delete&quot; button.
+      </p>
+    </td>
+  </tr>
+  <tr class="list-header">
+    <td align="left" valign="top" colspan=2>
+      <div class="form-label">Existing Nodes</div>
+    </td>
+  <dtml-in getNodes>
+  <dtml-let domain=sequence-key
+          node=sequence-item
+          index=sequence-index>
+  <tr class="row-normal">
+    <td align="left" valign="top">
+      <input type="checkbox" name="deleteNodes:list" value="&dtml-node;">
+    </td>
+    <td align="left" valign="top">
+      <dtml-if "domain == _.None">
+        <p>Default</p>
+      <dtml-else>
+         <p><dtml-var node></p>
+      </dtml-if>
+    </td>
+  </tr>
+  </dtml-let>
+  </dtml-in>
+  <tr>
+    <td align="left" colspan="2">
+      <div class="form-element">
+        <input type="submit" class="form-element" name="manage_delNode:method" value=" Delete " />
+     </div>
+    </td>
+  </tr>
+  <tr>
+    <td>&nbsp;</td>
+    <td>&nbsp;</td>
+  </tr>
+  <tr>
+    <td align="left" valign="top" colspan=2>
+        <p class="form-help">
+          To add a new node, enter the Ip-Address and Port-Number for the new node
+          and click the &quot;Add&quot; button. 
+        </p>
+    </td>
+  </tr>
+  <tr>
+    <td>
+      <div class="form-label">IP:Port</div>
+    </td>
+    <td align="left">
+      <div class="form-item"><input type="text" name="node" size="19" /></div>
+    </td>
+  </tr>
+  <tr>
+    <td>&nbsp;</td>
+    <td align="left">
+      <div class="form-element">
+        <input type="submit" class="form-element" name="manage_addNode:method" value=" Add ">
+     </div>
+    </td>
+  </tr>
+</table>
+</form>
+<dtml-var manage_page_footer>
-- 
2.30.9