Skip to contentSkip to conversation

conga/luci cluster/form-chooser cluster/form-m ...

Cluster-devel [email protected] 1 participant 1 message Oct 9, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-10-09 17:12:29

Modified files:
luci/cluster : form-chooser form-macros
luci/site/luci/Extensions: cluster_adapters.py
luci/storage : index_html

Log message:
more page title labels and miscellaneous other small fixes

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-chooser.diff?cvsroot=cluster&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.78&r2=1.79
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.85&r2=1.86
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/index_html.diff?cvsroot=cluster&r1=1.6&r2=1.7

luci/cluster/form-chooser +1 -4
@@ -14,10 +14,7 @@
     <span tal:omit-tag="" tal:condition="python: not ptype">
      <div metal:use-macro="here/form-macros/macros/entry-form"/>
     </span>
-    <span tal:omit-tag="" tal:condition="python: ptype == '0'">
-     <div metal:use-macro="here/form-macros/macros/entry-form"/>
-    </span>
-    <span tal:omit-tag="" tal:condition="python: ptype == '3'">
+    <span tal:omit-tag="" tal:condition="python: ptype == '0' or ptype == '1' or ptype == '2' or ptype == '3'">
      <div metal:use-macro="here/form-macros/macros/clusters-form"/>
     </span>
     <span tal:omit-tag="" tal:condition="python: ptype == '4'">
luci/cluster/form-macros +3 -0
@@ -25,6 +25,9 @@
 </div>
 
 <div metal:define-macro="clusters-form">
+	<script type="text/javascript">
+		set_page_title('Luci ??? cluster ??? cluster list');
+	</script>
 <div id="cluster_list">
 <div class="cluster" tal:repeat="clu clusystems">
 	<tal:block tal:define="global ragent python: here.getRicciAgent(clu)" />
luci/site/luci/Extensions/cluster_adapters.py +18 -3
@@ -1,5 +1,6 @@
 import socket
 from ModelBuilder import ModelBuilder
+from xml.dom import minidom
 from ZPublisher import HTTPRequest
 import AccessControl
 from conga_constants import *
@@ -287,7 +288,21 @@
 	return (True, {'errors': errors, 'messages': messages})
 
 def validateServiceEdit(self, request):
-	return (True, {})
+	try:
+		form_xml = request['form_xml']
+		if not form_xml:
+			raise KeyError('form_xml must not be blank')
+	except KeyError, e:
+		return (False, {errors: ['No resource data was supplied for this service.']})
+
+	try:
+		doc = minidom.parseString(form_xml)
+		if not doc.firstChild:
+			raise
+	except:
+		return (False, {'errors': ['The resource data submitted for this service is not properly formed.']})
+		
+	return (True, {'messages': ['OK']})
 
 def validateServiceAdd(self, request):
 	return (True, {})
@@ -588,7 +603,7 @@
   try:
     pagetype = request[PAGETYPE]
   except KeyError, e:
-    pagetype = "0"
+    pagetype = '3'
 
 
   cldata = {}
@@ -667,7 +682,7 @@
   try:
     pagetype = request[PAGETYPE]
   except KeyError, e:
-    pagetype = "0"
+    pagetype = '3'
 
   try:
     url = request['URL']
luci/storage/index_html +1 -0
@@ -49,6 +49,7 @@
 
 
 <!--  async helper functions -->
+<script type="text/javascript" src="/luci/conga.js"></script>
 <script language="javascript" type="text/javascript">
 
 var xmlHttp_object = false;