cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# -*- coding: utf-8 -*-
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncTest Manager Core - WUI - Admin Main page.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCopyright (C) 2012-2014 Oracle Corporation
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncThis file is part of VirtualBox Open Source Edition (OSE), as
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncavailable from http://www.virtualbox.org. This file is free software;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncyou can redistribute it and/or modify it under the terms of the GNU
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncGeneral Public License (GPL) as published by the Free Software
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncFoundation, in version 2 as it comes in the "COPYING" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox OSE distribution. VirtualBox OSE is distributed in the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsynchope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncThe contents of this file may alternatively be used under the terms
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncof the Common Development and Distribution License Version 1.0
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync(CDDL) only, as it comes in the "COPYING.CDDL" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox OSE distribution, in which case the provisions of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCDDL are applicable instead of those of the GPL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncYou may elect to license modified versions of this file under the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncterms and conditions of either the GPL or the CDDL or both.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Standard python imports.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Validation Kit imports.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.buildsource import BuildSourceLogic, BuildSourceData
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.build import BuildCategoryLogic, BuildCategoryData, BuildLogic, BuildData;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.globalresource import GlobalResourceLogic, GlobalResourceData
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.schedulerbase import SchedulerBase
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.schedgroup import SchedGroupLogic, SchedGroupData, SchedGroupDataEx
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.systemlog import SystemLogLogic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.testbox import TestBoxData, TestBoxLogic
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.testcase import TestCaseLogic, TestCaseData, TestCaseDataEx
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.useraccount import UserAccountLogic, UserAccountData
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.testgroup import TestGroupLogic, TestGroupDataEx;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.failurecategory import FailureCategoryLogic, FailureCategoryData
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.failurereason import FailureReasonLogic, FailureReasonData
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.buildblacklist import BuildBlacklistLogic, BuildBlacklistData
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuibase import WuiDispatcherBase, WuiException
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadminbuild import WuiAdminBuild, WuiAdminBuildList
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadminsystemlog import WuiAdminSystemLogList
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadminbuildsource import WuiAdminBuildSrc, WuiAdminBuildSrcList;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadminbuildcategory import WuiAdminBuildCat, WuiAdminBuildCatList;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadminglobalrsrc import WuiGlobalResource, WuiGlobalResourceList
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadmintestbox import WuiTestBoxList, WuiTestBox
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadmintestcase import WuiTestCase, WuiTestCaseList
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadminuseraccount import WuiUserAccountList, WuiUserAccount
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadmintestgroup import WuiTestGroup, WuiTestGroupList;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadminschedgroup import WuiSchedGroup, WuiAdminSchedGroupList;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadminbuildblacklist import WuiAdminBuildBlacklist, WuiAdminListOfBlacklistItems
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuifailurecategory import WuiFailureCategory, WuiFailureCategoryList
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuiadminfailurereason import WuiAdminFailureReason, WuiAdminFailureReasonList
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WUI Admin main page.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ## The name of the script.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ## @name Actions
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionTestBoxesRegenQueues = 'TestBoxesRegenQueues';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionBuildBlacklistAddPost = 'BuildBlacklistAddPost';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionBuildBlacklistClone = 'BuildBlacklistClone';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionBuildBlacklistDetails = 'BuildBlacklistDetails';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionBuildBlacklistDoRemove = 'BuildBlacklistDoRemove';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionBuildBlacklistEditPost = 'BuildBlacklistEditPost';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionFailureCategoryList = 'FailureCategoryList'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionFailureCategoryShowAdd = 'FailureCategoryShowAdd'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionFailureCategoryShowEdit = 'FailureCategoryShowEdit'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionFailureCategoryEdit = 'FailureCategoryEdit'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionFailureReasonShowAdd = 'FailureReasonShowAdd'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionFailureReasonShowEdit = 'FailureReasonShowEdit'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionBuildCategoryAddPost = 'BuildCategoryAddPost'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionBuildCategoryDetails = 'BuildCategoryDetails';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ksActionBuildCategoryDoRemove = 'BuildCategoryDoRemove';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiDispatcherBase.__init__(self, oSrvGlue, self.ksScriptName);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Use short form to avoid hitting the right margin (130) when using lambda.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # System Log actions.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionSystemLogList] = lambda: self._actionGenericListing(SystemLogLogic, WuiAdminSystemLogList)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # User Account actions.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionUserList] = lambda: self._actionGenericListing(UserAccountLogic, WuiUserAccountList)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionUserAdd] = lambda: self._actionGenericFormAdd(UserAccountData, WuiUserAccount)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionUserEdit] = lambda: self._actionGenericFormEdit(UserAccountData, WuiUserAccount,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionUserAddPost] = lambda: self._actionGenericFormAddPost(UserAccountData, UserAccountLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionUserEditPost] = lambda: self._actionGenericFormEditPost(UserAccountData, UserAccountLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionUserDelPost] = lambda: self._actionGenericDoRemove(UserAccountLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # TestBox actions.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestBoxList] = lambda: self._actionGenericListing(TestBoxLogic, WuiTestBoxList);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestBoxListPost] = self._actionTestBoxListPost;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestBoxAdd] = lambda: self._actionGenericFormAdd(TestBoxData, WuiTestBox);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestBoxAddPost] = lambda: self._actionGenericFormAddPost(TestBoxData, TestBoxLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestBoxDetails] = lambda: self._actionGenericFormDetails(TestBoxData, TestBoxLogic, WuiTestBox,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestBoxEdit] = lambda: self._actionGenericFormEdit(TestBoxData, WuiTestBox,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestBoxEditPost] = lambda: self._actionGenericFormEditPost(TestBoxData, TestBoxLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestBoxRemovePost] = lambda: self._actionGenericDoRemove(TestBoxLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestBoxesRegenQueues] = self._actionRegenQueuesCommon;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Test Case actions.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestCaseList] = lambda: self._actionGenericListing(TestCaseLogic, WuiTestCaseList);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestCaseAdd] = lambda: self._actionGenericFormAdd(TestCaseDataEx, WuiTestCase);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestCaseAddPost] = lambda: self._actionGenericFormAddPost(TestCaseDataEx, TestCaseLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestCaseClone] = lambda: self._actionGenericFormClone( TestCaseDataEx, WuiTestCase,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestCaseDetails] = lambda: self._actionGenericFormDetails(TestCaseDataEx, TestCaseLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'idGenTestCase');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestCaseEdit] = lambda: self._actionGenericFormEdit(TestCaseDataEx, WuiTestCase,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestCaseEditPost] = lambda: self._actionGenericFormEditPost(TestCaseDataEx, TestCaseLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestCaseDoRemove] = lambda: self._actionGenericDoRemove(TestCaseLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Global Resource actions
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionGlobalRsrcShowAll] = lambda: self._actionGenericListing(GlobalResourceLogic, WuiGlobalResourceList)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionGlobalRsrcShowAdd] = lambda: self._actionGlobalRsrcShowAddEdit(WuiAdmin.ksActionGlobalRsrcAdd)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionGlobalRsrcShowEdit] = lambda: self._actionGlobalRsrcShowAddEdit(WuiAdmin.ksActionGlobalRsrcEdit)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionGlobalRsrcAdd] = lambda: self._actionGlobalRsrcAddEdit(WuiAdmin.ksActionGlobalRsrcAdd)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionGlobalRsrcEdit] = lambda: self._actionGlobalRsrcAddEdit(WuiAdmin.ksActionGlobalRsrcEdit)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionGlobalRsrcDel] = lambda: self._actionGenericDoDelOld(GlobalResourceLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Build Source actions
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildSrcList] = lambda: self._actionGenericListing(BuildSourceLogic, WuiAdminBuildSrcList)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildSrcAdd] = lambda: self._actionGenericFormAdd(BuildSourceData, WuiAdminBuildSrc);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildSrcAddPost] = lambda: self._actionGenericFormAddPost(BuildSourceData, BuildSourceLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildSrcClone] = lambda: self._actionGenericFormClone( BuildSourceData, WuiAdminBuildSrc,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'idBuildSrc');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildSrcDetails] = lambda: self._actionGenericFormDetails(BuildSourceData, BuildSourceLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildSrcDoRemove] = lambda: self._actionGenericDoRemove(BuildSourceLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildSrcEdit] = lambda: self._actionGenericFormEdit(BuildSourceData, WuiAdminBuildSrc,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildSrcEditPost] = lambda: self._actionGenericFormEditPost(BuildSourceData, BuildSourceLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Build actions
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildList] = lambda: self._actionGenericListing(BuildLogic, WuiAdminBuildList)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildAdd] = lambda: self._actionGenericFormAdd(BuildData, WuiAdminBuild)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildAddPost] = lambda: self._actionGenericFormAddPost(BuildData, BuildLogic, WuiAdminBuild,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildClone] = lambda: self._actionGenericFormClone( BuildData, WuiAdminBuild, 'idBuild');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildDetails] = lambda: self._actionGenericFormDetails(BuildData, BuildLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildDoRemove] = lambda: self._actionGenericDoRemove(BuildLogic, BuildData.ksParam_idBuild,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildEdit] = lambda: self._actionGenericFormEdit(BuildData, WuiAdminBuild,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildEditPost] = lambda: self._actionGenericFormEditPost(BuildData, BuildLogic, WuiAdminBuild,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Build Black List actions
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildBlacklist] = lambda: self._actionGenericListing(BuildBlacklistLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildBlacklistAdd] = lambda: self._actionGenericFormAdd(BuildBlacklistData, WuiAdminBuildBlacklist);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildBlacklistAddPost] = lambda: self._actionGenericFormAddPost(BuildBlacklistData, BuildBlacklistLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildBlacklistClone] = lambda: self._actionGenericFormClone(BuildBlacklistData,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'idBlacklisting');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildBlacklistDetails] = lambda: self._actionGenericFormDetails(BuildBlacklistData,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'idBlacklisting');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildBlacklistDoRemove] = lambda: self._actionGenericDoRemove(BuildBlacklistLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildBlacklistEdit] = lambda: self._actionGenericFormEdit(BuildBlacklistData,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildBlacklistEditPost] = lambda: self._actionGenericFormEditPost(BuildBlacklistData,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Failure Category actions
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureCategoryList] = lambda: self._actionGenericListing(
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureCategoryShowAdd] = lambda: self._actionGenericFormAdd(
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureCategoryShowEdit] = lambda: self._actionGenericFormEditL(
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureCategoryAdd] = lambda: self._actionGenericFormAddPost(
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureCategoryEdit] = lambda: self._actionGenericFormEditPost(
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureCategoryDel] = lambda: self._actionGenericDoDelOld(
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Failure Reason actions
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureReasonList] = lambda: self._actionGenericListing(
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureReasonShowAdd] = lambda: self._actionGenericFormAdd(
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureReasonShowEdit] = lambda: self._actionGenericFormEditL(
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureReasonAdd] = lambda: self._actionGenericFormAddPost(
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureReasonEdit] = lambda: self._actionGenericFormEditPost(
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionFailureReasonDel] = lambda: self._actionGenericDoDelOld(FailureReasonLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Build Category actions
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildCategoryList] = lambda: self._actionGenericListing(BuildCategoryLogic, WuiAdminBuildCatList);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildCategoryAdd] = lambda: self._actionGenericFormAdd(BuildCategoryData, WuiAdminBuildCat);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildCategoryAddPost] = lambda: self._actionGenericFormAddPost(BuildCategoryData, BuildCategoryLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildCategoryClone] = lambda: self._actionGenericFormClone( BuildCategoryData, WuiAdminBuildCat,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'idBuildCategory');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildCategoryDetails] = lambda: self._actionGenericFormDetails(BuildCategoryData, BuildCategoryLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionBuildCategoryDoRemove] = lambda: self._actionGenericDoRemove(BuildCategoryLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Test Group actions
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestGroupList] = lambda: self._actionGenericListing(TestGroupLogic, WuiTestGroupList);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestGroupAdd] = lambda: self._actionGenericFormAdd(TestGroupDataEx, WuiTestGroup);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestGroupAddPost] = lambda: self._actionGenericFormAddPost(TestGroupDataEx, TestGroupLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestGroupClone] = lambda: self._actionGenericFormClone( TestGroupDataEx, WuiTestGroup,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'idTestGroup');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestGroupDetails] = lambda: self._actionGenericFormDetails(TestGroupDataEx, TestGroupLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestGroupEdit] = lambda: self._actionGenericFormEdit(TestGroupDataEx, WuiTestGroup,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestGroupEditPost] = lambda: self._actionGenericFormEditPost(TestGroupDataEx, TestGroupLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestGroupDoRemove] = lambda: self._actionGenericDoRemove(TestGroupLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionTestCfgRegenQueues] = self._actionRegenQueuesCommon;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Scheduling Group actions
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionSchedGroupList] = lambda: self._actionGenericListing(SchedGroupLogic, WuiAdminSchedGroupList)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionSchedGroupAdd] = lambda: self._actionGenericFormAdd(SchedGroupDataEx, WuiSchedGroup);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionSchedGroupClone] = lambda: self._actionGenericFormClone( SchedGroupDataEx, WuiSchedGroup,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'idSchedGroup');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionSchedGroupDetails] = lambda: self._actionGenericFormDetails(SchedGroupDataEx, SchedGroupLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionSchedGroupEdit] = lambda: self._actionGenericFormEdit(SchedGroupDataEx, WuiSchedGroup,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionSchedGroupAddPost] = lambda: self._actionGenericFormAddPost(SchedGroupDataEx, SchedGroupLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionSchedGroupEditPost] = lambda: self._actionGenericFormEditPost(SchedGroupDataEx, SchedGroupLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync d[self.ksActionSchedGroupDoRemove] = lambda: self._actionGenericDoRemove(SchedGroupLogic,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'Builds', self._sActionUrlBase + self.ksActionBuildList,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Builds', self._sActionUrlBase + self.ksActionBuildList ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Blacklist', self._sActionUrlBase + self.ksActionBuildBlacklist ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Build Sources', self._sActionUrlBase + self.ksActionBuildSrcList ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Build Categories', self._sActionUrlBase + self.ksActionBuildCategoryList ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New Build', self._sActionUrlBase + self.ksActionBuildAdd ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New Blacklisting', self._sActionUrlBase + self.ksActionBuildBlacklistAdd ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New Build Source', self._sActionUrlBase + self.ksActionBuildSrcAdd],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New Build Category', self._sActionUrlBase + self.ksActionBuildCategoryAdd ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'Failure Reasons', self._sActionUrlBase + self.ksActionFailureReasonList,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Failure Categories', self._sActionUrlBase + self.ksActionFailureCategoryList ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Failure Reasons', self._sActionUrlBase + self.ksActionFailureReasonList ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New Failure Category', self._sActionUrlBase + self.ksActionFailureCategoryShowAdd ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New Failure Reason', self._sActionUrlBase + self.ksActionFailureReasonShowAdd ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'System', self._sActionUrlBase + self.ksActionSystemLogList,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'System Log', self._sActionUrlBase + self.ksActionSystemLogList ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'User Accounts', self._sActionUrlBase + self.ksActionUserList ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New User', self._sActionUrlBase + self.ksActionUserAdd ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'TestBoxes', self._sActionUrlBase + self.ksActionTestBoxList,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'TestBoxes', self._sActionUrlBase + self.ksActionTestBoxList ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Scheduling Groups', self._sActionUrlBase + self.ksActionSchedGroupList ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New TestBox', self._sActionUrlBase + self.ksActionTestBoxAdd ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New Scheduling Group', self._sActionUrlBase + self.ksActionSchedGroupAdd ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Regenerate All Scheduling Queues', self._sActionUrlBase + self.ksActionTestBoxesRegenQueues ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'Test Config', self._sActionUrlBase + self.ksActionTestGroupList,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Test Cases', self._sActionUrlBase + self.ksActionTestCaseList ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Test Groups', self._sActionUrlBase + self.ksActionTestGroupList ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Global Resources', self._sActionUrlBase + self.ksActionGlobalRsrcShowAll ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New Test Case', self._sActionUrlBase + self.ksActionTestCaseAdd ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New Test Group', self._sActionUrlBase + self.ksActionTestGroupAdd ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'New Global Resource', self._sActionUrlBase + self.ksActionGlobalRsrcShowAdd ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync [ 'Regenerate All Scheduling Queues', self._sActionUrlBase + self.ksActionTestCfgRegenQueues ],
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync '> Test Results', 'index.py?' + webutils.encodeUrlParams(self._dDbgParams), []
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Show the default admin page."""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return self._actionGenericListing(TestBoxLogic, WuiTestBoxList);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def _actionGenericDoDelOld(self, oCoreObjectLogic, sCoreObjectIdFieldName, sRedirectAction):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Delete entry (using oLogicType.remove).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync @param oCoreObjectLogic A *Logic class
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync @param sCoreObjectIdFieldName Name of HTTP POST variable that
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync contains object ID information
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync @param sRedirectAction An action for redirect user to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync in case of operation success
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iCoreDataObjectId = self.getStringParam(sCoreObjectIdFieldName) # STRING?!?!
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sRedirectTo = self._sActionUrlBase + sRedirectAction
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return oCoreObjectLogic(self._oDb).remove(self._oCurUser.uid, iCoreDataObjectId)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def _actionGenericDoRemove(self, oLogicType, sParamId, sRedirAction):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Delete entry (using oLogicType.removeEntry).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oLogicType is a class that implements addEntry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sParamId is the name (ksParam_...) of the HTTP variable hold the ID of
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync the database entry to delete.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sRedirAction is what action to redirect to on success.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idEntry = self.getIntParam(sParamId, iMin = 1, iMax = 0x7fffffe)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fCascade = self.getBoolParam('fCascadeDelete', False);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sRedirectTo = self._sActionUrlBase + sRedirAction;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return oLogicType(self._oDb).removeEntry(self._oCurUser.uid, idEntry, fCascade = fCascade, fCommit = True);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # System Category.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # (all generic)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # TestBox & Scheduling Category.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Actions on a list of testboxes."""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Parameters.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aidTestBoxes = self.getListOfIntParams(TestBoxData.ksParam_idTestBox, iMin = 1, aiDefaults = []);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sListAction = self.getStringParam(self.ksParamListAction);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if sListAction in [asDesc[0] for asDesc in WuiTestBoxList.kasTestBoxActionDescs]:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync while i < len(asActionPrefixes) and not sListAction.startswith(asActionPrefixes[i]):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise WuiException('Parameter "%s" has an invalid value: "%s"' % (self.ksParamListAction, sListAction,));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise WuiException('Parameter "%s" has an invalid value: "%s"' % (self.ksParamListAction, sListAction,));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sListAction = sListAction[:len(asActionPrefixes[i]) - 1];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Take action.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoTestBoxes.append(TestBoxData().initFromDbWithId(self._oDb, idTestBox));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oLogic.editEntry(oTestBox, self._oCurUser.uid, fCommit = False);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oLogic.editEntry(oTestBox, self._oCurUser.uid, fCommit = False);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oLogic.editEntry(oTestBox, self._oCurUser.uid, fCommit = False);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Re-display the list.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sRedirectTo = self._sActionUrlBase + self.ksActionTestBoxList;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ## @todo scheduling groups code goes here...
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Common code for ksActionTestBoxesRegenQueues and ksActionTestCfgRegenQueues.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Too lazy to put this in some separate place right now.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ## @todo should also be changed to a POST with a confirmation dialog preceeding it.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sPageTitle = 'Regenerate All Scheduling Queues';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sPageBody += '<h3>%s (ID %#d)</h3>' % (webutils.escapeElem(oGroup.sName), oGroup.idSchedGroup);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync (aoErrors, asMessages) = SchedulerBase.recreateQueue(self._oDb, self._oCurUser.uid, oGroup.idSchedGroup, 2);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sPageBody += '<p>SchedulerBase.recreateQueue threw an exception: %s</p>' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sPageBody += '<p>Successfully regenerated.</p>';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sPageBody += '<p>%s.</p>' % (webutils.escapeElem(oError[0]),);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ## @todo links.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync #elif isinstance(oError[1], TestGroupData):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # self._sPageBody += '<p>%s.</p>' % (webutils.escapeElem(oError[0]),);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync #elif isinstance(oError[1], TestGroupCase):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # self._sPageBody += '<p>%s.</p>' % (webutils.escapeElem(oError[0]),);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sPageBody += '<p>%s. [Cannot link to %s]</p>' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % (webutils.escapeElem(oError[0]), webutils.escapeElem(str(oError[1])));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sPageBody += '<p>%s<p>\n' % (webutils.escapeElem(sMsg),);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Test Config Category.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def _actionGlobalRsrcShowAddEdit(self, sAction): # pylint: disable=C0103
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Show Global Resource creation or edit dialog"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oGlobalResourceLogic = GlobalResourceLogic(self._oDb)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGlobalRsrc = self.getIntParam(GlobalResourceData.ksParam_idGlobalRsrc, iDefault = -1)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync (self._sPageTitle, self._sPageBody) = oContent.showAddModifyPage(sAction)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Add or modify Global Resource record"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync raise WuiException('Expected "POST" request, got "%s"' % (self._oSrvGlue.getMethod(),))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oGlobalResourceLogic = GlobalResourceLogic(self._oDb)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oGlobalResourceLogic.addGlobalResource(self._oCurUser.uid, oData)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGlobalRsrc = self.getStringParam(GlobalResourceData.ksParam_idGlobalRsrc)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oGlobalResourceLogic.editGlobalResource(self._oCurUser.uid, idGlobalRsrc, oData)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sRedirectTo = self._sActionUrlBase + self.ksActionGlobalRsrcShowAll;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync (self._sPageTitle, self._sPageBody) = oContent.showAddModifyPage(sAction, dErrors=dErrors)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Override parent handler in order to change page titte"""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._sPageTitle = 'Test Manager Admin - ' + self._sPageTitle