VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmin.py@ 61422

Last change on this file since 61422 was 61422, checked in by vboxsync, 9 years ago

wuimain.py,wuiadmin.py: Cleanup / load optimization.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 59.9 KB
Line 
1# -*- coding: utf-8 -*-
2# $Id: wuiadmin.py 61422 2016-06-02 22:47:32Z vboxsync $
3
4"""
5Test Manager Core - WUI - Admin Main page.
6"""
7
8__copyright__ = \
9"""
10Copyright (C) 2012-2015 Oracle Corporation
11
12This file is part of VirtualBox Open Source Edition (OSE), as
13available from http://www.virtualbox.org. This file is free software;
14you can redistribute it and/or modify it under the terms of the GNU
15General Public License (GPL) as published by the Free Software
16Foundation, in version 2 as it comes in the "COPYING" file of the
17VirtualBox OSE distribution. VirtualBox OSE is distributed in the
18hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
19
20The contents of this file may alternatively be used under the terms
21of the Common Development and Distribution License Version 1.0
22(CDDL) only, as it comes in the "COPYING.CDDL" file of the
23VirtualBox OSE distribution, in which case the provisions of the
24CDDL are applicable instead of those of the GPL.
25
26You may elect to license modified versions of this file under the
27terms and conditions of either the GPL or the CDDL or both.
28"""
29__version__ = "$Revision: 61422 $"
30
31
32# Standard python imports.
33import cgitb;
34import sys;
35
36# Validation Kit imports.
37from common import webutils
38from testmanager import config;
39from testmanager.webui.wuibase import WuiDispatcherBase, WuiException
40
41
42class WuiAdmin(WuiDispatcherBase):
43 """
44 WUI Admin main page.
45 """
46
47 ## The name of the script.
48 ksScriptName = 'admin.py'
49
50
51 ## @name Actions
52 ## @{
53 ksActionSystemLogList = 'SystemLogList'
54
55 ksActionUserList = 'UserList'
56 ksActionUserAdd = 'UserAdd'
57 ksActionUserEdit = 'UserEdit'
58 ksActionUserAddPost = 'UserAddPost'
59 ksActionUserEditPost = 'UserEditPost'
60 ksActionUserDelPost = 'UserDelPost'
61
62 ksActionTestBoxList = 'TestBoxList'
63 ksActionTestBoxListPost = 'TestBoxListPost'
64 ksActionTestBoxAdd = 'TestBoxAdd'
65 ksActionTestBoxAddPost = 'TestBoxAddPost'
66 ksActionTestBoxEdit = 'TestBoxEdit'
67 ksActionTestBoxEditPost = 'TestBoxEditPost'
68 ksActionTestBoxDetails = 'TestBoxDetails'
69 ksActionTestBoxRemovePost = 'TestBoxRemove'
70 ksActionTestBoxesRegenQueues = 'TestBoxesRegenQueues';
71
72 ksActionTestCaseList = 'TestCaseList'
73 ksActionTestCaseAdd = 'TestCaseAdd'
74 ksActionTestCaseAddPost = 'TestCaseAddPost'
75 ksActionTestCaseClone = 'TestCaseClone'
76 ksActionTestCaseDetails = 'TestCaseDetails'
77 ksActionTestCaseEdit = 'TestCaseEdit'
78 ksActionTestCaseEditPost = 'TestCaseEditPost'
79 ksActionTestCaseDoRemove = 'TestCaseDoRemove'
80
81 ksActionGlobalRsrcShowAll = 'GlobalRsrcShowAll'
82 ksActionGlobalRsrcShowAdd = 'GlobalRsrcShowAdd'
83 ksActionGlobalRsrcShowEdit = 'GlobalRsrcShowEdit'
84 ksActionGlobalRsrcAdd = 'GlobalRsrcAddPost'
85 ksActionGlobalRsrcEdit = 'GlobalRsrcEditPost'
86 ksActionGlobalRsrcDel = 'GlobalRsrcDelPost'
87
88 ksActionBuildList = 'BuildList'
89 ksActionBuildAdd = 'BuildAdd'
90 ksActionBuildAddPost = 'BuildAddPost'
91 ksActionBuildClone = 'BuildClone'
92 ksActionBuildDetails = 'BuildDetails'
93 ksActionBuildDoRemove = 'BuildDoRemove'
94 ksActionBuildEdit = 'BuildEdit'
95 ksActionBuildEditPost = 'BuildEditPost'
96
97 ksActionBuildBlacklist = 'BuildBlacklist';
98 ksActionBuildBlacklistAdd = 'BuildBlacklistAdd';
99 ksActionBuildBlacklistAddPost = 'BuildBlacklistAddPost';
100 ksActionBuildBlacklistClone = 'BuildBlacklistClone';
101 ksActionBuildBlacklistDetails = 'BuildBlacklistDetails';
102 ksActionBuildBlacklistDoRemove = 'BuildBlacklistDoRemove';
103 ksActionBuildBlacklistEdit = 'BuildBlacklistEdit';
104 ksActionBuildBlacklistEditPost = 'BuildBlacklistEditPost';
105
106 ksActionFailureCategoryList = 'FailureCategoryList';
107 ksActionFailureCategoryAdd = 'FailureCategoryAdd';
108 ksActionFailureCategoryAddPost = 'FailureCategoryAddPost';
109 ksActionFailureCategoryDetails = 'FailureCategoryDetails';
110 ksActionFailureCategoryDoRemove = 'FailureCategoryDoRemove';
111 ksActionFailureCategoryEdit = 'FailureCategoryEdit';
112 ksActionFailureCategoryEditPost = 'FailureCategoryEditPost';
113
114 ksActionFailureReasonList = 'FailureReasonList'
115 ksActionFailureReasonAdd = 'FailureReasonAdd'
116 ksActionFailureReasonAddPost = 'FailureReasonAddPost'
117 ksActionFailureReasonDetails = 'FailureReasonDetails'
118 ksActionFailureReasonDoRemove = 'FailureReasonDoRemove'
119 ksActionFailureReasonEdit = 'FailureReasonEdit'
120 ksActionFailureReasonEditPost = 'FailureReasonEditPost'
121
122 ksActionBuildSrcList = 'BuildSrcList'
123 ksActionBuildSrcAdd = 'BuildSrcAdd'
124 ksActionBuildSrcAddPost = 'BuildSrcAddPost'
125 ksActionBuildSrcClone = 'BuildSrcClone'
126 ksActionBuildSrcDetails = 'BuildSrcDetails'
127 ksActionBuildSrcEdit = 'BuildSrcEdit'
128 ksActionBuildSrcEditPost = 'BuildSrcEditPost'
129 ksActionBuildSrcDoRemove = 'BuildSrcDoRemove'
130
131 ksActionBuildCategoryList = 'BuildCategoryList'
132 ksActionBuildCategoryAdd = 'BuildCategoryAdd'
133 ksActionBuildCategoryAddPost = 'BuildCategoryAddPost'
134 ksActionBuildCategoryClone = 'BuildCategoryClone';
135 ksActionBuildCategoryDetails = 'BuildCategoryDetails';
136 ksActionBuildCategoryDoRemove = 'BuildCategoryDoRemove';
137
138 ksActionTestGroupList = 'TestGroupList'
139 ksActionTestGroupAdd = 'TestGroupAdd'
140 ksActionTestGroupAddPost = 'TestGroupAddPost'
141 ksActionTestGroupClone = 'TestGroupClone'
142 ksActionTestGroupDetails = 'TestGroupDetails'
143 ksActionTestGroupDoRemove = 'TestGroupDoRemove'
144 ksActionTestGroupEdit = 'TestGroupEdit'
145 ksActionTestGroupEditPost = 'TestGroupEditPost'
146 ksActionTestCfgRegenQueues = 'TestCfgRegenQueues'
147
148 ksActionSchedGroupList = 'SchedGroupList'
149 ksActionSchedGroupAdd = 'SchedGroupAdd';
150 ksActionSchedGroupAddPost = 'SchedGroupAddPost';
151 ksActionSchedGroupClone = 'SchedGroupClone';
152 ksActionSchedGroupDetails = 'SchedGroupDetails';
153 ksActionSchedGroupDoRemove = 'SchedGroupDel';
154 ksActionSchedGroupEdit = 'SchedGroupEdit';
155 ksActionSchedGroupEditPost = 'SchedGroupEditPost';
156 ## @}
157
158 def __init__(self, oSrvGlue): # pylint: disable=too-many-locals,too-many-statements
159 WuiDispatcherBase.__init__(self, oSrvGlue, self.ksScriptName);
160 self._sTemplate = 'template.html';
161
162
163 #
164 # System Log actions.
165 #
166 self._dDispatch[self.ksActionSystemLogList] = self._actionSystemLogList;
167
168 #
169 # User Account actions.
170 #
171 self._dDispatch[self.ksActionUserList] = self._actionUserList;
172 self._dDispatch[self.ksActionUserAdd] = self._actionUserAdd;
173 self._dDispatch[self.ksActionUserEdit] = self._actionUserEdit;
174 self._dDispatch[self.ksActionUserAddPost] = self._actionUserAddPost;
175 self._dDispatch[self.ksActionUserEditPost] = self._actionUserEditPost;
176 self._dDispatch[self.ksActionUserDelPost] = self._actionUserDelPost;
177
178 #
179 # TestBox actions.
180 #
181 self._dDispatch[self.ksActionTestBoxList] = self._actionTestBoxList;
182 self._dDispatch[self.ksActionTestBoxListPost] = self._actionTestBoxListPost;
183 self._dDispatch[self.ksActionTestBoxAdd] = self._actionTestBoxAdd;
184 self._dDispatch[self.ksActionTestBoxAddPost] = self._actionTestBoxAddPost;
185 self._dDispatch[self.ksActionTestBoxDetails] = self._actionTestBoxDetails;
186 self._dDispatch[self.ksActionTestBoxEdit] = self._actionTestBoxEdit;
187 self._dDispatch[self.ksActionTestBoxEditPost] = self._actionTestBoxEditPost;
188 self._dDispatch[self.ksActionTestBoxRemovePost] = self._actionTestBoxRemovePost;
189 self._dDispatch[self.ksActionTestBoxesRegenQueues] = self._actionRegenQueuesCommon;
190
191 #
192 # Test Case actions.
193 #
194 self._dDispatch[self.ksActionTestCaseList] = self._actionTestCaseList;
195 self._dDispatch[self.ksActionTestCaseAdd] = self._actionTestCaseAdd;
196 self._dDispatch[self.ksActionTestCaseAddPost] = self._actionTestCaseAddPost;
197 self._dDispatch[self.ksActionTestCaseClone] = self._actionTestCaseClone;
198 self._dDispatch[self.ksActionTestCaseDetails] = self._actionTestCaseDetails;
199 self._dDispatch[self.ksActionTestCaseEdit] = self._actionTestCaseEdit;
200 self._dDispatch[self.ksActionTestCaseEditPost] = self._actionTestCaseEditPost;
201 self._dDispatch[self.ksActionTestCaseDoRemove] = self._actionTestCaseDoRemove;
202
203 #
204 # Global Resource actions
205 #
206 self._dDispatch[self.ksActionGlobalRsrcShowAll] = self._actionGlobalRsrcShowAll;
207 self._dDispatch[self.ksActionGlobalRsrcShowAdd] = self._actionGlobalRsrcShowAdd;
208 self._dDispatch[self.ksActionGlobalRsrcShowEdit] = self._actionGlobalRsrcShowEdit;
209 self._dDispatch[self.ksActionGlobalRsrcAdd] = self._actionGlobalRsrcAdd;
210 self._dDispatch[self.ksActionGlobalRsrcEdit] = self._actionGlobalRsrcEdit;
211 self._dDispatch[self.ksActionGlobalRsrcDel] = self._actionGlobalRsrcDel;
212
213 #
214 # Build Source actions
215 #
216 self._dDispatch[self.ksActionBuildSrcList] = self._actionBuildSrcList;
217 self._dDispatch[self.ksActionBuildSrcAdd] = self._actionBuildSrcAdd;
218 self._dDispatch[self.ksActionBuildSrcAddPost] = self._actionBuildSrcAddPost;
219 self._dDispatch[self.ksActionBuildSrcClone] = self._actionBuildSrcClone;
220 self._dDispatch[self.ksActionBuildSrcDetails] = self._actionBuildSrcDetails;
221 self._dDispatch[self.ksActionBuildSrcDoRemove] = self._actionBuildSrcDoRemove;
222 self._dDispatch[self.ksActionBuildSrcEdit] = self._actionBuildSrcEdit;
223 self._dDispatch[self.ksActionBuildSrcEditPost] = self._actionBuildSrcEditPost;
224
225 #
226 # Build actions
227 #
228 self._dDispatch[self.ksActionBuildList] = self._actionBuildList;
229 self._dDispatch[self.ksActionBuildAdd] = self._actionBuildAdd;
230 self._dDispatch[self.ksActionBuildAddPost] = self._actionBuildAddPost;
231 self._dDispatch[self.ksActionBuildClone] = self._actionBuildClone;
232 self._dDispatch[self.ksActionBuildDetails] = self._actionBuildDetails;
233 self._dDispatch[self.ksActionBuildDoRemove] = self._actionBuildDoRemove;
234 self._dDispatch[self.ksActionBuildEdit] = self._actionBuildEdit;
235 self._dDispatch[self.ksActionBuildEditPost] = self._actionBuildEditPost;
236
237 #
238 # Build Black List actions
239 #
240 self._dDispatch[self.ksActionBuildBlacklist] = self._actionBuildBlacklist;
241 self._dDispatch[self.ksActionBuildBlacklistAdd] = self._actionBuildBlacklistAdd;
242 self._dDispatch[self.ksActionBuildBlacklistAddPost] = self._actionBuildBlacklistAddPost;
243 self._dDispatch[self.ksActionBuildBlacklistClone] = self._actionBuildBlacklistClone;
244 self._dDispatch[self.ksActionBuildBlacklistDetails] = self._actionBuildBlacklistDetails;
245 self._dDispatch[self.ksActionBuildBlacklistDoRemove] = self._actionBuildBlacklistDoRemove;
246 self._dDispatch[self.ksActionBuildBlacklistEdit] = self._actionBuildBlacklistEdit;
247 self._dDispatch[self.ksActionBuildBlacklistEditPost] = self._actionBuildBlacklistEditPost;
248
249 #
250 # Failure Category actions
251 #
252 self._dDispatch[self.ksActionFailureCategoryList] = self._actionFailureCategoryList;
253 self._dDispatch[self.ksActionFailureCategoryAdd] = self._actionFailureCategoryAdd;
254 self._dDispatch[self.ksActionFailureCategoryAddPost] = self._actionFailureCategoryAddPost;
255 self._dDispatch[self.ksActionFailureCategoryDetails] = self._actionFailureCategoryDetails;
256 self._dDispatch[self.ksActionFailureCategoryDoRemove] = self._actionFailureCategoryDoRemove;
257 self._dDispatch[self.ksActionFailureCategoryEdit] = self._actionFailureCategoryEdit;
258 self._dDispatch[self.ksActionFailureCategoryEditPost] = self._actionFailureCategoryEditPost;
259
260 #
261 # Failure Reason actions
262 #
263 self._dDispatch[self.ksActionFailureReasonList] = self._actionFailureReasonList;
264 self._dDispatch[self.ksActionFailureReasonAdd] = self._actionFailureReasonAdd;
265 self._dDispatch[self.ksActionFailureReasonAddPost] = self._actionFailureReasonAddPost;
266 self._dDispatch[self.ksActionFailureReasonDetails] = self._actionFailureReasonDetails;
267 self._dDispatch[self.ksActionFailureReasonDoRemove] = self._actionFailureReasonDoRemove;
268 self._dDispatch[self.ksActionFailureReasonEdit] = self._actionFailureReasonEdit;
269 self._dDispatch[self.ksActionFailureReasonEditPost] = self._actionFailureReasonEditPost;
270
271 #
272 # Build Category actions
273 #
274 self._dDispatch[self.ksActionBuildCategoryList] = self._actionBuildCategoryList;
275 self._dDispatch[self.ksActionBuildCategoryAdd] = self._actionBuildCategoryAdd;
276 self._dDispatch[self.ksActionBuildCategoryAddPost] = self._actionBuildCategoryAddPost;
277 self._dDispatch[self.ksActionBuildCategoryClone] = self._actionBuildCategoryClone;
278 self._dDispatch[self.ksActionBuildCategoryDetails] = self._actionBuildCategoryDetails;
279 self._dDispatch[self.ksActionBuildCategoryDoRemove] = self._actionBuildCategoryDoRemove;
280
281 #
282 # Test Group actions
283 #
284 self._dDispatch[self.ksActionTestGroupList] = self._actionTestGroupList;
285 self._dDispatch[self.ksActionTestGroupAdd] = self._actionTestGroupAdd;
286 self._dDispatch[self.ksActionTestGroupAddPost] = self._actionTestGroupAddPost;
287 self._dDispatch[self.ksActionTestGroupClone] = self._actionTestGroupClone;
288 self._dDispatch[self.ksActionTestGroupDetails] = self._actionTestGroupDetails;
289 self._dDispatch[self.ksActionTestGroupEdit] = self._actionTestGroupEdit;
290 self._dDispatch[self.ksActionTestGroupEditPost] = self._actionTestGroupEditPost;
291 self._dDispatch[self.ksActionTestGroupDoRemove] = self._actionTestGroupDoRemove;
292 self._dDispatch[self.ksActionTestCfgRegenQueues] = self._actionRegenQueuesCommon;
293
294 #
295 # Scheduling Group actions
296 #
297 self._dDispatch[self.ksActionSchedGroupList] = self._actionSchedGroupList;
298 self._dDispatch[self.ksActionSchedGroupAdd] = self._actionSchedGroupAdd;
299 self._dDispatch[self.ksActionSchedGroupClone] = self._actionSchedGroupClone;
300 self._dDispatch[self.ksActionSchedGroupDetails] = self._actionSchedGroupDetails;
301 self._dDispatch[self.ksActionSchedGroupEdit] = self._actionSchedGroupEdit;
302 self._dDispatch[self.ksActionSchedGroupAddPost] = self._actionSchedGroupAddPost;
303 self._dDispatch[self.ksActionSchedGroupEditPost] = self._actionSchedGroupEditPost;
304 self._dDispatch[self.ksActionSchedGroupDoRemove] = self._actionSchedGroupDoRemove;
305
306
307 #
308 # Menus
309 #
310 self._aaoMenus = \
311 [
312 [
313 'Builds', self._sActionUrlBase + self.ksActionBuildList,
314 [
315 [ 'Builds', self._sActionUrlBase + self.ksActionBuildList ],
316 [ 'Blacklist', self._sActionUrlBase + self.ksActionBuildBlacklist ],
317 [ 'Build Sources', self._sActionUrlBase + self.ksActionBuildSrcList ],
318 [ 'Build Categories', self._sActionUrlBase + self.ksActionBuildCategoryList ],
319 [ 'New Build', self._sActionUrlBase + self.ksActionBuildAdd ],
320 [ 'New Blacklisting', self._sActionUrlBase + self.ksActionBuildBlacklistAdd ],
321 [ 'New Build Source', self._sActionUrlBase + self.ksActionBuildSrcAdd],
322 [ 'New Build Category', self._sActionUrlBase + self.ksActionBuildCategoryAdd ],
323 ]
324 ],
325 [
326 'Failure Reasons', self._sActionUrlBase + self.ksActionFailureReasonList,
327 [
328 [ 'Failure Categories', self._sActionUrlBase + self.ksActionFailureCategoryList ],
329 [ 'Failure Reasons', self._sActionUrlBase + self.ksActionFailureReasonList ],
330 [ 'New Failure Category', self._sActionUrlBase + self.ksActionFailureCategoryAdd ],
331 [ 'New Failure Reason', self._sActionUrlBase + self.ksActionFailureReasonAdd ],
332 ]
333 ],
334 [
335 'System', self._sActionUrlBase + self.ksActionSystemLogList,
336 [
337 [ 'System Log', self._sActionUrlBase + self.ksActionSystemLogList ],
338 [ 'User Accounts', self._sActionUrlBase + self.ksActionUserList ],
339 [ 'New User', self._sActionUrlBase + self.ksActionUserAdd ],
340 ]
341 ],
342 [
343 'TestBoxes', self._sActionUrlBase + self.ksActionTestBoxList,
344 [
345 [ 'TestBoxes', self._sActionUrlBase + self.ksActionTestBoxList ],
346 [ 'Scheduling Groups', self._sActionUrlBase + self.ksActionSchedGroupList ],
347 [ 'New TestBox', self._sActionUrlBase + self.ksActionTestBoxAdd ],
348 [ 'New Scheduling Group', self._sActionUrlBase + self.ksActionSchedGroupAdd ],
349 [ 'Regenerate All Scheduling Queues', self._sActionUrlBase + self.ksActionTestBoxesRegenQueues ],
350 ]
351 ],
352 [
353 'Test Config', self._sActionUrlBase + self.ksActionTestGroupList,
354 [
355 [ 'Test Cases', self._sActionUrlBase + self.ksActionTestCaseList ],
356 [ 'Test Groups', self._sActionUrlBase + self.ksActionTestGroupList ],
357 [ 'Global Resources', self._sActionUrlBase + self.ksActionGlobalRsrcShowAll ],
358 [ 'New Test Case', self._sActionUrlBase + self.ksActionTestCaseAdd ],
359 [ 'New Test Group', self._sActionUrlBase + self.ksActionTestGroupAdd ],
360 [ 'New Global Resource', self._sActionUrlBase + self.ksActionGlobalRsrcShowAdd ],
361 [ 'Regenerate All Scheduling Queues', self._sActionUrlBase + self.ksActionTestCfgRegenQueues ],
362 ]
363 ],
364 [
365 '> Test Results', 'index.py?' + webutils.encodeUrlParams(self._dDbgParams), []
366 ],
367 ];
368
369
370 def _actionDefault(self):
371 """Show the default admin page."""
372 self._sAction = self.ksActionTestBoxList;
373 from testmanager.core.testbox import TestBoxLogic;
374 from testmanager.webui.wuiadmintestbox import WuiTestBoxList;
375 return self._actionGenericListing(TestBoxLogic, WuiTestBoxList);
376
377 def _actionGenericDoDelOld(self, oCoreObjectLogic, sCoreObjectIdFieldName, sRedirectAction):
378 """
379 Delete entry (using oLogicType.remove).
380
381 @param oCoreObjectLogic A *Logic class
382
383 @param sCoreObjectIdFieldName Name of HTTP POST variable that
384 contains object ID information
385
386 @param sRedirectAction An action for redirect user to
387 in case of operation success
388 """
389 iCoreDataObjectId = self.getStringParam(sCoreObjectIdFieldName) # STRING?!?!
390 self._checkForUnknownParameters()
391
392 try:
393 self._sPageTitle = None
394 self._sPageBody = None
395 self._sRedirectTo = self._sActionUrlBase + sRedirectAction
396 return oCoreObjectLogic(self._oDb).remove(self._oCurUser.uid, iCoreDataObjectId)
397 except Exception as oXcpt:
398 self._oDb.rollback();
399 self._sPageTitle = 'Unable to delete record'
400 self._sPageBody = str(oXcpt);
401 if config.g_kfDebugDbXcpt:
402 self._sPageBody += cgitb.html(sys.exc_info());
403 self._sRedirectTo = None
404
405 return False
406
407 def _actionGenericDoRemove(self, oLogicType, sParamId, sRedirAction):
408 """
409 Delete entry (using oLogicType.removeEntry).
410
411 oLogicType is a class that implements addEntry.
412
413 sParamId is the name (ksParam_...) of the HTTP variable hold the ID of
414 the database entry to delete.
415
416 sRedirAction is what action to redirect to on success.
417 """
418 idEntry = self.getIntParam(sParamId, iMin = 1, iMax = 0x7fffffe)
419 fCascade = self.getBoolParam('fCascadeDelete', False);
420 self._checkForUnknownParameters()
421
422 try:
423 self._sPageTitle = None
424 self._sPageBody = None
425 self._sRedirectTo = self._sActionUrlBase + sRedirAction;
426 return oLogicType(self._oDb).removeEntry(self._oCurUser.uid, idEntry, fCascade = fCascade, fCommit = True);
427 except Exception as oXcpt:
428 self._oDb.rollback();
429 self._sPageTitle = 'Unable to delete entry';
430 self._sPageBody = str(oXcpt);
431 if config.g_kfDebugDbXcpt:
432 self._sPageBody += cgitb.html(sys.exc_info());
433 self._sRedirectTo = None;
434 return False;
435
436
437 #
438 # System Category.
439 #
440
441 # System Log actions.
442
443 def _actionSystemLogList(self):
444 """ Action wrapper. """
445 from testmanager.core.systemlog import SystemLogLogic;
446 from testmanager.webui.wuiadminsystemlog import WuiAdminSystemLogList;
447 return self._actionGenericListing(SystemLogLogic, WuiAdminSystemLogList)
448
449 # User Account actions.
450
451 def _actionUserList(self):
452 """ Action wrapper. """
453 from testmanager.core.useraccount import UserAccountLogic;
454 from testmanager.webui.wuiadminuseraccount import WuiUserAccountList;
455 return self._actionGenericListing(UserAccountLogic, WuiUserAccountList)
456
457 def _actionUserAdd(self):
458 """ Action wrapper. """
459 from testmanager.core.useraccount import UserAccountData;
460 from testmanager.webui.wuiadminuseraccount import WuiUserAccount;
461 return self._actionGenericFormAdd(UserAccountData, WuiUserAccount)
462
463 def _actionUserEdit(self):
464 """ Action wrapper. """
465 from testmanager.core.useraccount import UserAccountData, UserAccountLogic;
466 from testmanager.webui.wuiadminuseraccount import WuiUserAccount;
467 return self._actionGenericFormEdit(UserAccountData, WuiUserAccount, UserAccountData.ksParam_uid);
468
469 def _actionUserAddPost(self):
470 """ Action wrapper. """
471 from testmanager.core.useraccount import UserAccountData, UserAccountLogic;
472 from testmanager.webui.wuiadminuseraccount import WuiUserAccount;
473 return self._actionGenericFormAddPost(UserAccountData, UserAccountLogic, WuiUserAccount, self.ksActionUserList)
474
475 def _actionUserEditPost(self):
476 """ Action wrapper. """
477 from testmanager.core.useraccount import UserAccountData, UserAccountLogic;
478 from testmanager.webui.wuiadminuseraccount import WuiUserAccount;
479 return self._actionGenericFormEditPost(UserAccountData, UserAccountLogic, WuiUserAccount, self.ksActionUserList)
480
481 def _actionUserDelPost(self):
482 """ Action wrapper. """
483 from testmanager.core.useraccount import UserAccountData, UserAccountLogic;
484 return self._actionGenericDoRemove(UserAccountLogic, UserAccountData.ksParam_uid, self.ksActionUserList)
485
486
487 #
488 # TestBox & Scheduling Category.
489 #
490
491 def _actionTestBoxList(self):
492 """ Action wrapper. """
493 from testmanager.core.testbox import TestBoxLogic
494 from testmanager.webui.wuiadmintestbox import WuiTestBoxList;
495 return self._actionGenericListing(TestBoxLogic, WuiTestBoxList);
496
497 def _actionTestBoxListPost(self):
498 """Actions on a list of testboxes."""
499 from testmanager.core.testbox import TestBoxData, TestBoxLogic
500 from testmanager.webui.wuiadmintestbox import WuiTestBoxList;
501
502 # Parameters.
503 aidTestBoxes = self.getListOfIntParams(TestBoxData.ksParam_idTestBox, iMin = 1, aiDefaults = []);
504 sListAction = self.getStringParam(self.ksParamListAction);
505 if sListAction in [asDesc[0] for asDesc in WuiTestBoxList.kasTestBoxActionDescs]:
506 idAction = None;
507 else:
508 asActionPrefixes = [ 'setgroup-', ];
509 i = 0;
510 while i < len(asActionPrefixes) and not sListAction.startswith(asActionPrefixes[i]):
511 i += 1;
512 if i >= len(asActionPrefixes):
513 raise WuiException('Parameter "%s" has an invalid value: "%s"' % (self.ksParamListAction, sListAction,));
514 idAction = sListAction[len(asActionPrefixes[i]):];
515 if not idAction.isdigit():
516 raise WuiException('Parameter "%s" has an invalid value: "%s"' % (self.ksParamListAction, sListAction,));
517 idAction = int(idAction);
518 sListAction = sListAction[:len(asActionPrefixes[i]) - 1];
519 self._checkForUnknownParameters();
520
521
522 # Take action.
523 if sListAction is 'none':
524 pass;
525 else:
526 oLogic = TestBoxLogic(self._oDb);
527 aoTestBoxes = []
528 for idTestBox in aidTestBoxes:
529 aoTestBoxes.append(TestBoxData().initFromDbWithId(self._oDb, idTestBox));
530
531 if sListAction in [ 'enable', 'disable' ]:
532 fEnable = sListAction == 'enable';
533 for oTestBox in aoTestBoxes:
534 if oTestBox.fEnabled != fEnable:
535 oTestBox.fEnabled = fEnable;
536 oLogic.editEntry(oTestBox, self._oCurUser.uid, fCommit = False);
537 elif sListAction == 'setgroup':
538 for oTestBox in aoTestBoxes:
539 if oTestBox.idSchedGroup != idAction:
540 oTestBox.idSchedGroup = idAction;
541 oLogic.editEntry(oTestBox, self._oCurUser.uid, fCommit = False);
542 else:
543 for oTestBox in aoTestBoxes:
544 if oTestBox.enmPendingCmd != sListAction:
545 oTestBox.enmPendingCmd = sListAction;
546 oLogic.editEntry(oTestBox, self._oCurUser.uid, fCommit = False);
547 self._oDb.commit();
548
549 # Re-display the list.
550 self._sPageTitle = None;
551 self._sPageBody = None;
552 self._sRedirectTo = self._sActionUrlBase + self.ksActionTestBoxList;
553 return True;
554
555 def _actionTestBoxAdd(self):
556 """ Action wrapper. """
557 from testmanager.core.testbox import TestBoxData;
558 from testmanager.webui.wuiadmintestbox import WuiTestBox;
559 return self._actionGenericFormAdd(TestBoxData, WuiTestBox);
560
561 def _actionTestBoxAddPost(self):
562 """ Action wrapper. """
563 from testmanager.core.testbox import TestBoxData, TestBoxLogic;
564 from testmanager.webui.wuiadmintestbox import WuiTestBox;
565 return self._actionGenericFormAddPost(TestBoxData, TestBoxLogic, WuiTestBox, self.ksActionTestBoxList);
566
567 def _actionTestBoxDetails(self):
568 """ Action wrapper. """
569 from testmanager.core.testbox import TestBoxData, TestBoxLogic;
570 from testmanager.webui.wuiadmintestbox import WuiTestBox;
571 return self._actionGenericFormDetails(TestBoxData, TestBoxLogic, WuiTestBox, 'idTestBox', 'idGenTestBox');
572
573 def _actionTestBoxEdit(self):
574 """ Action wrapper. """
575 from testmanager.core.testbox import TestBoxData, TestBoxLogic;
576 from testmanager.webui.wuiadmintestbox import WuiTestBox;
577 return self._actionGenericFormEdit(TestBoxData, WuiTestBox, TestBoxData.ksParam_idTestBox);
578
579 def _actionTestBoxEditPost(self):
580 """ Action wrapper. """
581 from testmanager.core.testbox import TestBoxData, TestBoxLogic;
582 from testmanager.webui.wuiadmintestbox import WuiTestBox;
583 return self._actionGenericFormEditPost(TestBoxData, TestBoxLogic,WuiTestBox, self.ksActionTestBoxList);
584
585 def _actionTestBoxRemovePost(self):
586 """ Action wrapper. """
587 from testmanager.core.testbox import TestBoxData, TestBoxLogic;
588 from testmanager.webui.wuiadmintestbox import WuiTestBox;
589 return self._actionGenericDoRemove(TestBoxLogic, TestBoxData.ksParam_idTestBox, self.ksActionTestBoxList);
590
591
592 # Scheduling Group actions
593
594 def _actionSchedGroupList(self):
595 """ Action wrapper. """
596 from testmanager.core.schedgroup import SchedGroupLogic;
597 from testmanager.webui.wuiadminschedgroup import WuiAdminSchedGroupList;
598 return self._actionGenericListing(SchedGroupLogic, WuiAdminSchedGroupList);
599
600 def _actionSchedGroupAdd(self):
601 """ Action wrapper. """
602 from testmanager.core.schedgroup import SchedGroupDataEx;
603 from testmanager.webui.wuiadminschedgroup import WuiSchedGroup;
604 return self._actionGenericFormAdd(SchedGroupDataEx, WuiSchedGroup);
605
606 def _actionSchedGroupClone(self):
607 """ Action wrapper. """
608 from testmanager.core.schedgroup import SchedGroupDataEx;
609 from testmanager.webui.wuiadminschedgroup import WuiSchedGroup;
610 return self._actionGenericFormClone( SchedGroupDataEx, WuiSchedGroup, 'idSchedGroup');
611
612 def _actionSchedGroupDetails(self):
613 """ Action wrapper. """
614 from testmanager.core.schedgroup import SchedGroupDataEx, SchedGroupLogic;
615 from testmanager.webui.wuiadminschedgroup import WuiSchedGroup;
616 return self._actionGenericFormDetails(SchedGroupDataEx, SchedGroupLogic, WuiSchedGroup, 'idSchedGroup');
617
618 def _actionSchedGroupEdit(self):
619 """ Action wrapper. """
620 from testmanager.core.schedgroup import SchedGroupDataEx;
621 from testmanager.webui.wuiadminschedgroup import WuiSchedGroup;
622 return self._actionGenericFormEdit(SchedGroupDataEx, WuiSchedGroup, SchedGroupDataEx.ksParam_idSchedGroup);
623
624 def _actionSchedGroupAddPost(self):
625 """ Action wrapper. """
626 from testmanager.core.schedgroup import SchedGroupDataEx, SchedGroupLogic;
627 from testmanager.webui.wuiadminschedgroup import WuiSchedGroup;
628 return self._actionGenericFormAddPost(SchedGroupDataEx, SchedGroupLogic, WuiSchedGroup, self.ksActionSchedGroupList);
629
630 def _actionSchedGroupEditPost(self):
631 """ Action wrapper. """
632 from testmanager.core.schedgroup import SchedGroupDataEx, SchedGroupLogic;
633 from testmanager.webui.wuiadminschedgroup import WuiSchedGroup;
634 return self._actionGenericFormEditPost(SchedGroupDataEx, SchedGroupLogic, WuiSchedGroup, self.ksActionSchedGroupList);
635
636 def _actionSchedGroupDoRemove(self):
637 """ Action wrapper. """
638 from testmanager.core.schedgroup import SchedGroupData, SchedGroupLogic;
639 return self._actionGenericDoRemove(SchedGroupLogic, SchedGroupData.ksParam_idSchedGroup, self.ksActionSchedGroupList)
640
641
642 def _actionRegenQueuesCommon(self):
643 """
644 Common code for ksActionTestBoxesRegenQueues and ksActionTestCfgRegenQueues.
645
646 Too lazy to put this in some separate place right now.
647 """
648 from testmanager.core.schedgroup import SchedGroupLogic;
649 from testmanager.core.schedulerbase import SchedulerBase;
650
651 self._checkForUnknownParameters();
652 ## @todo should also be changed to a POST with a confirmation dialog preceeding it.
653
654 self._sPageTitle = 'Regenerate All Scheduling Queues';
655 self._sPageBody = '';
656 aoGroups = SchedGroupLogic(self._oDb).getAll();
657 for oGroup in aoGroups:
658 self._sPageBody += '<h3>%s (ID %#d)</h3>' % (webutils.escapeElem(oGroup.sName), oGroup.idSchedGroup);
659 try:
660 (aoErrors, asMessages) = SchedulerBase.recreateQueue(self._oDb, self._oCurUser.uid, oGroup.idSchedGroup, 2);
661 except Exception as oXcpt:
662 self._oDb.rollback();
663 self._sPageBody += '<p>SchedulerBase.recreateQueue threw an exception: %s</p>' \
664 % (webutils.escapeElem(str(oXcpt)),);
665 self._sPageBody += cgitb.html(sys.exc_info());
666 else:
667 if len(aoErrors) == 0:
668 self._sPageBody += '<p>Successfully regenerated.</p>';
669 else:
670 for oError in aoErrors:
671 if oError[1] is None:
672 self._sPageBody += '<p>%s.</p>' % (webutils.escapeElem(oError[0]),);
673 ## @todo links.
674 #elif isinstance(oError[1], TestGroupData):
675 # self._sPageBody += '<p>%s.</p>' % (webutils.escapeElem(oError[0]),);
676 #elif isinstance(oError[1], TestGroupCase):
677 # self._sPageBody += '<p>%s.</p>' % (webutils.escapeElem(oError[0]),);
678 else:
679 self._sPageBody += '<p>%s. [Cannot link to %s]</p>' \
680 % (webutils.escapeElem(oError[0]), webutils.escapeElem(str(oError[1])));
681 for sMsg in asMessages:
682 self._sPageBody += '<p>%s<p>\n' % (webutils.escapeElem(sMsg),);
683 return True;
684
685
686
687 #
688 # Test Config Category.
689 #
690
691 # Test Cases
692
693 def _actionTestCaseList(self):
694 """ Action wrapper. """
695 from testmanager.core.testcase import TestCaseLogic;
696 from testmanager.webui.wuiadmintestcase import WuiTestCaseList;
697 return self._actionGenericListing(TestCaseLogic, WuiTestCaseList);
698
699 def _actionTestCaseAdd(self):
700 """ Action wrapper. """
701 from testmanager.core.testcase import TestCaseDataEx;
702 from testmanager.webui.wuiadmintestcase import WuiTestCase;
703 return self._actionGenericFormAdd(TestCaseDataEx, WuiTestCase);
704
705 def _actionTestCaseAddPost(self):
706 """ Action wrapper. """
707 from testmanager.core.testcase import TestCaseDataEx, TestCaseLogic;
708 from testmanager.webui.wuiadmintestcase import WuiTestCase;
709 return self._actionGenericFormAddPost(TestCaseDataEx, TestCaseLogic, WuiTestCase, self.ksActionTestCaseList);
710
711 def _actionTestCaseClone(self):
712 """ Action wrapper. """
713 from testmanager.core.testcase import TestCaseDataEx;
714 from testmanager.webui.wuiadmintestcase import WuiTestCase;
715 return self._actionGenericFormClone( TestCaseDataEx, WuiTestCase, 'idTestCase', 'idGenTestCase');
716
717 def _actionTestCaseDetails(self):
718 """ Action wrapper. """
719 from testmanager.core.testcase import TestCaseDataEx, TestCaseLogic;
720 from testmanager.webui.wuiadmintestcase import WuiTestCase;
721 return self._actionGenericFormDetails(TestCaseDataEx, TestCaseLogic, WuiTestCase, 'idTestCase', 'idGenTestCase');
722
723 def _actionTestCaseEdit(self):
724 """ Action wrapper. """
725 from testmanager.core.testcase import TestCaseDataEx, TestCaseLogic;
726 from testmanager.webui.wuiadmintestcase import WuiTestCase;
727 return self._actionGenericFormEdit(TestCaseDataEx, WuiTestCase, TestCaseDataEx.ksParam_idTestCase);
728
729 def _actionTestCaseEditPost(self):
730 """ Action wrapper. """
731 from testmanager.core.testcase import TestCaseDataEx, TestCaseLogic;
732 from testmanager.webui.wuiadmintestcase import WuiTestCase;
733 return self._actionGenericFormEditPost(TestCaseDataEx, TestCaseLogic, WuiTestCase, self.ksActionTestCaseList);
734
735 def _actionTestCaseDoRemove(self):
736 """ Action wrapper. """
737 from testmanager.core.testcase import TestCaseData, TestCaseLogic;
738 return self._actionGenericDoRemove(TestCaseLogic, TestCaseData.ksParam_idTestCase, self.ksActionTestCaseList);
739
740 # Test Group actions
741 def _actionTestGroupList(self):
742 """ Action wrapper. """
743 from testmanager.core.testgroup import TestGroupLogic;
744 from testmanager.webui.wuiadmintestgroup import WuiTestGroupList;
745 return self._actionGenericListing(TestGroupLogic, WuiTestGroupList);
746 def _actionTestGroupAdd(self):
747 """ Action wrapper. """
748 from testmanager.core.testgroup import TestGroupDataEx;
749 from testmanager.webui.wuiadmintestgroup import WuiTestGroup;
750 return self._actionGenericFormAdd(TestGroupDataEx, WuiTestGroup);
751 def _actionTestGroupAddPost(self):
752 """ Action wrapper. """
753 from testmanager.core.testgroup import TestGroupDataEx, TestGroupLogic;
754 from testmanager.webui.wuiadmintestgroup import WuiTestGroup;
755 return self._actionGenericFormAddPost(TestGroupDataEx, TestGroupLogic, WuiTestGroup, self.ksActionTestGroupList);
756 def _actionTestGroupClone(self):
757 """ Action wrapper. """
758 from testmanager.core.testgroup import TestGroupDataEx;
759 from testmanager.webui.wuiadmintestgroup import WuiTestGroup;
760 return self._actionGenericFormClone(TestGroupDataEx, WuiTestGroup, 'idTestGroup');
761 def _actionTestGroupDetails(self):
762 """ Action wrapper. """
763 from testmanager.core.testgroup import TestGroupDataEx, TestGroupLogic;
764 from testmanager.webui.wuiadmintestgroup import WuiTestGroup;
765 return self._actionGenericFormDetails(TestGroupDataEx, TestGroupLogic, WuiTestGroup, 'idTestGroup');
766 def _actionTestGroupEdit(self):
767 """ Action wrapper. """
768 from testmanager.core.testgroup import TestGroupDataEx;
769 from testmanager.webui.wuiadmintestgroup import WuiTestGroup;
770 return self._actionGenericFormEdit(TestGroupDataEx, WuiTestGroup, TestGroupDataEx.ksParam_idTestGroup);
771 def _actionTestGroupEditPost(self):
772 """ Action wrapper. """
773 from testmanager.core.testgroup import TestGroupDataEx, TestGroupLogic;
774 from testmanager.webui.wuiadmintestgroup import WuiTestGroup;
775 return self._actionGenericFormEditPost(TestGroupDataEx, TestGroupLogic, WuiTestGroup, self.ksActionTestGroupList);
776 def _actionTestGroupDoRemove(self):
777 """ Action wrapper. """
778 from testmanager.core.testgroup import TestGroupDataEx, TestGroupLogic;
779 return self._actionGenericDoRemove(TestGroupLogic, TestGroupDataEx.ksParam_idTestGroup, self.ksActionTestGroupList)
780
781
782 # Global Resources
783
784 def _actionGlobalRsrcShowAll(self):
785 """ Action wrapper. """
786 from testmanager.core.globalresource import GlobalResourceLogic;
787 from testmanager.webui.wuiadminglobalrsrc import WuiGlobalResourceList;
788 return self._actionGenericListing(GlobalResourceLogic, WuiGlobalResourceList);
789
790 def _actionGlobalRsrcShowAdd(self):
791 """ Action wrapper. """
792 return self._actionGlobalRsrcShowAddEdit(WuiAdmin.ksActionGlobalRsrcAdd);
793
794 def _actionGlobalRsrcShowEdit(self):
795 """ Action wrapper. """
796 return self._actionGlobalRsrcShowAddEdit(WuiAdmin.ksActionGlobalRsrcEdit);
797
798 def _actionGlobalRsrcAdd(self):
799 """ Action wrapper. """
800 return self._actionGlobalRsrcAddEdit(WuiAdmin.ksActionGlobalRsrcAdd);
801
802 def _actionGlobalRsrcEdit(self):
803 """ Action wrapper. """
804 return self._actionGlobalRsrcAddEdit(WuiAdmin.ksActionGlobalRsrcEdit);
805
806 def _actionGlobalRsrcDel(self):
807 """ Action wrapper. """
808 from testmanager.core.globalresource import GlobalResourceData, GlobalResourceLogic;
809 return self._actionGenericDoDelOld(GlobalResourceLogic, GlobalResourceData.ksParam_idGlobalRsrc,
810 self.ksActionGlobalRsrcShowAll);
811
812 def _actionGlobalRsrcShowAddEdit(self, sAction): # pylint: disable=C0103
813 """Show Global Resource creation or edit dialog"""
814 from testmanager.core.globalresource import GlobalResourceLogic, GlobalResourceData;
815 from testmanager.webui.wuiadminglobalrsrc import WuiGlobalResource;
816
817 oGlobalResourceLogic = GlobalResourceLogic(self._oDb)
818 if sAction == WuiAdmin.ksActionGlobalRsrcEdit:
819 idGlobalRsrc = self.getIntParam(GlobalResourceData.ksParam_idGlobalRsrc, iDefault = -1)
820 oData = oGlobalResourceLogic.getById(idGlobalRsrc)
821 else:
822 oData = GlobalResourceData()
823 oData.convertToParamNull()
824
825 self._checkForUnknownParameters()
826
827 oContent = WuiGlobalResource(oData)
828 (self._sPageTitle, self._sPageBody) = oContent.showAddModifyPage(sAction)
829
830 return True
831
832 def _actionGlobalRsrcAddEdit(self, sAction):
833 """Add or modify Global Resource record"""
834 from testmanager.core.globalresource import GlobalResourceLogic, GlobalResourceData;
835 from testmanager.webui.wuiadminglobalrsrc import WuiGlobalResource;
836
837 oData = GlobalResourceData()
838 oData.initFromParams(self, fStrict=True)
839
840 self._checkForUnknownParameters()
841
842 if self._oSrvGlue.getMethod() != 'POST':
843 raise WuiException('Expected "POST" request, got "%s"' % (self._oSrvGlue.getMethod(),))
844
845 oGlobalResourceLogic = GlobalResourceLogic(self._oDb)
846 dErrors = oData.validateAndConvert(self._oDb);
847 if len(dErrors) == 0:
848 if sAction == WuiAdmin.ksActionGlobalRsrcAdd:
849 oGlobalResourceLogic.addGlobalResource(self._oCurUser.uid, oData)
850 elif sAction == WuiAdmin.ksActionGlobalRsrcEdit:
851 idGlobalRsrc = self.getStringParam(GlobalResourceData.ksParam_idGlobalRsrc)
852 oGlobalResourceLogic.editGlobalResource(self._oCurUser.uid, idGlobalRsrc, oData)
853 else:
854 raise WuiException('Invalid parameter.')
855 self._sPageTitle = None;
856 self._sPageBody = None;
857 self._sRedirectTo = self._sActionUrlBase + self.ksActionGlobalRsrcShowAll;
858 else:
859 oContent = WuiGlobalResource(oData)
860 (self._sPageTitle, self._sPageBody) = oContent.showAddModifyPage(sAction, dErrors=dErrors)
861
862 return True
863
864
865 #
866 # Build Source actions
867 #
868
869 def _actionBuildSrcList(self):
870 """ Action wrapper. """
871 from testmanager.core.buildsource import BuildSourceLogic;
872 from testmanager.webui.wuiadminbuildsource import WuiAdminBuildSrcList;
873 return self._actionGenericListing(BuildSourceLogic, WuiAdminBuildSrcList);
874
875 def _actionBuildSrcAdd(self):
876 """ Action wrapper. """
877 from testmanager.core.buildsource import BuildSourceData;
878 from testmanager.webui.wuiadminbuildsource import WuiAdminBuildSrc;
879 return self._actionGenericFormAdd(BuildSourceData, WuiAdminBuildSrc);
880
881 def _actionBuildSrcAddPost(self):
882 """ Action wrapper. """
883 from testmanager.core.buildsource import BuildSourceData, BuildSourceLogic;
884 from testmanager.webui.wuiadminbuildsource import WuiAdminBuildSrc;
885 return self._actionGenericFormAddPost(BuildSourceData, BuildSourceLogic, WuiAdminBuildSrc, self.ksActionBuildSrcList);
886
887 def _actionBuildSrcClone(self):
888 """ Action wrapper. """
889 from testmanager.core.buildsource import BuildSourceData;
890 from testmanager.webui.wuiadminbuildsource import WuiAdminBuildSrc;
891 return self._actionGenericFormClone( BuildSourceData, WuiAdminBuildSrc, 'idBuildSrc');
892
893 def _actionBuildSrcDetails(self):
894 """ Action wrapper. """
895 from testmanager.core.buildsource import BuildSourceData, BuildSourceLogic;
896 from testmanager.webui.wuiadminbuildsource import WuiAdminBuildSrc;
897 return self._actionGenericFormDetails(BuildSourceData, BuildSourceLogic, WuiAdminBuildSrc, 'idBuildSrc');
898
899 def _actionBuildSrcDoRemove(self):
900 """ Action wrapper. """
901 from testmanager.core.buildsource import BuildSourceData, BuildSourceLogic;
902 from testmanager.webui.wuiadminbuildsource import WuiAdminBuildSrc;
903 return self._actionGenericDoRemove(BuildSourceLogic, BuildSourceData.ksParam_idBuildSrc, self.ksActionBuildSrcList);
904
905 def _actionBuildSrcEdit(self):
906 """ Action wrapper. """
907 from testmanager.core.buildsource import BuildSourceData;
908 from testmanager.webui.wuiadminbuildsource import WuiAdminBuildSrc;
909 return self._actionGenericFormEdit(BuildSourceData, WuiAdminBuildSrc, BuildSourceData.ksParam_idBuildSrc);
910
911 def _actionBuildSrcEditPost(self):
912 """ Action wrapper. """
913 from testmanager.core.buildsource import BuildSourceData, BuildSourceLogic;
914 from testmanager.webui.wuiadminbuildsource import WuiAdminBuildSrc;
915 return self._actionGenericFormEditPost(BuildSourceData, BuildSourceLogic, WuiAdminBuildSrc, self.ksActionBuildSrcList);
916
917
918 #
919 # Build actions
920 #
921 def _actionBuildList(self):
922 """ Action wrapper. """
923 from testmanager.core.build import BuildLogic;
924 from testmanager.webui.wuiadminbuild import WuiAdminBuildList;
925 return self._actionGenericListing(BuildLogic, WuiAdminBuildList);
926
927 def _actionBuildAdd(self):
928 """ Action wrapper. """
929 from testmanager.core.build import BuildData;
930 from testmanager.webui.wuiadminbuild import WuiAdminBuild;
931 return self._actionGenericFormAdd(BuildData, WuiAdminBuild);
932
933 def _actionBuildAddPost(self):
934 """ Action wrapper. """
935 from testmanager.core.build import BuildData, BuildLogic;
936 from testmanager.webui.wuiadminbuild import WuiAdminBuild;
937 return self._actionGenericFormAddPost(BuildData, BuildLogic, WuiAdminBuild, self.ksActionBuildList);
938
939 def _actionBuildClone(self):
940 """ Action wrapper. """
941 from testmanager.core.build import BuildData;
942 from testmanager.webui.wuiadminbuild import WuiAdminBuild;
943 return self._actionGenericFormClone( BuildData, WuiAdminBuild, 'idBuild');
944
945 def _actionBuildDetails(self):
946 """ Action wrapper. """
947 from testmanager.core.build import BuildData, BuildLogic;
948 from testmanager.webui.wuiadminbuild import WuiAdminBuild;
949 return self._actionGenericFormDetails(BuildData, BuildLogic, WuiAdminBuild, 'idBuild');
950
951 def _actionBuildDoRemove(self):
952 """ Action wrapper. """
953 from testmanager.core.build import BuildData, BuildLogic;
954 from testmanager.webui.wuiadminbuild import WuiAdminBuild;
955 return self._actionGenericDoRemove(BuildLogic, BuildData.ksParam_idBuild, self.ksActionBuildList);
956
957 def _actionBuildEdit(self):
958 """ Action wrapper. """
959 from testmanager.core.build import BuildData;
960 from testmanager.webui.wuiadminbuild import WuiAdminBuild;
961 return self._actionGenericFormEdit(BuildData, WuiAdminBuild, BuildData.ksParam_idBuild);
962
963 def _actionBuildEditPost(self):
964 """ Action wrapper. """
965 from testmanager.core.build import BuildData, BuildLogic;
966 from testmanager.webui.wuiadminbuild import WuiAdminBuild;
967 return self._actionGenericFormEditPost(BuildData, BuildLogic, WuiAdminBuild, self.ksActionBuildList)
968
969
970 #
971 # Build Category actions
972 #
973 def _actionBuildCategoryList(self):
974 """ Action wrapper. """
975 from testmanager.core.build import BuildCategoryLogic;
976 from testmanager.webui.wuiadminbuildcategory import WuiAdminBuildCatList;
977 return self._actionGenericListing(BuildCategoryLogic, WuiAdminBuildCatList);
978
979 def _actionBuildCategoryAdd(self):
980 """ Action wrapper. """
981 from testmanager.core.build import BuildCategoryData;
982 from testmanager.webui.wuiadminbuildcategory import WuiAdminBuildCat;
983 return self._actionGenericFormAdd(BuildCategoryData, WuiAdminBuildCat);
984
985 def _actionBuildCategoryAddPost(self):
986 """ Action wrapper. """
987 from testmanager.core.build import BuildCategoryData, BuildCategoryLogic;
988 from testmanager.webui.wuiadminbuildcategory import WuiAdminBuildCat;
989 return self._actionGenericFormAddPost(BuildCategoryData, BuildCategoryLogic, WuiAdminBuildCat,
990 self.ksActionBuildCategoryList);
991
992 def _actionBuildCategoryClone(self):
993 """ Action wrapper. """
994 from testmanager.core.build import BuildCategoryData, BuildCategoryLogic;
995 from testmanager.webui.wuiadminbuildcategory import WuiAdminBuildCat;
996 return self._actionGenericFormClone(BuildCategoryData, WuiAdminBuildCat, 'idBuildCategory');
997
998 def _actionBuildCategoryDetails(self):
999 """ Action wrapper. """
1000 from testmanager.core.build import BuildCategoryData, BuildCategoryLogic;
1001 from testmanager.webui.wuiadminbuildcategory import WuiAdminBuildCat;
1002 return self._actionGenericFormDetails(BuildCategoryData, BuildCategoryLogic, WuiAdminBuildCat, 'idBuildCategory');
1003
1004 def _actionBuildCategoryDoRemove(self):
1005 """ Action wrapper. """
1006 from testmanager.core.build import BuildCategoryData, BuildCategoryLogic;
1007 from testmanager.webui.wuiadminbuildcategory import WuiAdminBuildCat;
1008 return self._actionGenericDoRemove(BuildCategoryLogic, BuildCategoryData.ksParam_idBuildCategory,
1009 self.ksActionBuildCategoryList)
1010
1011
1012 #
1013 # Build Black List actions
1014 #
1015 def _actionBuildBlacklist(self):
1016 """ Action wrapper. """
1017 from testmanager.core.buildblacklist import BuildBlacklistLogic;
1018 from testmanager.webui.wuiadminbuildblacklist import WuiAdminListOfBlacklistItems;
1019 return self._actionGenericListing(BuildBlacklistLogic, WuiAdminListOfBlacklistItems);
1020
1021 def _actionBuildBlacklistAdd(self):
1022 """ Action wrapper. """
1023 from testmanager.core.buildblacklist import BuildBlacklistData, BuildBlacklistLogic;
1024 from testmanager.webui.wuiadminbuildblacklist import WuiAdminBuildBlacklist;
1025 return self._actionGenericFormAdd(BuildBlacklistData, WuiAdminBuildBlacklist);
1026
1027 def _actionBuildBlacklistAddPost(self):
1028 """ Action wrapper. """
1029 from testmanager.core.buildblacklist import BuildBlacklistData, BuildBlacklistLogic;
1030 from testmanager.webui.wuiadminbuildblacklist import WuiAdminBuildBlacklist;
1031 return self._actionGenericFormAddPost(BuildBlacklistData, BuildBlacklistLogic,
1032 WuiAdminBuildBlacklist, self.ksActionBuildBlacklist);
1033
1034 def _actionBuildBlacklistClone(self):
1035 """ Action wrapper. """
1036 from testmanager.core.buildblacklist import BuildBlacklistData, BuildBlacklistLogic;
1037 from testmanager.webui.wuiadminbuildblacklist import WuiAdminBuildBlacklist;
1038 return self._actionGenericFormClone(BuildBlacklistData, WuiAdminBuildBlacklist, 'idBlacklisting');
1039
1040 def _actionBuildBlacklistDetails(self):
1041 """ Action wrapper. """
1042 from testmanager.core.buildblacklist import BuildBlacklistData, BuildBlacklistLogic;
1043 from testmanager.webui.wuiadminbuildblacklist import WuiAdminBuildBlacklist;
1044 return self._actionGenericFormDetails(BuildBlacklistData, BuildBlacklistLogic, WuiAdminBuildBlacklist, 'idBlacklisting');
1045
1046 def _actionBuildBlacklistDoRemove(self):
1047 """ Action wrapper. """
1048 from testmanager.core.buildblacklist import BuildBlacklistData, BuildBlacklistLogic;
1049 from testmanager.webui.wuiadminbuildblacklist import WuiAdminBuildBlacklist;
1050 return self._actionGenericDoRemove(BuildBlacklistLogic, BuildBlacklistData.ksParam_idBlacklisting,
1051 self.ksActionBuildBlacklist);
1052
1053 def _actionBuildBlacklistEdit(self):
1054 """ Action wrapper. """
1055 from testmanager.core.buildblacklist import BuildBlacklistData, BuildBlacklistLogic;
1056 from testmanager.webui.wuiadminbuildblacklist import WuiAdminBuildBlacklist;
1057 return self._actionGenericFormEdit(BuildBlacklistData, WuiAdminBuildBlacklist, BuildBlacklistData.ksParam_idBlacklisting);
1058
1059 def _actionBuildBlacklistEditPost(self):
1060 """ Action wrapper. """
1061 from testmanager.core.buildblacklist import BuildBlacklistData, BuildBlacklistLogic;
1062 from testmanager.webui.wuiadminbuildblacklist import WuiAdminBuildBlacklist;
1063 return self._actionGenericFormEditPost(BuildBlacklistData, BuildBlacklistLogic, WuiAdminBuildBlacklist,
1064 self.ksActionBuildBlacklist)
1065
1066
1067 #
1068 # Failure Category actions
1069 #
1070 def _actionFailureCategoryList(self):
1071 """ Action wrapper. """
1072 from testmanager.core.failurecategory import FailureCategoryLogic;
1073 from testmanager.webui.wuiadminfailurecategory import WuiFailureCategoryList;
1074 return self._actionGenericListing(FailureCategoryLogic, WuiFailureCategoryList);
1075
1076 def _actionFailureCategoryAdd(self):
1077 """ Action wrapper. """
1078 from testmanager.core.failurecategory import FailureCategoryData, FailureCategoryLogic;
1079 from testmanager.webui.wuiadminfailurecategory import WuiFailureCategory;
1080 return self._actionGenericFormAdd(FailureCategoryData, WuiFailureCategory);
1081
1082 def _actionFailureCategoryAddPost(self):
1083 """ Action wrapper. """
1084 from testmanager.core.failurecategory import FailureCategoryData, FailureCategoryLogic;
1085 from testmanager.webui.wuiadminfailurecategory import WuiFailureCategory;
1086 return self._actionGenericFormAddPost(FailureCategoryData, FailureCategoryLogic, WuiFailureCategory,
1087 self.ksActionFailureCategoryList)
1088
1089 def _actionFailureCategoryDetails(self):
1090 """ Action wrapper. """
1091 from testmanager.core.failurecategory import FailureCategoryData, FailureCategoryLogic;
1092 from testmanager.webui.wuiadminfailurecategory import WuiFailureCategory;
1093 return self._actionGenericFormDetails(FailureCategoryData, FailureCategoryLogic, WuiFailureCategory);
1094
1095
1096 def _actionFailureCategoryDoRemove(self):
1097 """ Action wrapper. """
1098 from testmanager.core.failurecategory import FailureCategoryData, FailureCategoryLogic;
1099 from testmanager.webui.wuiadminfailurecategory import WuiFailureCategory;
1100 return self._actionGenericDoRemove(FailureCategoryLogic, FailureCategoryData.ksParam_idFailureCategory,
1101 self.ksActionFailureCategoryList);
1102
1103 def _actionFailureCategoryEdit(self):
1104 """ Action wrapper. """
1105 from testmanager.core.failurecategory import FailureCategoryData, FailureCategoryLogic;
1106 from testmanager.webui.wuiadminfailurecategory import WuiFailureCategory;
1107 return self._actionGenericFormEdit(FailureCategoryData, WuiFailureCategory,
1108 FailureCategoryData.ksParam_idFailureCategory);
1109
1110 def _actionFailureCategoryEditPost(self):
1111 """ Action wrapper. """
1112 from testmanager.core.failurecategory import FailureCategoryData, FailureCategoryLogic;
1113 from testmanager.webui.wuiadminfailurecategory import WuiFailureCategory;
1114 return self._actionGenericFormEditPost(FailureCategoryData, FailureCategoryLogic, WuiFailureCategory,
1115 self.ksActionFailureCategoryList);
1116
1117 #
1118 # Failure Reason actions
1119 #
1120 def _actionFailureReasonList(self):
1121 """ Action wrapper. """
1122 from testmanager.core.failurereason import FailureReasonLogic;
1123 from testmanager.webui.wuiadminfailurereason import WuiAdminFailureReasonList;
1124 return self._actionGenericListing(FailureReasonLogic, WuiAdminFailureReasonList)
1125
1126 def _actionFailureReasonAdd(self):
1127 """ Action wrapper. """
1128 from testmanager.core.failurereason import FailureReasonData, FailureReasonLogic;
1129 from testmanager.webui.wuiadminfailurereason import WuiAdminFailureReason;
1130 return self._actionGenericFormAdd(FailureReasonData, WuiAdminFailureReason);
1131
1132 def _actionFailureReasonAddPost(self):
1133 """ Action wrapper. """
1134 from testmanager.core.failurereason import FailureReasonData, FailureReasonLogic;
1135 from testmanager.webui.wuiadminfailurereason import WuiAdminFailureReason;
1136 return self._actionGenericFormAddPost(FailureReasonData, FailureReasonLogic, WuiAdminFailureReason,
1137 self.ksActionFailureReasonList);
1138
1139 def _actionFailureReasonDetails(self):
1140 """ Action wrapper. """
1141 from testmanager.core.failurereason import FailureReasonData, FailureReasonLogic;
1142 from testmanager.webui.wuiadminfailurereason import WuiAdminFailureReason;
1143 return self._actionGenericFormDetails(FailureReasonData, FailureReasonLogic, WuiAdminFailureReason);
1144
1145 def _actionFailureReasonDoRemove(self):
1146 """ Action wrapper. """
1147 from testmanager.core.failurereason import FailureReasonData, FailureReasonLogic;
1148 from testmanager.webui.wuiadminfailurereason import WuiAdminFailureReason;
1149 return self._actionGenericDoRemove(FailureReasonLogic, FailureReasonData.ksParam_idFailureReason,
1150 self.ksActionFailureReasonList);
1151
1152 def _actionFailureReasonEdit(self):
1153 """ Action wrapper. """
1154 from testmanager.core.failurereason import FailureReasonData, FailureReasonLogic;
1155 from testmanager.webui.wuiadminfailurereason import WuiAdminFailureReason;
1156 return self._actionGenericFormEdit(FailureReasonData, WuiAdminFailureReason);
1157
1158
1159 def _actionFailureReasonEditPost(self):
1160 """ Action wrapper. """
1161 from testmanager.core.failurereason import FailureReasonData, FailureReasonLogic;
1162 from testmanager.webui.wuiadminfailurereason import WuiAdminFailureReason;
1163 return self._actionGenericFormEditPost(FailureReasonData, FailureReasonLogic, WuiAdminFailureReason,
1164 self.ksActionFailureReasonList)
1165
1166
1167 #
1168 # Overrides.
1169 #
1170
1171 def _generatePage(self):
1172 """Override parent handler in order to change page titte"""
1173 if self._sPageTitle is not None:
1174 self._sPageTitle = 'Test Manager Admin - ' + self._sPageTitle
1175
1176 return WuiDispatcherBase._generatePage(self)
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette