View | Details | Raw Unified | Return to bug 23701 | Differences between
and this patch

Collapse All | Expand All

(-)umc/python/join/de.po (-8 / +8 lines)
 Lines 4-10    Link Here 
4
msgstr ""
4
msgstr ""
5
"Project-Id-Version: univention-management-console-module-join\n"
5
"Project-Id-Version: univention-management-console-module-join\n"
6
"Report-Msgid-Bugs-To: packages@univention.de\n"
6
"Report-Msgid-Bugs-To: packages@univention.de\n"
7
"POT-Creation-Date: 2011-09-20 12:07+0200\n"
7
"POT-Creation-Date: 2011-10-06 10:49+0200\n"
8
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
9
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
10
"Language-Team: LANGUAGE <LL@li.org>\n"
10
"Language-Team: LANGUAGE <LL@li.org>\n"
 Lines 13-43    Link Here 
13
"Content-Type: text/plain; charset=UTF-8\n"
13
"Content-Type: text/plain; charset=UTF-8\n"
14
"Content-Transfer-Encoding: 8bit\n"
14
"Content-Transfer-Encoding: 8bit\n"
15
15
16
#: umc/python/join/__init__.py:213
16
#: umc/python/join/__init__.py:273
17
msgid "Another join operation is in progress"
17
msgid "Another join operation is in progress"
18
msgstr "Es wird gerade eine andere Join Operation ausgeführt"
18
msgstr "Es wird gerade eine andere Join Operation ausgeführt"
19
19
20
#: umc/python/join/__init__.py:408
20
#: umc/python/join/__init__.py:462
21
#, python-format
21
#, python-format
22
msgid "Removing temp file: %s"
22
msgid "Removing temp file: %s"
23
msgstr "Lösche temporäre Datei: "
23
msgstr "Lösche temporäre Datei: "
24
24
25
#: umc/python/join/__init__.py:327
25
#: umc/python/join/__init__.py:386
26
msgid "due"
26
msgid "due"
27
msgstr "fällig"
27
msgstr "fällig"
28
28
29
#: umc/python/join/__init__.py:353
29
#: umc/python/join/__init__.py:410
30
msgid "never run"
30
msgid "never run"
31
msgstr "noch nie ausgeführt"
31
msgstr "noch nie ausgeführt"
32
32
33
#: umc/python/join/__init__.py:336
33
#: umc/python/join/__init__.py:394
34
msgid "not installed"
34
msgid "not installed"
35
msgstr "nicht installiert"
35
msgstr "nicht installiert"
36
36
37
#: umc/python/join/__init__.py:326 umc/python/join/__init__.py:355
37
#: umc/python/join/__init__.py:385 umc/python/join/__init__.py:411
38
msgid "run"
38
msgid "run"
39
msgstr "ausführen"
39
msgstr "ausführen"
40
40
41
#: umc/python/join/__init__.py:329
41
#: umc/python/join/__init__.py:388
42
msgid "successful"
42
msgid "successful"
43
msgstr "erfolgreich"
43
msgstr "erfolgreich"
(-)umc/python/join/__init__.py (-33 / +87 lines)
 Lines 38-44    Link Here 
38
38
39
import re
39
import re
40
from os import stat,listdir,chmod,unlink,path
40
from os import stat,listdir,chmod,unlink,path
41
from locale import nl_langinfo,D_T_FMT
41
from locale import nl_langinfo,D_T_FMT,getlocale,setlocale,LC_ALL
42
from time import strftime,localtime,sleep
42
from time import strftime,localtime,sleep
43
from string import join
43
from string import join
44
from subprocess import Popen
44
from subprocess import Popen
 Lines 51-58    Link Here 
51
class Instance(umcm.Base):
51
class Instance(umcm.Base):
52
	def init(self):
52
	def init(self):
53
		MODULE.warn("Initializing 'join' module with LANG = '%s'" % self.locale)
53
		MODULE.warn("Initializing 'join' module with LANG = '%s'" % self.locale)
54
		global _
55
		_ = umc.Translation('univention-management-console-module-join',self.locale).translate
56
54
57
		# some constants
55
		# some constants
58
		self._instdir		= '/usr/lib/univention-install'				# where to find *.inst files
56
		self._instdir		= '/usr/lib/univention-install'				# where to find *.inst files
 Lines 69-75    Link Here 
69
		self._process		= None
67
		self._process		= None
70
68
71
	def query(self,request):
69
	def query(self,request):
72
		"""Dispatcher for different query scopes."""
70
		""" Query to fill the scripts grid. """
73
		# ----------- DEBUG -----------------
71
		# ----------- DEBUG -----------------
74
		MODULE.info("join/query invoked with:")
72
		MODULE.info("join/query invoked with:")
75
		MODULE.info("   << LANG = '%s'" % self.locale)
73
		MODULE.info("   << LANG = '%s'" % self.locale)
 Lines 78-114    Link Here 
78
		for s in st:
76
		for s in st:
79
			MODULE.info("   << %s" % s)
77
			MODULE.info("   << %s" % s)
80
		# -----------------------------------
78
		# -----------------------------------
81
		result = []
79
		result = self._scripts()
82
		# please don't bite me, rather tell me how to write a 'case' in Python
80
		request.status = SUCCESS
83
		scope = request.options.get('scope','')
84
		# list join scripts and their status
85
		if scope == 'scripts':
86
			result = self._scripts()
87
			request.status = SUCCESS
88
		# list join log (or log file stamp, for tail-like display)
89
		elif scope == 'logview':
90
			# let it fail if arg is not numerical
91
			result = self._logview(int(request.options.get('count',10)))
92
			request.status = SUCCESS
93
		# ask for the join date (file timestamp of the 'joined' status file)
94
		elif scope == 'joined':
95
			result = self._joined()
96
			request.status = SUCCESS
97
		# check if a subprocess is running
98
		elif scope == 'running':
99
			result = self._running()
100
			request.status = SUCCESS
101
		else:
102
			request.status = FAILURE
103
81
104
		# PURE DEBUG: print all that we'll return
82
		# ---------- DEBUG --------------
83
		MODULE.info("join/query returns:")
105
		pp = pprint.PrettyPrinter(indent=4)
84
		pp = pprint.PrettyPrinter(indent=4)
106
		st = pp.pformat(result).split("\n")
85
		st = pp.pformat(result).split("\n")
107
		for s in st:
86
		for s in st:
108
			MODULE.info("   >> %s" % s)
87
			MODULE.info("   >> %s" % s)
88
		# --------------------------------
109
89
110
		self.finished(request.id,result)
90
		self.finished(request.id,result)
91
		
92
	def joined(self,request):
93
		""" returns the (localized) join date/time or
94
			the empty string.
95
		"""
96
		# ----------- DEBUG -----------------
97
		MODULE.info("join/joined invoked with:")
98
		MODULE.info("   << LANG = '%s'" % self.locale)
99
		pp = pprint.PrettyPrinter(indent=4)
100
		st = pp.pformat(request.options).split("\n")
101
		for s in st:
102
			MODULE.info("   << %s" % s)
103
		# -----------------------------------
104
		
105
		result = self._joined()
106
		request.status = SUCCESS
107
		
108
		# ---------- DEBUG --------------
109
		MODULE.info("join/joined returns:")
110
		pp = pprint.PrettyPrinter(indent=4)
111
		st = pp.pformat(result).split("\n")
112
		for s in st:
113
			MODULE.info("   >> %s" % s)
114
		# --------------------------------
111
115
116
		self.finished(request.id,result)
117
118
	def running(self,request):
119
		""" returns true if a join script is running.
120
		"""
121
		# ----------- DEBUG -----------------
122
		MODULE.info("join/running invoked with:")
123
		MODULE.info("   << LANG = '%s'" % self.locale)
124
		pp = pprint.PrettyPrinter(indent=4)
125
		st = pp.pformat(request.options).split("\n")
126
		for s in st:
127
			MODULE.info("   << %s" % s)
128
		# -----------------------------------
129
		
130
		result = self._running()
131
		request.status = SUCCESS
132
		
133
		# ---------- DEBUG --------------
134
		MODULE.info("join/running returns:")
135
		pp = pprint.PrettyPrinter(indent=4)
136
		st = pp.pformat(result).split("\n")
137
		for s in st:
138
			MODULE.info("   >> %s" % s)
139
		# --------------------------------
140
141
		self.finished(request.id,result)
142
143
	def logview(self,request):
144
		""" Frontend to the _logview() function: returns
145
			either the timestamp of the log file or
146
			some log lines.
147
		"""
148
		# ----------- DEBUG -----------------
149
		MODULE.info("join/logview invoked with:")
150
		MODULE.info("   << LANG = '%s'" % self.locale)
151
		pp = pprint.PrettyPrinter(indent=4)
152
		st = pp.pformat(request.options).split("\n")
153
		for s in st:
154
			MODULE.info("   << %s" % s)
155
		# -----------------------------------
156
		
157
		result = self._logview(int(request.options.get('count',10)))
158
		request.status = SUCCESS
159
		
160
		# ---------- DEBUG --------------
161
		# TODO: We should not repeat the whole log into
162
		# the module log file!
163
		MODULE.info("join/logview returns:")
164
		pp = pprint.PrettyPrinter(indent=4)
165
		st = pp.pformat(result).split("\n")
166
		for s in st:
167
			MODULE.info("   >> %s" % s)
168
		# --------------------------------
169
170
		self.finished(request.id,result)
171
112
	def join(self,request):
172
	def join(self,request):
113
		"""runs the 'univention-join' script for a unjoined system with
173
		"""runs the 'univention-join' script for a unjoined system with
114
		the given arguments."""
174
		the given arguments."""
 Lines 322-340    Link Here 
322
							next								# ... ignore this entry
382
							next								# ... ignore this entry
323
					files[fname]['last'] = version
383
					files[fname]['last'] = version
324
					if files[fname]['last'] < files[fname]['current']:
384
					if files[fname]['last'] < files[fname]['current']:
325
						files[fname]['icon'] = 'join-run'
326
						files[fname]['action'] = _('run')
385
						files[fname]['action'] = _('run')
327
						files[fname]['status'] = _('due')
386
						files[fname]['status'] = _('due')
328
					else:
387
					else:
329
						files[fname]['status'] = _('successful')
388
						files[fname]['status'] = _('successful')
330
						files[fname]['icon'] = 'join-success'
331
						files[fname]['action'] = ''
389
						files[fname]['action'] = ''
332
				else:
390
				else:
333
					MODULE.warn("  Script '%s' has no package" % fname)
391
					MODULE.warn("  Script '%s' has no package" % fname)
334
					e = {}
392
					e = {}
335
					e['script'] = fname
393
					e['script'] = fname
336
					e['status'] = _('not installed')
394
					e['status'] = _('not installed')
337
					e['icon'] = 'join-error'
338
					e['last'] = version
395
					e['last'] = version
339
					files[fname] = e
396
					files[fname] = e
340
		except Exception,ex:
397
		except Exception,ex:
 Lines 351-365    Link Here 
351
				entry['last'] = '--'
408
				entry['last'] = '--'
352
				if 'current' in entry:
409
				if 'current' in entry:
353
					entry['status'] = _('never run')
410
					entry['status'] = _('never run')
354
					entry['icon'] = 'join-run'
355
					entry['action'] = _('run')
411
					entry['action'] = _('run')
356
			# to avoid double expressions in the JS code, checking for
412
			# to avoid double expressions in the JS code, checking for
357
			# definedness and non-emptiness of strings: We set all empty
413
			# definedness and non-emptiness of strings: We set all empty
358
			# properties to the empty string.
414
			# properties to the empty string.
359
			if not 'action' in entry:
415
			if not 'action' in entry:
360
				entry['action'] = ''
416
				entry['action'] = ''
361
			if not 'icon' in entry:
362
				entry['icon'] = ''
363
			# Return only entries that have a 'current' property.
417
			# Return only entries that have a 'current' property.
364
			if 'current' in entry:
418
			if 'current' in entry:
365
				result.append(entry)
419
				result.append(entry)
(-)umc/js/de.po (-58 / +59 lines)
 Lines 1-10    Link Here 
1
# This file is auto-generated by the dh-umc tools and should not be edited!
1
# This file is auto-generated by the dh-umc tools and should not be edited!
2
#, fuzzy
3
msgid ""
2
msgid ""
4
msgstr ""
3
msgstr ""
5
"Project-Id-Version: univention-management-console-module-join\n"
4
"Project-Id-Version: univention-management-console-module-join\n"
6
"Report-Msgid-Bugs-To: packages@univention.de\n"
5
"Report-Msgid-Bugs-To: packages@univention.de\n"
7
"POT-Creation-Date: 2011-08-30 18:03+0200\n"
6
"POT-Creation-Date: 2011-10-05 18:14+0200\n"
8
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
7
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
9
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
10
"Language-Team: LANGUAGE <LL@li.org>\n"
9
"Language-Team: LANGUAGE <LL@li.org>\n"
 Lines 13-104    Link Here 
13
"Content-Type: text/plain; charset=UTF-8\n"
12
"Content-Type: text/plain; charset=UTF-8\n"
14
"Content-Transfer-Encoding: 8bit\n"
13
"Content-Transfer-Encoding: 8bit\n"
15
14
16
#: umc/js/join.js:396
15
#: umc/js/join.js:433
17
#, fuzzy, python-format
16
#, python-format
18
msgid "%d join scripts are currently running"
17
msgid "%d join scripts are currently running"
19
msgstr "Momentan werden %d Skripte ausgeführt."
18
msgstr "Momentan werden %d Skripte ausgeführt."
20
19
21
#: umc/js/join.js:357
20
#: umc/js/join.js:377
22
#, python-format
21
#, python-format
23
msgid "%d scripts are due to be run"
22
msgid "%d scripts are due to be run."
24
msgstr "Insgesamt können %d Skripte ausgeführt werden."
23
msgstr "Insgesamt können %d Skripte ausgeführt werden."
25
24
26
#: umc/js/join.js:348
25
#: umc/js/join.js:368
27
#, python-format
26
#, python-format
28
msgid "%d scripts selected"
27
msgid "%d scripts selected"
29
msgstr "%d Skripte ausgewählt"
28
msgstr "%d Skripte ausgewählt"
30
29
31
#: umc/js/join.js:597
30
#: umc/js/join.js:614
32
msgid "... loading log ..."
31
msgid "... loading log ..."
33
msgstr "... Protokoll wird geladen ..."
32
msgstr "... Protokoll wird geladen ..."
34
33
35
#: umc/js/join.js:347
34
#: umc/js/join.js:367
36
msgid "1 script selected"
35
msgid "1 script selected"
37
msgstr "1 Skript ausgewählt"
36
msgstr "1 Skript ausgewählt"
38
37
39
#: umc/js/join.js:479
38
#: umc/js/join.js:442 umc/js/join.js:711
40
msgid "Action"
41
msgstr "Aktion"
42
43
#: umc/js/join.js:404 umc/js/join.js:696
44
msgid "Can't start join: "
39
msgid "Can't start join: "
45
msgstr "Kann Join-Prozess nicht starten: "
40
msgstr "Kann Join-Prozess nicht starten: "
46
41
47
#: umc/js/join.js:428
42
#: umc/js/join.js:466
48
#, fuzzy
49
msgid "Current status"
43
msgid "Current status"
50
msgstr "Aktueller Status"
44
msgstr "Aktueller Status"
51
45
52
#: umc/js/join.js:455
46
#: umc/js/join.js:510
53
msgid "Current version"
47
msgid "Current<br/>version"
54
msgstr "Aktuelle Version"
48
msgstr "Aktuelle<br/>Version"
55
49
56
#: umc/js/join.js:258
50
#: umc/js/join.js:265
57
msgid ""
51
msgid ""
58
"Currently some join scripts are running. You may watch the log file until "
52
"Currently some join scripts are running. You may watch the log file until "
59
"they are finished."
53
"they are finished."
60
msgstr ""
54
msgstr ""
55
"Momentan werden Join-Skripte abgearbeitet. Sie können den Fortschritt im Log-"
56
"File verfolgen, bis der Vorgang abgeschlossen ist."
61
57
62
#: umc/js/join.js:720
58
#: umc/js/join.js:735
63
msgid "DC Hostname"
59
msgid "DC Hostname"
64
msgstr "Name des Domaincontroller-Computers"
60
msgstr "Name des Domaincontroller-Computers"
65
61
66
#: umc/js/join.js:161 umc/js/join.js:164
62
#: umc/js/join.js:482
63
msgid "Execute"
64
msgstr "Ausführen"
65
66
#: umc/js/join.js:483
67
msgid "Execute this join script"
68
msgstr "Diesen Join-Skript ausführen"
69
70
#: umc/js/join.js:165
67
msgid "Join Protocol"
71
msgid "Join Protocol"
68
msgstr "Protokoll aller Join-Skripte"
72
msgstr "Protokoll aller Join-Skripte"
69
73
70
#: umc/js/join.js:421
74
#: umc/js/join.js:459
71
msgid "Join status"
75
msgid "Join status"
72
msgstr "Join-Status"
76
msgstr "Join-Status"
73
77
74
#: umc/js/join.js:363
78
#: umc/js/join.js:389
75
msgid "Join status ok, nothing to do."
79
msgid "Join status ok, nothing to do."
76
msgstr ""
80
msgstr ""
77
"Domänenbeitritt ist komplett; es sind keine Skripte übrig, die ausgeführt "
81
"Domänenbeitritt ist komplett; es sind keine Skripte übrig, die ausgeführt "
78
"werden müßten."
82
"werden müßten."
79
83
80
#: umc/js/join.js:462
84
#: umc/js/join.js:517
81
msgid "Last version"
85
msgid "Last<br/>version"
82
msgstr "Letzte Version"
86
msgstr "Letzte<br/>Version"
83
87
84
#: umc/js/join.js:456
88
#: umc/js/join.js:511
85
msgid "Latest script version ready for execution"
89
msgid "Latest script version ready for execution"
86
msgstr "Neuester Skript, der ausgeführt werden kann"
90
msgstr "Neuester Skript, der ausgeführt werden kann"
87
91
88
#: umc/js/join.js:463
92
#: umc/js/join.js:518
89
msgid "Latest script version that was executed successfully"
93
msgid "Latest script version that was executed successfully"
90
msgstr "Letzter Skript, der erfolgreich ausgeführt wurde"
94
msgstr "Letzter Skript, der erfolgreich ausgeführt wurde"
91
95
92
#: umc/js/join.js:734
96
#: umc/js/join.js:429
97
msgid "One join script is currently running"
98
msgstr "Ein Skript wird momentan ausgeführt."
99
100
#: umc/js/join.js:380
101
msgid "One script is due to be run."
102
msgstr "Ein Skript steht zur Ausführung an."
103
104
#: umc/js/join.js:749
93
msgid "Password"
105
msgid "Password"
94
msgstr "Passwort"
106
msgstr "Passwort"
95
107
96
#: umc/js/join.js:735
108
#: umc/js/join.js:750
97
msgid "Password of the Domain Administrator"
109
msgid "Password of the Domain Administrator"
98
msgstr "Passwort des Domänen-Administrators"
110
msgstr "Passwort des Domänen-Administrators"
99
111
100
#: umc/js/join.js:714
112
#: umc/js/join.js:729
101
#, fuzzy
102
msgid ""
113
msgid ""
103
"Please enter the required information below and click the 'Start Join' "
114
"Please enter the required information below and click the 'Start Join' "
104
"button. This will join your system into the domain."
115
"button. This will join your system into the domain."
 Lines 107-146    Link Here 
107
"auf den Knopf 'Domänenbeitritt starten'. Dies gliedert Ihr System in die "
118
"auf den Knopf 'Domänenbeitritt starten'. Dies gliedert Ihr System in die "
108
"Domäne ein."
119
"Domäne ein."
109
120
110
#: umc/js/join.js:480
121
#: umc/js/join.js:503
111
msgid "Run this script if it's due or never run"
112
msgstr ""
113
114
#: umc/js/join.js:448
115
msgid "Script (package)"
122
msgid "Script (package)"
116
msgstr "Skript (Paket)"
123
msgstr "Skript (Paket)"
117
124
118
#: umc/js/join.js:449
125
#: umc/js/join.js:504
119
msgid "Script name (the same as the package it belongs to)"
126
msgid "Script name (the same as the package it belongs to)"
120
msgstr "Skriptname (benannt nach dem Paket, zu dem er gehört)"
127
msgstr "Skriptname (benannt nach dem Paket, zu dem er gehört)"
121
128
122
#: umc/js/join.js:683
129
#: umc/js/join.js:697
123
msgid "Start Join"
130
msgid "Start Join"
124
msgstr "Domänenbeitritt starten"
131
msgstr "Domänenbeitritt starten"
125
132
126
#: umc/js/join.js:470
133
#: umc/js/join.js:525
127
msgid "State"
134
msgid "State"
128
msgstr "Status"
135
msgstr "Status"
129
136
130
#: umc/js/join.js:471
137
#: umc/js/join.js:526
131
msgid "Status of this package"
138
msgid "Status of this package"
132
msgstr "Status dieses Paketes"
139
msgstr "Status dieses Paketes"
133
140
134
#: umc/js/join.js:721
141
#: umc/js/join.js:736
135
msgid "The hostname of the DC Master of the domain"
142
msgid "The hostname of the DC Master of the domain"
136
msgstr "Der Computername des Master-Domaincontrollers der Domäne"
143
msgstr "Der Computername des Master-Domaincontrollers der Domäne"
137
144
138
#: umc/js/join.js:728
145
#: umc/js/join.js:743
139
#, fuzzy
140
msgid "The username of the Domain Administrator"
146
msgid "The username of the Domain Administrator"
141
msgstr "Passwort des Domänen-Administrators"
147
msgstr "Nutzername des Domänen-Administrators"
142
148
143
#: umc/js/join.js:422
149
#: umc/js/join.js:460
144
msgid ""
150
msgid ""
145
"This page shows the status of all available join scripts on this system, "
151
"This page shows the status of all available join scripts on this system, "
146
"along with all join-related actions (run selected or all join scripts, or "
152
"along with all join-related actions (run selected or all join scripts, or "
 Lines 158-192    Link Here 
158
msgid "This system joined on %s"
164
msgid "This system joined on %s"
159
msgstr "Dieses System ist der Domäne am %s beigetreten."
165
msgstr "Dieses System ist der Domäne am %s beigetreten."
160
166
161
#: umc/js/join.js:727
167
#: umc/js/join.js:742
162
msgid "Username"
168
msgid "Username"
163
msgstr "Nutzername"
169
msgstr "Nutzername"
164
170
165
#: umc/js/join.js:617
171
#: umc/js/join.js:634
166
msgid "hide log"
172
msgid "hide log"
167
msgstr "Protokoll ausblenden"
173
msgstr "Protokoll ausblenden"
168
174
169
#: umc/js/join.js:169
175
#: umc/js/join.js:169
170
#, fuzzy
171
msgid "last {logcount} lines"
176
msgid "last {logcount} lines"
172
msgstr "letzte {logcount} Zeilen"
177
msgstr "letzte {logcount} Zeilen"
173
178
174
#: umc/js/join.js:358
179
#: umc/js/join.js:384
175
msgid "run all"
180
msgid "run all"
176
msgstr "Alle Skripte ausführen"
181
msgstr "Alle Skripte ausführen"
177
182
178
#: umc/js/join.js:350
183
#: umc/js/join.js:370
179
msgid "run selected scripts"
184
msgid "run selected scripts"
180
msgstr "Ausgewählte Skripte ausführen"
185
msgstr "Ausgewählte Skripte ausführen"
181
186
182
#: umc/js/join.js:624
187
#: umc/js/join.js:641
183
#, fuzzy
184
msgid "show all"
188
msgid "show all"
185
msgstr "Gesamtes Protokoll zeigen"
189
msgstr "Gesamtes Protokoll zeigen"
186
190
187
#: umc/js/join.js:609
191
#: umc/js/join.js:626
188
msgid "show log"
192
msgid "show log"
189
msgstr "Protokoll einblenden"
193
msgstr "Protokoll einblenden"
190
191
#~ msgid "Run this script"
192
#~ msgstr "Diesen Skript ausführen"
(-)umc/js/join.js (-218 / +247 lines)
 Lines 13-20    Link Here 
13
dojo.require("umc.widgets.ContainerForm");
13
dojo.require("umc.widgets.ContainerForm");
14
dojo.require("umc.widgets.Grid");
14
dojo.require("umc.widgets.Grid");
15
dojo.require("umc.widgets.TabbedModule");
15
dojo.require("umc.widgets.TabbedModule");
16
dojo.require("umc.widgets.StandbyMixin");
17
dojo.require("umc.modules._join.Form");
16
dojo.require("dojox.string.sprintf");
18
dojo.require("dojox.string.sprintf");
17
dojo.require("dojox.layout.TableContainer");
18
19
19
// Inheriting from umc.widgets.TabbedModule so any pages being added
20
// Inheriting from umc.widgets.TabbedModule so any pages being added
20
// will become tabs automatically.
21
// will become tabs automatically.
 Lines 22-28    Link Here 
22
23
23
	_page:				null,			// umc.widgets.Page
24
	_page:				null,			// umc.widgets.Page
24
	_content:			null,			// umc.widgets.ExpandingTitlePane
25
	_content:			null,			// umc.widgets.ExpandingTitlePane
25
	_split:				null,			// dijit.layout.BorderContainer
26
//	_split:				null,			// dijit.layout.BorderContainer
26
	_grid:				null,			// umc.widgets.Grid
27
	_grid:				null,			// umc.widgets.Grid
27
	_infotext:			null,
28
	_infotext:			null,
28
	
29
	
 Lines 48-54    Link Here 
48
	_job_running:		false,			// true while scripts are running
49
	_job_running:		false,			// true while scripts are running
49
	_polling_time:		1000,			// once per second
50
	_polling_time:		1000,			// once per second
50
	
51
	
51
	_grid_query:		{scope: 'scripts'},
52
	_grid_query:		{'*': '*'},		// all?
52
	
53
	
53
	idProperty:			'script',		// doesn't help with the sorting problem of selected rows
54
	idProperty:			'script',		// doesn't help with the sorting problem of selected rows
54
	i18nClass: 			'umc.modules.join',
55
	i18nClass: 			'umc.modules.join',
 Lines 60-66    Link Here 
60
	_switch_log_display: function(code) {
61
	_switch_log_display: function(code) {
61
		if (code == 'hide')
62
		if (code == 'hide')
62
		{
63
		{
63
			this._split.removeChild(this._logview);
64
			this._content.removeChild(this._logview);
64
			this._bottom.addChild(this._b_show);
65
			this._bottom.addChild(this._b_show);
65
			this._bottom.removeChild(this._b_hide);
66
			this._bottom.removeChild(this._b_hide);
66
			this._bottom.removeChild(this._b_full);
67
			this._bottom.removeChild(this._b_full);
 Lines 86-92    Link Here 
86
				this._refresh_log(true);
87
				this._refresh_log(true);
87
				this._bottom.addChild(this._b_hide);
88
				this._bottom.addChild(this._b_hide);
88
				this._bottom.addChild(this._b_full);
89
				this._bottom.addChild(this._b_full);
89
				this._split.addChild(this._logview);
90
				this._content.addChild(this._logview);
90
				this._logview.addChild(this._logtext);
91
				this._logview.addChild(this._logtext);
91
			}
92
			}
92
93
 Lines 96-104    Link Here 
96
	
97
	
97
	// gets the current join status and switches display mode if needed.
98
	// gets the current join status and switches display mode if needed.
98
	_check_join_status: function() {
99
	_check_join_status: function() {
99
		this.moduleStore.query({
100
		this.umcpCommand('join/joined').then(dojo.hitch(this, function(data) {
100
			scope: 'joined'
101
			var result = data.result;
101
		}).then(dojo.hitch(this, function(result) {
102
			if (result != this._joined)
102
			if (result != this._joined)
103
			{
103
			{
104
				this._joined = result;
104
				this._joined = result;
 Lines 106-124    Link Here 
106
				{
106
				{
107
					// show grid with join status, else....
107
					// show grid with join status, else....
108
					this._infotext.set('content',this._("This system joined on %s",result));
108
					this._infotext.set('content',this._("This system joined on %s",result));
109
					this._split.removeChild(this._joinpane);
109
					this._content.removeChild(this._joinpane);
110
					this._split.addChild(this._grid);
110
					this._content.addChild(this._grid);
111
					this._reload_grid();		// force grid reload
111
					this._reload_grid();		// force grid reload
112
				}
112
				}
113
				else
113
				else
114
				{
114
				{
115
					// show affordance to join, nothing more.
115
					// show affordance to join, nothing more.
116
					this._infotext.set('content',this._("This system has not been joined yet."));
116
					this._infotext.set('content',this._("This system has not been joined yet."));
117
					this._split.removeChild(this._grid);
117
					this._content.removeChild(this._grid);
118
					this._split.addChild(this._joinpane);
118
					this._content.addChild(this._joinpane);
119
				}
119
				}
120
			}
120
			}
121
		}));
121
		}),
122
		dojo.hitch(this, function(result) {
123
			console.error("check_join_status ERROR " + result.message);
124
		})
125
		);
122
	},
126
	},
123
	
127
	
124
	// Asynchronously invokes reload of the log lines display. Before fetching real data,
128
	// Asynchronously invokes reload of the log lines display. Before fetching real data,
 Lines 131-140    Link Here 
131
		}
135
		}
132
		else
136
		else
133
		{
137
		{
134
			this.moduleStore.query({
138
			this.umcpCommand('join/logview',{
135
				scope: 'logview',
136
				count: -1			// returns timestamp of log file
139
				count: -1			// returns timestamp of log file
137
			}).then(dojo.hitch(this,function(result) {
140
			}).then(dojo.hitch(this,function(data) {
141
				var result = data.result;
138
				if (result != this._log_stamp)
142
				if (result != this._log_stamp)
139
				{
143
				{
140
					this._log_stamp = result;	// yes I know, I should do that after it was reloaded
144
					this._log_stamp = result;	// yes I know, I should do that after it was reloaded
 Lines 154-169    Link Here 
154
	// log really changed.
158
	// log really changed.
155
	_fetch_log_text: function() {
159
	_fetch_log_text: function() {
156
		// now really fetch log file contents.
160
		// now really fetch log file contents.
157
		this.moduleStore.query({
161
		this.umcpCommand('join/logview',{
158
			scope: 'logview',
159
			count:	this._logcount
162
			count:	this._logcount
160
		}).then(dojo.hitch(this,function(result) {
163
		}).then(dojo.hitch(this,function(data) {
164
			var result = data.result;
161
			var txt = dojox.string.sprintf("<u><b>%s</b></u><br/>\n",this._("Join Protocol"));
165
			var txt = dojox.string.sprintf("<u><b>%s</b></u><br/>\n",this._("Join Protocol"));
162
166
163
			// this is for debugging so we can see the refresh
164
			//var txt = dojox.string.sprintf("<u><b>%s [%d]</b></u><br/>\n",this._("Join Protocol"),this._proto_gen);
165
			//this._proto_gen++;
166
		
167
			if (this._logcount)
167
			if (this._logcount)
168
			{
168
			{
169
				var tmp = this._("last {logcount} lines");
169
				var tmp = this._("last {logcount} lines");
 Lines 188-194    Link Here 
188
		// Establish refresh every second. We keep the last instance of our 'Deferred'
188
		// Establish refresh every second. We keep the last instance of our 'Deferred'
189
		// as an instance member this._refresh_job, thus avoiding to have more than one
189
		// as an instance member this._refresh_job, thus avoiding to have more than one
190
		// refresh running at any time.
190
		// refresh running at any time.
191
		if (! this._refresh_job)
191
		//
192
		// Added here: if this._refresh_time is set to zero we stop the timer.
193
		if ((! this._refresh_job) && (this._refresh_time))
192
		{
194
		{
193
	        var deferred = new dojo.Deferred();
195
	        var deferred = new dojo.Deferred();
194
	        this._refresh_job = deferred;
196
	        this._refresh_job = deferred;
 Lines 236-265    Link Here 
236
		{
238
		{
237
			// this query returns false as soon as the scripts are finished, and this
239
			// this query returns false as soon as the scripts are finished, and this
238
			// will avoid scheduling any new polling cycle.
240
			// will avoid scheduling any new polling cycle.
239
			this.moduleStore.query({
241
			this.umcpCommand('join/running').then(dojo.hitch(this, function(data) {
240
				scope: 'running'
242
				try
241
			}).then(dojo.hitch(this, function(result) {
242
				if (result != this._job_running)
243
				{
243
				{
244
					this._job_running = result;
244
					var result = data.result;
245
					this._check_join_status();	// switch between join form and script grid
245
					if (result != this._job_running)
246
					this._reload_grid();		// redo the status query for the grid, effectively triggering
247
												// _check_grid_status() on 'fetchComplete'
248
				}
249
				// for first display: if none of the two widgets (script grid or join form)
250
				// is displayed AND we run into a running job we have to do two things:
251
				//  (1) show a header text that explains the situation
252
				//	(2) switch log display on.
253
				if (this._job_running)
254
				{
255
					var txt = this._infotext.get('content');
256
					if (txt == '')
257
					{
246
					{
258
						this._infotext.set('content',this._("Currently some join scripts are running. You may watch the log file until they are finished."));
247
						this._job_running = result;
259
						this._switch_log_display('show');
248
						if (! result)
249
						{
250
							this._joinform.standby(false);
251
						}
252
						this._check_join_status();	// switch between join form and script grid
253
						this._reload_grid();		// redo the status query for the grid, effectively triggering
254
													// _check_grid_status() on 'fetchComplete'
260
					}
255
					}
256
					// for first display: if none of the two widgets (script grid or join form)
257
					// is displayed AND we run into a running job we have to do two things:
258
					//  (1) show a header text that explains the situation
259
					//	(2) switch log display on.
260
					if (this._job_running)
261
					{
262
						var txt = this._infotext.get('content');
263
						if (txt == '')
264
						{
265
							this._infotext.set('content',this._("Currently some join scripts are running. You may watch the log file until they are finished."));
266
							this._switch_log_display('show');
267
						}
268
					}
261
				}
269
				}
262
			}));
270
				catch(error)
271
				{
272
					console.error('job_polling_loop ERROR: ' + error.message);
273
				}
274
			}),
275
			dojo.hitch(this, function(result) {
276
				this._joinform.standby(false);
277
				this._grid.standby(false);
278
			})
279
			);
263
280
264
			// We should have exactly one such job. If one is underway, we don't
281
			// We should have exactly one such job. If one is underway, we don't
265
			// step on its feet. Otherwise, we start a new one.
282
			// step on its feet. Otherwise, we start a new one.
 Lines 293-369    Link Here 
293
310
294
	_check_grid_status: function() {
311
	_check_grid_status: function() {
295
		
312
		
296
		// While a job is running the grid is in standby() nevertheless, so it won't
313
		try
297
		// make sense to refresh it.
298
		if (this._job_running)
299
		{
314
		{
300
			return;
301
		}
302
				
303
		var runnable = 0;
304
		var selected = 0;
305
		this._runnables = [];
306
		var dup = {};
307
		
315
		
308
		for (var rowIndex=0; rowIndex < this._grid._grid.attr("rowCount"); rowIndex++)
316
			// While a job is running the grid is in standby() nevertheless, so it won't
309
		{
317
			// make sense to refresh it.
310
			var row = this._grid.getRowValues(rowIndex);
318
			if (this._job_running)
311
312
			// check against bug that duplicates data starting from the 26th row
313
			var fn = row['script'];
314
			if (typeof(dup[fn]) != 'undefined')
315
			{
319
			{
316
				this._reload_grid();
317
				return;
320
				return;
318
			}
321
			}
319
			dup[fn] = 1;
322
					
323
			var runnable = 0;
324
			var selected = 0;
325
			this._runnables = [];
326
			var dup = {};
320
			
327
			
321
			var allow = false;
328
			for (var rowIndex=0; rowIndex < this._grid._grid.attr("rowCount"); rowIndex++)
322
			if (row['action'] != '')
323
			{
329
			{
324
				runnable++;
330
				var row = this._grid.getRowValues(rowIndex);
325
				allow = true;
331
	
326
				this._runnables.push(row['script']);
332
				// check against bug that duplicates data starting from the 26th row
327
			}
333
				var fn = row['script'];
328
			if (this._grid._grid.selection.selected[rowIndex])
334
				if (typeof(dup[fn]) != 'undefined')
329
			{
330
				if (allow)
331
				{
335
				{
332
					selected++;
336
					this._reload_grid();
337
					return;
333
				}
338
				}
334
				else
339
				dup[fn] = 1;
340
				
341
				var allow = false;
342
				if (row['action'] != '')
335
				{
343
				{
336
					// Work around bug in the Grid base class: the 'select all' checkbox
344
					runnable++;
337
					// happily selects all rows, even if some of them are disabled!
345
					allow = true;
338
					this._grid._grid.rowSelectCell.toggleRow(rowIndex, false);
346
					this._runnables.push(row['script']);
339
				}
347
				}
348
				if (this._grid._grid.selection.selected[rowIndex])
349
				{
350
					if (allow)
351
					{
352
						selected++;
353
					}
354
					else
355
					{
356
						// Work around bug in the Grid base class: the 'select all' checkbox
357
						// happily selects all rows, even if some of them are disabled!
358
						this._grid._grid.rowSelectCell.toggleRow(rowIndex, false);
359
					}
360
				}
361
				this._grid._grid.rowSelectCell.setDisabled(rowIndex, ! allow);
362
				
340
			}
363
			}
341
			this._grid._grid.rowSelectCell.setDisabled(rowIndex, ! allow);
364
			if (selected)
342
			
343
		}
344
		if (selected)
345
		{
346
			var txt = (selected==1)?
347
					this._('1 script selected'):
348
					this._('%d scripts selected',selected);
349
			this._footers[0].set('content',txt);
350
			this._multi_action.set('label',this._('run selected scripts'));
351
			this._footers[1].addChild(this._multi_action);
352
		}
353
		else
354
		{
355
			if (runnable)
356
			{
365
			{
357
				this._footers[0].set('content',this._('%d scripts are due to be run',runnable));
366
				var txt = (selected==1)?
358
				this._multi_action.set('label',this._('run all'));
367
						this._('1 script selected'):
368
						this._('%d scripts selected',selected);
369
				this._footers[0].set('content',txt);
370
				this._multi_action.set('label',this._('run selected scripts'));
359
				this._footers[1].addChild(this._multi_action);
371
				this._footers[1].addChild(this._multi_action);
360
			}
372
			}
361
			else
373
			else
362
			{
374
			{
363
				this._footers[0].set('content',this._('Join status ok, nothing to do.'));
375
				if (runnable)
364
				this._footers[1].removeChild(this._multi_action);
376
				{
377
					var due = this._('%d scripts are due to be run.',runnable);
378
					if (runnable == 1)
379
					{
380
						due = this._("One script is due to be run.");
381
					}
382
					this._footers[0].set('content',due);
383
					
384
					this._multi_action.set('label',this._('run all'));
385
					this._footers[1].addChild(this._multi_action);
386
				}
387
				else
388
				{
389
					this._footers[0].set('content',this._('Join status ok, nothing to do.'));
390
					this._footers[1].removeChild(this._multi_action);
391
				}
365
			}
392
			}
366
		}
393
		}
394
		catch(error)
395
		{
396
			console.error("check grid status: " + error.message);
397
		}
367
	},
398
	},
368
	
399
	
369
	// Asynchronously runs the selected script(s).
400
	// Asynchronously runs the selected script(s).
 Lines 393-399    Link Here 
393
		{
424
		{
394
        	this._job_running = true;
425
        	this._job_running = true;
395
426
396
			this._footers[0].set('content',this._('%d join scripts are currently running',list.length));
427
        	if (list.length == 1)
428
        	{
429
        		this._footers[0].set('content',this._("One join script is currently running"));
430
        	}
431
        	else
432
        	{
433
        		this._footers[0].set('content',this._('%d join scripts are currently running',list.length));
434
        	}
397
			this._footers[1].removeChild(this._multi_action);
435
			this._footers[1].removeChild(this._multi_action);
398
		
436
		
399
	        this.umcpCommand('join/run',{scripts: list}).then(dojo.hitch(this, function(data) {
437
	        this.umcpCommand('join/run',{scripts: list}).then(dojo.hitch(this, function(data) {
 Lines 432-468    Link Here 
432
		// Trying to give the user a chance to resize the grid <-> logview ratio.
470
		// Trying to give the user a chance to resize the grid <-> logview ratio.
433
		// Even a simple BorderContainer is able to do that: just give some of its
471
		// Even a simple BorderContainer is able to do that: just give some of its
434
		// children a 'splitter: true' property.
472
		// children a 'splitter: true' property.
435
		this._split = new dijit.layout.BorderContainer({
436
		});
437
		this._content.addChild(this._split);
438
		
473
		
439
		this._grid = new umc.widgets.Grid({
474
		this._grid = new umc.widgets.Grid({
440
			region:			'center',
475
			region:			'center',
441
			moduleStore:	this.moduleStore,
476
			moduleStore:	umc.store.getModuleStore('script','join/scripts'),
442
			//query:			{scope: 'scripts'},
477
			// query:			this._grid_query,		// why?
443
			actions:		{},
478
			actions:
479
			[
480
	         	{
481
	                name:				'run',
482
	                label:				this._( 'Execute' ),
483
	                description:		this._( 'Execute this join script' ),
484
	                isContextAction:	true,
485
	                isStandardAction:	true,
486
	            	canExecute: dojo.hitch(this, function(values) {
487
	            		// Knowledge is in the Python module!
488
	            		return (values['action'] != '');
489
	            	}),
490
	                callback: dojo.hitch(this, function(id) {
491
	            		if (dojo.isArray(id))
492
	            		{
493
	            			id = id[0];
494
	            		}
495
	                	this._run_scripts([id]);
496
	                })
497
	            }
498
			],
444
			columns:
499
			columns:
445
			[
500
			[
446
				{
501
				{
447
					name:			'script',
502
					name:			'script',
448
					label:			this._("Script (package)"),
503
					label:			this._("Script (package)"),
449
					description:	this._("Script name (the same as the package it belongs to)"),
504
					description:	this._("Script name (the same as the package it belongs to)"),
450
					editable:		false,
505
					editable:		false
451
					width:			'40%'
506
//					width:			'50%'
452
				},
507
				},
453
				{
508
				{
454
					name:			'current',
509
					name:			'current',
455
					label:			this._("Current version"),
510
					label:			this._("Current<br/>version"),
456
					description:	this._("Latest script version ready for execution"),
511
					description:	this._("Latest script version ready for execution"),
457
					editable:		false,
512
					editable:		false,
458
					width:			'14%'
513
					width:			'adjust'
459
				},
514
				},
460
				{
515
				{
461
					name:			'last',
516
					name:			'last',
462
					label:			this._("Last version"),
517
					label:			this._("Last<br/>version"),
463
					description:	this._("Latest script version that was executed successfully"),
518
					description:	this._("Latest script version that was executed successfully"),
464
					editable:		false,
519
					editable:		false,
465
					width:			'14%'
520
					width:			'adjust'
466
				},
521
				},
467
				// Status column. Currently only text.
522
				// Status column. Currently only text.
468
				{
523
				{
 Lines 470-514    Link Here 
470
					label:			this._("State"),
525
					label:			this._("State"),
471
					description:	this._("Status of this package"),
526
					description:	this._("Status of this package"),
472
					editable:		false,
527
					editable:		false,
473
					width:			'12%'
528
					width:			'14%'
474
					// iconField:		'icon'		// deactivated (for now)
475
				},
476
				// Action field
477
				{
478
					name:			'action',
479
					label:			this._("Action"),
480
					description:	this._("Run this script if it's due or never run"),
481
					sortable:		false,
482
					editable:		false,
483
					width:			'10%',
484
					// We turn the value of the field into an action button that will
485
					// invoke the script named by the 'script' field of this row
486
	                formatter: dojo.hitch(this, function(key, rowIndex) {
487
	                	// key = the value of the field, in our case empty or 'run'
488
	                	// rowIndex = needed to retrieve the script name
489
	                	try
490
	                	{
491
	                		if (key != '')
492
	                		{
493
			                	var tmp = this._grid.getRowValues(rowIndex);
494
			                    var script = tmp.script;
495
			                	return new umc.widgets.Button({
496
			                		label:		key,
497
			                		// FIXME style this button by a reasonable CSS class or such.
498
			                		style:		'border:outset 1px;background-color:#A0A0A0;margin:0px;padding:0px;',
499
			                		//'class':	'umcSubmitButton',		// doesn't work, unfortunately.
500
			            			onClick:	dojo.hitch(this, function() {
501
			            				this._run_scripts([script]);
502
			            			})
503
			                	});
504
	                		}
505
	                		return '';
506
	                	}
507
	                	catch(err)
508
	                	{
509
	                    	return '';
510
	                	}
511
	                })
512
				}
529
				}
513
			]
530
			]
514
		});
531
		});
 Lines 655-665    Link Here 
655
			scrollable:		false,
672
			scrollable:		false,
656
			style:			'border:none;'
673
			style:			'border:none;'
657
		});
674
		});
658
		this._split.addChild(info);
675
		this._content.addChild(info);
659
		
676
		
660
		this._infotext = new umc.widgets.Text({
677
		this._infotext = new umc.widgets.Text({
661
			style:			'border:none;margin:.2em;',
678
			style:			'border:none;margin:.2em;',
662
			content:		'',
679
			content:		''
663
		});
680
		});
664
		info.addChild(this._infotext);
681
		info.addChild(this._infotext);
665
		
682
		
 Lines 668-750    Link Here 
668
		// password and for starting the join process. This form is prepared here and stored
685
		// password and for starting the join process. This form is prepared here and stored
669
		// into the this._joinpane variable. The _check_join_status() method will decide
686
		// into the this._joinpane variable. The _check_join_status() method will decide
670
		// which view is to show.
687
		// which view is to show.
671
		this._joinpane = new dojox.layout.TableContainer({
688
		this._joinpane = new umc.widgets.ContainerWidget({
672
			region:				'center',
689
			region:				'center',
673
			cols:				1,
690
			scrollable:			true
674
			style:				'width:50%;',
675
			showLabels:			false
676
		});
691
		});
677
		this._joinform = new umc.widgets.Form({
692
		var buttons = 
678
			scrollable:			true,
693
		[
679
			buttons:
694
			{
680
			[
695
				type:			'submit',
681
				{
696
				'default':		true,
682
					type:			'submit',
697
				label:			this._("Start Join"),
683
					label:			this._("Start Join"),
698
				onClick:		dojo.hitch(this, function() {
684
					onClick:		dojo.hitch(this, function() {
699
					this._joinform.standby(true);
685
						//this._joinform.standby(true);
700
					this._switch_log_display('show');
686
						this._switch_log_display('show');
701
			        this.umcpCommand('join/join',{
687
				        this.umcpCommand('join/join',{
702
						host: this._joinform._widgets['host'].value,
688
							host: this._joinform._widgets['host'].value,
703
						user: this._joinform._widgets['user'].value,
689
							user: this._joinform._widgets['user'].value,
704
						pass: this._joinform._widgets['pass'].value				        	
690
							pass: this._joinform._widgets['pass'].value				        	
705
			        }).then(dojo.hitch(this, function(data) {
691
				        }).then(dojo.hitch(this, function(data) {
706
			        	var result = dojo.getObject('result', false, data);
692
				        	var result = dojo.getObject('result', false, data);
707
			        	if (result != '')
693
				        	if (result != '')
708
			        	{
694
				        	{
709
			        		this._joinform.standby(false);
695
				        		// Note result is already localized
710
			        		// Note result is already localized
696
				        		umc.dialog.alert(this._("Can't start join: ") + result);
711
			        		umc.dialog.alert(this._("Can't start join: ") + result);
697
					        	this._check_join_status();		// sets meaningful messages
712
				        	this._check_join_status();		// sets meaningful messages
698
				        	}
713
			        	}
699
				        	else
714
			        	else
700
				        	{
715
			        	{
701
				        		// Job is started. Now wait for its completion.
716
			        		// Job is started. Now wait for its completion.
702
				        		this._job_polling_loop(true);
717
			        		this._job_polling_loop(true);
703
				        	}
718
			        	}
704
				        }));
719
			        }));
705
					})
720
				})
706
				}
721
			}
707
			],
722
		];
708
			widgets:
723
		var widgets = 
709
			[
724
		[
710
				{
725
			{
711
					type:			'Text',
726
				type:			'Text',
712
					name:			'text',
727
				name:			'text',
713
					style:			'margin-top:1em;margin-bottom:1em;',
728
				style:			'margin-top:1em;margin-bottom:1em;',
714
					content:		this._("Please enter the required information below and click the 'Start Join' button. This will join your system into the domain.")
729
				content:		this._("Please enter the required information below and click the 'Start Join' button. This will join your system into the domain.")
715
				},
730
			},
716
				{
731
			{
717
					type:			'TextBox',
732
				type:			'TextBox',
718
					name:			'host',
733
				name:			'host',
719
					value:			'',
734
				value:			'',
720
					label:			this._('DC Hostname'),
735
				label:			this._('DC Hostname'),
721
					description:	this._('The hostname of the DC Master of the domain')
736
				description:	this._('The hostname of the DC Master of the domain')
722
				},
737
			},
723
				{
738
			{
724
					type:			'TextBox',
739
				type:			'TextBox',
725
					name:			'user',
740
				name:			'user',
726
					value:			'Administrator',
741
				value:			'Administrator',
727
					label:			this._('Username'),
742
				label:			this._('Username'),
728
					description:	this._('The username of the Domain Administrator')
743
				description:	this._('The username of the Domain Administrator')
729
				},
744
			},
730
				{
745
			{
731
					type:		'PasswordBox',
746
				type:		'PasswordBox',
732
					name:		'pass',
747
				name:		'pass',
733
					value:		'',
748
				value:		'',
734
					label: this._( 'Password' ),
749
				label: this._( 'Password' ),
735
					description: this._( 'Password of the Domain Administrator' )
750
				description: this._( 'Password of the Domain Administrator' )
736
				}
751
			}
737
			]
752
		];
753
		this._joinform = new umc.modules._join.Form({
754
			buttons:	buttons,
755
			widgets:	widgets
738
		});
756
		});
739
		this._joinpane.addChild(this._joinform);
757
		this._joinpane.addChild(this._joinform);
758
	},
759
	
760
	startup: function() {
740
		
761
		
762
		this.inherited(arguments);
763
741
		// All display elements exist. Now we check what we have to display.
764
		// All display elements exist. Now we check what we have to display.
742
		// This is done by checking once for a running job (at the Python side)
765
		// This is done by checking once for a running job (at the Python side)
743
		// and setting the display accordingly. The polling loop itself will then
766
		// and setting the display accordingly. The polling loop itself will then
744
		// establish triggers that change display if the current job is finished.
767
		// establish triggers that change display if the current job is finished.
745
		this._job_polling_loop(true);
768
		this._job_polling_loop(true);
746
				
747
		this._page.startup();		// start event loop and data gathering
748
		
769
		
749
	}	
770
	},
771
	
772
	uninitialize: function() {
773
		
774
		this.inherited(arguments);
775
		this._refresh_time = 0;
776
		
777
	}
778
	
750
});
779
});
(-)umc/join.xml (-2 / +11 lines)
 Lines 6-17    Link Here 
6
	<categories>
6
	<categories>
7
	  <category name="system"/>
7
	  <category name="system"/>
8
	</categories>
8
	</categories>
9
	<command name="join/query" function="query">
9
	<!-- should be used only for the grid, so no arg is needed -->
10
		<attribute name="scope" syntax="Join-Query-Scope"/>
10
	<command name="join/scripts/query" function="query">
11
		<attribute name="script" syntax="String"/>
11
	</command>
12
	</command>
13
	<!-- Status queries, distinct URLs now -->
14
	<command name="join/logview" function="logview">
15
		<attribute name="count" syntax="Integer"/>
16
	</command>
17
	<command name="join/joined" function="joined"/>
18
	<command name="join/running" function="running"/>
19
	<!-- run one or more script(s) -->
12
	<command name="join/run" function="run">
20
	<command name="join/run" function="run">
13
		<attribute name="scripts" syntax="Join-Run-Scripts"/>
21
		<attribute name="scripts" syntax="Join-Run-Scripts"/>
14
	</command>
22
	</command>
23
	<!-- do a domain join -->
15
	<command name="join/join" function="join">
24
	<command name="join/join" function="join">
16
		<attribute name="host" syntax="String"/>
25
		<attribute name="host" syntax="String"/>
17
		<attribute name="user" syntax="String"/>
26
		<attribute name="user" syntax="String"/>

Return to bug 23701