1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import xml.dom.minidom
30
31
33 - def __init__(self, doc, container, divId = "mb", divClass = "mc"):
34 Widget.__init__(self)
35 d1 = doc.createElementNS("", "div")
36 d1.setAttributeNS("", "id", divId)
37 container.appendChild(d1)
38 mc = doc.createElementNS("", "div")
39 mc.setAttributeNS("", "class", divClass)
40 d1.appendChild(mc)
41 self.__doc = doc
42 self.__title = None
43 self.__mc = mc
44
46 if self.__title == None:
47 t = self.__doc.createElementNS("", "h1")
48 self.__mc.insertBefore(t, self.__mc.firstChild)
49 self.__title = self.__doc.createTextNode(title)
50 t.appendChild(self.__title)
51 self.__title.data = title
52
55
58 Box.__init__(self, doc, container, divId = "s_mb", divClass = "s_mc")
59 self.__table = doc.createElementNS("", "table")
60 self.__table.setAttributeNS("", "cellspacing", "0")
61 self.__table.setAttributeNS("", "cellpadding", "0")
62 self.__table.setAttributeNS("", "border", "0")
63 self.__table.setAttributeNS("", "width", "100%")
64 self.__table.appendChild(self._Box__doc.createTextNode(""))
65 div = self._Box__doc.createElementNS("", "div")
66 div.setAttributeNS("", "class", "t_wrapper")
67 div.appendChild(self.__table)
68 self.getDOMContainer().appendChild(div)
69 self.__table_stat = None
70 self.setTitle()
71
72
74 row = self._Box__doc.createElementNS("", "tr")
75
76 td = self._Box__doc.createElementNS("", "td")
77 td.setAttributeNS("", "valign", "top")
78 td.setAttributeNS("", "nowrap", "nowrap")
79 div = self._Box__doc.createElementNS("", "div")
80 div.setAttributeNS("", "class", "s_tag")
81 div.appendChild(self._Box__doc.createTextNode(tag))
82 td.appendChild(div)
83 row.appendChild(td)
84
85
86 td = self._Box__doc.createElementNS("", "td")
87 td.setAttributeNS("", "width", "100%")
88 div = self._Box__doc.createElementNS("", "div")
89 div.setAttributeNS("", "class", "s_val")
90 div.appendChild(self._Box__doc.createTextNode(value))
91 td.appendChild(div)
92 row.appendChild(td)
93
94 self.__table.appendChild(row)
95
97 if self.__table_stat == None:
98 h1 = self._Box__doc.createElementNS("", "h1")
99 h1.appendChild(self._Box__doc.createTextNode("Global Statistics"))
100 self.getDOMContainer().appendChild(h1)
101
102 div = self._Box__doc.createElementNS("", "div")
103 div.setAttributeNS("", "class", "t_wrapper")
104 self.getDOMContainer().appendChild(div)
105 self.__table_stat = self._Box__doc.createElementNS("", "table")
106 self.__table_stat.setAttributeNS("", "cellspacing", "0")
107 self.__table_stat.setAttributeNS("", "cellpadding", "0")
108 self.__table_stat.setAttributeNS("", "border", "0")
109 self.__table_stat.setAttributeNS("", "width", "100%")
110 div.appendChild(self.__table_stat)
111
112 row = self._Box__doc.createElementNS("", "tr")
113 self.__table_stat.appendChild(row)
114 self.__table_stat = row
115
116 td = self._Box__doc.createElementNS("", "td")
117 div = self._Box__doc.createElementNS("", "div")
118 div.setAttributeNS("", "class", "gbl_cnt_" + type)
119 div.appendChild(self._Box__doc.createTextNode("%d %ss" % (value, type)))
120 td.appendChild(div)
121 self.__table_stat.appendChild(td)
122
123
124
126 - def __init__(self, doc, container, id):
127 Widget.__init__(self)
128 self.__doc = doc
129 node_head = doc.createElementNS("", "div")
130 node_head.setAttributeNS("", "class", "node_head")
131 container.appendChild(node_head)
132
133 link = doc.createElementNS("", "a")
134 link.setAttributeNS("", "href", "javascript:ToggleNode('Img%d')" % id)
135 node_head.appendChild(link)
136
137 span = doc.createElementNS("", "span")
138 span.setAttributeNS("", "id", "Img%d" % id)
139 span.setAttributeNS("", "style", "background:url(http://fawww.europe.nokia.com/isis/isis_interface/img/icons/button_open.gif) no-repeat")
140 link.appendChild(span)
141
142 stitle = doc.createElementNS("", "span")
143 stitle.setAttributeNS("", "class", "node_title")
144 self.__title = doc.createTextNode("")
145 stitle.appendChild(self.__title)
146 span.appendChild(stitle)
147
148
149 showall = doc.createElementNS("", "a")
150 showall.setAttributeNS("", "href", "javascript:ShowChilds('Img%d')" % id)
151 span = doc.createElementNS("", "span")
152 span.setAttributeNS("", "class", "node_action")
153 span.appendChild(doc.createTextNode("[Show All]"))
154 showall.appendChild(span)
155
156
157 hideall = doc.createElementNS("", "a")
158 hideall.setAttributeNS("", "href", "javascript:HideChilds('Img%d')" % id)
159 span = doc.createElementNS("", "span")
160 span.setAttributeNS("", "class", "node_action")
161 span.appendChild(doc.createTextNode("[Hide All]"))
162 hideall.appendChild(span)
163
164
165 self.__togglenode = doc.createElementNS("", "a")
166 self.__togglenode.setAttributeNS("", "href", "javascript:ToggleNode('Img%d')" % id)
167 self.__togglenode.appendChild(doc.createTextNode(""))
168
169 node_head.appendChild(showall)
170 node_head.appendChild(hideall)
171 node_head.appendChild(self.__togglenode)
172
173 contentx = doc.createElementNS("", "div")
174 contentx.setAttributeNS("", "id", "Content%d" % id)
175 contentx.setAttributeNS("", "style", "display:none")
176 container.appendChild(contentx)
177 content = doc.createElementNS("", "div")
178 content.setAttributeNS("", 'class', "node_content")
179 content.appendChild(doc.createTextNode(""))
180 contentx.appendChild(content)
181 self.__container = content
182 self.__node_info = None
183
185 self.__title.data = title
186
188 if self.__node_info == None:
189 self.__node_info = self.__doc.createElementNS("", "span")
190 self.__node_info.setAttributeNS("", "class", "node_info")
191 self.__togglenode.appendChild(self.__node_info)
192 span = self.__doc.createElementNS("", "span")
193 span.setAttributeNS("", "class","cnt_%s" % type)
194 span.appendChild(self.__doc.createTextNode("%d %ss" % (value, type)))
195 self.__node_info.appendChild(span)
196
197
198
199
201 return self.__container
202
203
206 Widget.__init__(self)
207 self.__doc = doc
208 h_wrapper = self.__doc.createElementNS("", "div")
209 h_wrapper.setAttributeNS("", "id", "h_wrapper")
210 h_elmt = self.__doc.createElementNS("", "div")
211 h_elmt.setAttributeNS("", "class", "h_elmt")
212 h_wrapper.appendChild(h_elmt)
213 container.appendChild(h_wrapper)
214
215 t = self.__doc.createElementNS("", "div")
216 self.__title = doc.createTextNode("")
217 t.appendChild(self.__title)
218 t.setAttributeNS("", "class", "h_title")
219 h_elmt.appendChild(t)
220
221 t = self.__doc.createElementNS("", "div")
222 self.__subtitle = doc.createTextNode("")
223 t.appendChild(self.__subtitle)
224 t.setAttributeNS("", "class", "h_subtitle")
225 h_elmt.appendChild(t)
226
227
228
230 self.__title.data = title
231
233 self.__subtitle.data = title
234
237
263
265 self.__subtitle.data = title
266
268 - def __init__(self, doc, container):
269 Widget.__init__(self)
270 self.__doc = doc
271 self.__div = self.__doc.createElementNS("", "div")
272 self.__div.setAttributeNS("", "class", "icn_dft")
273 container.appendChild(self.__div)
274
275 - def setIcon(self, name):
276 self.__div.setAttributeNS("", "class", name)
277
278 - def appendText(self, text):
279 def pushContent(arg):
280 self.getDOMContainer().appendChild(self.__doc.createTextNode(arg))
281 self.getDOMContainer().appendChild(self.__doc.createElementNS("","br"))
282 map(pushContent, text.strip().split("\n"))
283
284 - def getDOMContainer(self):
286
287 -class RawText(Text):
288 - def appendText(self, text):
289 for child in xml.dom.minidom.parseString("<xhtml>" + text.strip() + "</xhtml>").documentElement.childNodes:
290 self.getDOMContainer().appendChild(child.cloneNode(True))
291
292 -class BoldText(Text):
293 - def __init__(self, doc, container):
294 Text.__init__(self, doc, container)
295 self.__bold = doc.createElementNS("","b")
296 self._Text__div.appendChild(self.__bold)
297
298 - def getDOMContainer(self):
300