[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] conga/luci/site/luci/Extensions cluster_adapte ...



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2006-10-16 04:54:33

Modified files:
	luci/site/luci/Extensions: cluster_adapters.py 

Log message:
	services tree construction stuff

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.112&r2=1.113

--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/16 04:51:32	1.112
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/16 04:54:33	1.113
@@ -365,10 +365,29 @@
 
 	try:
 		doc = minidom.parseString(form_xml)
-		if not doc.firstChild:
+		forms = doc.getElementsByTagName('form')
+		if len(forms) < 1:
 			raise
 	except:
 		return (False, {'errors': ['The resource data submitted for this service is not properly formed.']})
+
+	form_hash = {}
+	form_hash['toplevel'] = {'form': None, 'kids': [] }
+	for i in forms:
+		form_id = i.getAttribute('id')
+		form_parent = i.getAttribute('parent')
+		if not form_id or not form_parent:
+			continue
+		ielems = i.getElementsByTagName('input')
+		if not ielems or len(ielems) < 1:
+			continue
+		if not form_id in form_hash:
+			form_hash[form_id] = {'form': i, 'kids': []}
+		elif not form_hash[form_id]['form']:
+			form_hash[form_id]['form'] = i
+		if not form_parent in form_hash:
+			form_hash[form_parent] = {'form': None, 'kids': []}
+		form_hash[form_parent]['kids'].append(form_id)
 		
 	return (True, {'messages': ['OK']})
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]