Beispiel #1
0
    def _generatePage(self):
        """Override parent handler in order to change page titte"""
        if self._sPageTitle is not None:
            self._sPageTitle = 'Test Manager Admin - ' + self._sPageTitle

        return WuiDispatcherBase._generatePage(self)
Beispiel #2
0
    def __init__(self, oSrvGlue):
        WuiDispatcherBase.__init__(self, oSrvGlue, self.ksScriptName)

        self._sTemplate = 'template.html'

        # Use short form to avoid hitting the right margin (130) when using lambda.
        d = self._dDispatch
        # pylint: disable=C0103

        #
        # System Log actions.
        #
        d[self.ksActionSystemLogList] = lambda: self._actionGenericListing(
            SystemLogLogic, WuiAdminSystemLogList)

        #
        # User Account actions.
        #
        d[self.ksActionUserList] = lambda: self._actionGenericListing(
            UserAccountLogic, WuiUserAccountList)
        d[self.ksActionUserAdd] = lambda: self._actionGenericFormAdd(
            UserAccountData, WuiUserAccount)
        d[self.ksActionUserEdit] = lambda: self._actionGenericFormEdit(
            UserAccountData, WuiUserAccount, UserAccountData.ksParam_uid)
        d[self.ksActionUserAddPost] = lambda: self._actionGenericFormAddPost(
            UserAccountData, UserAccountLogic, WuiUserAccount, self.
            ksActionUserList)
        d[self.ksActionUserEditPost] = lambda: self._actionGenericFormEditPost(
            UserAccountData, UserAccountLogic, WuiUserAccount, self.
            ksActionUserList)
        d[self.ksActionUserDelPost] = lambda: self._actionGenericDoRemove(
            UserAccountLogic, UserAccountData.ksParam_uid, self.
            ksActionUserList)

        #
        # TestBox actions.
        #
        d[self.ksActionTestBoxList] = lambda: self._actionGenericListing(
            TestBoxLogic, WuiTestBoxList)
        d[self.ksActionTestBoxListPost] = self._actionTestBoxListPost
        d[self.ksActionTestBoxAdd] = lambda: self._actionGenericFormAdd(
            TestBoxData, WuiTestBox)
        d[self.
          ksActionTestBoxAddPost] = lambda: self._actionGenericFormAddPost(
              TestBoxData, TestBoxLogic, WuiTestBox, self.ksActionTestBoxList)
        d[self.ksActionTestBoxDetails] = lambda: self._actionGenericFormDetails(
            TestBoxData, TestBoxLogic, WuiTestBox, 'idTestBox', 'idGenTestBox')
        d[self.ksActionTestBoxEdit] = lambda: self._actionGenericFormEdit(
            TestBoxData, WuiTestBox, TestBoxData.ksParam_idTestBox)
        d[self.
          ksActionTestBoxEditPost] = lambda: self._actionGenericFormEditPost(
              TestBoxData, TestBoxLogic, WuiTestBox, self.ksActionTestBoxList)
        d[self.
          ksActionTestBoxRemovePost] = lambda: self._actionGenericDoRemove(
              TestBoxLogic, TestBoxData.ksParam_idTestBox, self.
              ksActionTestBoxList)
        d[self.ksActionTestBoxesRegenQueues] = self._actionRegenQueuesCommon

        #
        # Test Case actions.
        #
        d[self.ksActionTestCaseList] = lambda: self._actionGenericListing(
            TestCaseLogic, WuiTestCaseList)
        d[self.ksActionTestCaseAdd] = lambda: self._actionGenericFormAdd(
            TestCaseDataEx, WuiTestCase)
        d[self.
          ksActionTestCaseAddPost] = lambda: self._actionGenericFormAddPost(
              TestCaseDataEx, TestCaseLogic, WuiTestCase, self.
              ksActionTestCaseList)
        d[self.ksActionTestCaseClone] = lambda: self._actionGenericFormClone(
            TestCaseDataEx, WuiTestCase, 'idTestCase', 'idGenTestCase')
        d[self.
          ksActionTestCaseDetails] = lambda: self._actionGenericFormDetails(
              TestCaseDataEx, TestCaseLogic, WuiTestCase, 'idTestCase',
              'idGenTestCase')
        d[self.ksActionTestCaseEdit] = lambda: self._actionGenericFormEdit(
            TestCaseDataEx, WuiTestCase, TestCaseDataEx.ksParam_idTestCase)
        d[self.
          ksActionTestCaseEditPost] = lambda: self._actionGenericFormEditPost(
              TestCaseDataEx, TestCaseLogic, WuiTestCase, self.
              ksActionTestCaseList)
        d[self.ksActionTestCaseDoRemove] = lambda: self._actionGenericDoRemove(
            TestCaseLogic, TestCaseData.ksParam_idTestCase, self.
            ksActionTestCaseList)

        #
        # Global Resource actions
        #
        d[self.ksActionGlobalRsrcShowAll] = lambda: self._actionGenericListing(
            GlobalResourceLogic, WuiGlobalResourceList)
        d[self.
          ksActionGlobalRsrcShowAdd] = lambda: self._actionGlobalRsrcShowAddEdit(
              WuiAdmin.ksActionGlobalRsrcAdd)
        d[self.
          ksActionGlobalRsrcShowEdit] = lambda: self._actionGlobalRsrcShowAddEdit(
              WuiAdmin.ksActionGlobalRsrcEdit)
        d[self.ksActionGlobalRsrcAdd] = lambda: self._actionGlobalRsrcAddEdit(
            WuiAdmin.ksActionGlobalRsrcAdd)
        d[self.ksActionGlobalRsrcEdit] = lambda: self._actionGlobalRsrcAddEdit(
            WuiAdmin.ksActionGlobalRsrcEdit)
        d[self.ksActionGlobalRsrcDel] = lambda: self._actionGenericDoDelOld(
            GlobalResourceLogic, GlobalResourceData.ksParam_idGlobalRsrc, self.
            ksActionGlobalRsrcShowAll)

        #
        # Build Source actions
        #
        d[self.ksActionBuildSrcList] = lambda: self._actionGenericListing(
            BuildSourceLogic, WuiAdminBuildSrcList)
        d[self.ksActionBuildSrcAdd] = lambda: self._actionGenericFormAdd(
            BuildSourceData, WuiAdminBuildSrc)
        d[self.
          ksActionBuildSrcAddPost] = lambda: self._actionGenericFormAddPost(
              BuildSourceData, BuildSourceLogic, WuiAdminBuildSrc, self.
              ksActionBuildSrcList)
        d[self.ksActionBuildSrcClone] = lambda: self._actionGenericFormClone(
            BuildSourceData, WuiAdminBuildSrc, 'idBuildSrc')
        d[self.
          ksActionBuildSrcDetails] = lambda: self._actionGenericFormDetails(
              BuildSourceData, BuildSourceLogic, WuiAdminBuildSrc, 'idBuildSrc'
          )
        d[self.ksActionBuildSrcDoRemove] = lambda: self._actionGenericDoRemove(
            BuildSourceLogic, BuildSourceData.ksParam_idBuildSrc, self.
            ksActionBuildSrcList)
        d[self.ksActionBuildSrcEdit] = lambda: self._actionGenericFormEdit(
            BuildSourceData, WuiAdminBuildSrc, BuildSourceData.
            ksParam_idBuildSrc)
        d[self.
          ksActionBuildSrcEditPost] = lambda: self._actionGenericFormEditPost(
              BuildSourceData, BuildSourceLogic, WuiAdminBuildSrc, self.
              ksActionBuildSrcList)

        #
        # Build actions
        #
        d[self.ksActionBuildList] = lambda: self._actionGenericListing(
            BuildLogic, WuiAdminBuildList)
        d[self.ksActionBuildAdd] = lambda: self._actionGenericFormAdd(
            BuildData, WuiAdminBuild)
        d[self.ksActionBuildAddPost] = lambda: self._actionGenericFormAddPost(
            BuildData, BuildLogic, WuiAdminBuild, self.ksActionBuildList)
        d[self.ksActionBuildClone] = lambda: self._actionGenericFormClone(
            BuildData, WuiAdminBuild, 'idBuild')
        d[self.ksActionBuildDetails] = lambda: self._actionGenericFormDetails(
            BuildData, BuildLogic, WuiAdminBuild, 'idBuild')
        d[self.ksActionBuildDoRemove] = lambda: self._actionGenericDoRemove(
            BuildLogic, BuildData.ksParam_idBuild, self.ksActionBuildList)
        d[self.ksActionBuildEdit] = lambda: self._actionGenericFormEdit(
            BuildData, WuiAdminBuild, BuildData.ksParam_idBuild)
        d[self.
          ksActionBuildEditPost] = lambda: self._actionGenericFormEditPost(
              BuildData, BuildLogic, WuiAdminBuild, self.ksActionBuildList)

        #
        # Build Black List actions
        #
        d[self.ksActionBuildBlacklist] = lambda: self._actionGenericListing(
            BuildBlacklistLogic, WuiAdminListOfBlacklistItems)
        d[self.ksActionBuildBlacklistAdd] = lambda: self._actionGenericFormAdd(
            BuildBlacklistData, WuiAdminBuildBlacklist)
        d[self.
          ksActionBuildBlacklistAddPost] = lambda: self._actionGenericFormAddPost(
              BuildBlacklistData, BuildBlacklistLogic, WuiAdminBuildBlacklist,
              self.ksActionBuildBlacklist)
        d[self.
          ksActionBuildBlacklistClone] = lambda: self._actionGenericFormClone(
              BuildBlacklistData, WuiAdminBuildBlacklist, 'idBlacklisting')
        d[self.
          ksActionBuildBlacklistDetails] = lambda: self._actionGenericFormDetails(
              BuildBlacklistData, BuildBlacklistLogic, WuiAdminBuildBlacklist,
              'idBlacklisting')
        d[self.
          ksActionBuildBlacklistDoRemove] = lambda: self._actionGenericDoRemove(
              BuildBlacklistLogic, BuildBlacklistData.ksParam_idBlacklisting,
              self.ksActionBuildBlacklist)
        d[self.
          ksActionBuildBlacklistEdit] = lambda: self._actionGenericFormEdit(
              BuildBlacklistData, WuiAdminBuildBlacklist, BuildBlacklistData.
              ksParam_idBlacklisting)
        d[self.
          ksActionBuildBlacklistEditPost] = lambda: self._actionGenericFormEditPost(
              BuildBlacklistData, BuildBlacklistLogic, WuiAdminBuildBlacklist,
              self.ksActionBuildBlacklist)

        #
        # Failure Category actions
        #
        d[self.
          ksActionFailureCategoryList] = lambda: self._actionGenericListing(
              FailureCategoryLogic, WuiFailureCategoryList)

        d[self.
          ksActionFailureCategoryShowAdd] = lambda: self._actionGenericFormAdd(
              FailureCategoryData, WuiFailureCategory)

        d[self.
          ksActionFailureCategoryShowEdit] = lambda: self._actionGenericFormEditL(
              FailureCategoryLogic, FailureCategoryData.
              ksParam_idFailureCategory, WuiFailureCategory)

        d[self.
          ksActionFailureCategoryAdd] = lambda: self._actionGenericFormAddPost(
              FailureCategoryData, FailureCategoryLogic, WuiFailureCategory,
              self.ksActionFailureCategoryList)

        d[self.
          ksActionFailureCategoryEdit] = lambda: self._actionGenericFormEditPost(
              FailureCategoryData, FailureCategoryLogic, WuiFailureCategory,
              self.ksActionFailureCategoryList)

        d[self.
          ksActionFailureCategoryDel] = lambda: self._actionGenericDoDelOld(
              FailureCategoryLogic, FailureCategoryData.
              ksParam_idFailureCategory, self.ksActionFailureCategoryList)

        #
        # Failure Reason actions
        #
        d[self.ksActionFailureReasonList] = lambda: self._actionGenericListing(
            FailureReasonLogic, WuiAdminFailureReasonList)

        d[self.
          ksActionFailureReasonShowAdd] = lambda: self._actionGenericFormAdd(
              FailureReasonData, WuiAdminFailureReason)

        d[self.
          ksActionFailureReasonShowEdit] = lambda: self._actionGenericFormEditL(
              FailureReasonLogic, FailureReasonData.ksParam_idFailureReason,
              WuiAdminFailureReason)

        d[self.
          ksActionFailureReasonAdd] = lambda: self._actionGenericFormAddPost(
              FailureReasonData, FailureReasonLogic, WuiAdminFailureReason,
              self.ksActionFailureReasonList)

        d[self.
          ksActionFailureReasonEdit] = lambda: self._actionGenericFormEditPost(
              FailureReasonData, FailureReasonLogic, WuiAdminFailureReason,
              self.ksActionFailureReasonList)

        d[self.ksActionFailureReasonDel] = lambda: self._actionGenericDoDelOld(
            FailureReasonLogic, FailureReasonData.ksParam_idFailureReason, self
            .ksActionFailureReasonList)

        #
        # Build Category actions
        #
        d[self.ksActionBuildCategoryList] = lambda: self._actionGenericListing(
            BuildCategoryLogic, WuiAdminBuildCatList)
        d[self.ksActionBuildCategoryAdd] = lambda: self._actionGenericFormAdd(
            BuildCategoryData, WuiAdminBuildCat)
        d[self.
          ksActionBuildCategoryAddPost] = lambda: self._actionGenericFormAddPost(
              BuildCategoryData, BuildCategoryLogic, WuiAdminBuildCat, self.
              ksActionBuildCategoryList)
        d[self.
          ksActionBuildCategoryClone] = lambda: self._actionGenericFormClone(
              BuildCategoryData, WuiAdminBuildCat, 'idBuildCategory')
        d[self.
          ksActionBuildCategoryDetails] = lambda: self._actionGenericFormDetails(
              BuildCategoryData, BuildCategoryLogic, WuiAdminBuildCat,
              'idBuildCategory')
        d[self.
          ksActionBuildCategoryDoRemove] = lambda: self._actionGenericDoRemove(
              BuildCategoryLogic, BuildCategoryData.ksParam_idBuildCategory,
              self.ksActionBuildCategoryList)

        #
        # Test Group actions
        #
        d[self.ksActionTestGroupList] = lambda: self._actionGenericListing(
            TestGroupLogic, WuiTestGroupList)
        d[self.ksActionTestGroupAdd] = lambda: self._actionGenericFormAdd(
            TestGroupDataEx, WuiTestGroup)
        d[self.
          ksActionTestGroupAddPost] = lambda: self._actionGenericFormAddPost(
              TestGroupDataEx, TestGroupLogic, WuiTestGroup, self.
              ksActionTestGroupList)
        d[self.ksActionTestGroupClone] = lambda: self._actionGenericFormClone(
            TestGroupDataEx, WuiTestGroup, 'idTestGroup')
        d[self.
          ksActionTestGroupDetails] = lambda: self._actionGenericFormDetails(
              TestGroupDataEx, TestGroupLogic, WuiTestGroup, 'idTestGroup')
        d[self.ksActionTestGroupEdit] = lambda: self._actionGenericFormEdit(
            TestGroupDataEx, WuiTestGroup, TestGroupDataEx.ksParam_idTestGroup)
        d[self.
          ksActionTestGroupEditPost] = lambda: self._actionGenericFormEditPost(
              TestGroupDataEx, TestGroupLogic, WuiTestGroup, self.
              ksActionTestGroupList)
        d[self.
          ksActionTestGroupDoRemove] = lambda: self._actionGenericDoRemove(
              TestGroupLogic, TestGroupDataEx.ksParam_idTestGroup, self.
              ksActionTestGroupList)
        d[self.ksActionTestCfgRegenQueues] = self._actionRegenQueuesCommon

        #
        # Scheduling Group actions
        #
        d[self.ksActionSchedGroupList] = lambda: self._actionGenericListing(
            SchedGroupLogic, WuiAdminSchedGroupList)
        d[self.ksActionSchedGroupAdd] = lambda: self._actionGenericFormAdd(
            SchedGroupDataEx, WuiSchedGroup)
        d[self.ksActionSchedGroupClone] = lambda: self._actionGenericFormClone(
            SchedGroupDataEx, WuiSchedGroup, 'idSchedGroup')
        d[self.
          ksActionSchedGroupDetails] = lambda: self._actionGenericFormDetails(
              SchedGroupDataEx, SchedGroupLogic, WuiSchedGroup, 'idSchedGroup')
        d[self.ksActionSchedGroupEdit] = lambda: self._actionGenericFormEdit(
            SchedGroupDataEx, WuiSchedGroup, SchedGroupData.
            ksParam_idSchedGroup)
        d[self.
          ksActionSchedGroupAddPost] = lambda: self._actionGenericFormAddPost(
              SchedGroupDataEx, SchedGroupLogic, WuiSchedGroup, self.
              ksActionSchedGroupList)
        d[self.
          ksActionSchedGroupEditPost] = lambda: self._actionGenericFormEditPost(
              SchedGroupDataEx, SchedGroupLogic, WuiSchedGroup, self.
              ksActionSchedGroupList)
        d[self.
          ksActionSchedGroupDoRemove] = lambda: self._actionGenericDoRemove(
              SchedGroupLogic, SchedGroupData.ksParam_idSchedGroup, self.
              ksActionSchedGroupList)

        self._aaoMenus = \
        [
            [
                'Builds',       self._sActionUrlBase + self.ksActionBuildList,
                [
                    [ 'Builds',                 self._sActionUrlBase + self.ksActionBuildList ],
                    [ 'Blacklist',              self._sActionUrlBase + self.ksActionBuildBlacklist ],
                    [ 'Build Sources',          self._sActionUrlBase + self.ksActionBuildSrcList ],
                    [ 'Build Categories',       self._sActionUrlBase + self.ksActionBuildCategoryList ],
                    [ 'New Build',              self._sActionUrlBase + self.ksActionBuildAdd ],
                    [ 'New Blacklisting',       self._sActionUrlBase + self.ksActionBuildBlacklistAdd ],
                    [ 'New Build Source',       self._sActionUrlBase + self.ksActionBuildSrcAdd],
                    [ 'New Build Category',     self._sActionUrlBase + self.ksActionBuildCategoryAdd ],
                ]
            ],
            [
                'Failure Reasons',       self._sActionUrlBase + self.ksActionFailureReasonList,
                [
                    [ 'Failure Categories',     self._sActionUrlBase + self.ksActionFailureCategoryList ],
                    [ 'Failure Reasons',        self._sActionUrlBase + self.ksActionFailureReasonList ],
                    [ 'New Failure Category',   self._sActionUrlBase + self.ksActionFailureCategoryShowAdd ],
                    [ 'New Failure Reason',     self._sActionUrlBase + self.ksActionFailureReasonShowAdd ],
                ]
            ],
            [
                'System',      self._sActionUrlBase + self.ksActionSystemLogList,
                [
                    [ 'System Log',             self._sActionUrlBase + self.ksActionSystemLogList ],
                    [ 'User Accounts',          self._sActionUrlBase + self.ksActionUserList ],
                    [ 'New User',               self._sActionUrlBase + self.ksActionUserAdd ],
                ]
            ],
            [
                'TestBoxes',   self._sActionUrlBase + self.ksActionTestBoxList,
                [
                    [ 'TestBoxes',              self._sActionUrlBase + self.ksActionTestBoxList ],
                    [ 'Scheduling Groups',      self._sActionUrlBase + self.ksActionSchedGroupList ],
                    [ 'New TestBox',            self._sActionUrlBase + self.ksActionTestBoxAdd ],
                    [ 'New Scheduling Group',   self._sActionUrlBase + self.ksActionSchedGroupAdd ],
                    [ 'Regenerate All Scheduling Queues', self._sActionUrlBase + self.ksActionTestBoxesRegenQueues ],
                ]
            ],
            [
                'Test Config', self._sActionUrlBase + self.ksActionTestGroupList,
                [
                    [ 'Test Cases',             self._sActionUrlBase + self.ksActionTestCaseList ],
                    [ 'Test Groups',            self._sActionUrlBase + self.ksActionTestGroupList ],
                    [ 'Global Resources',       self._sActionUrlBase + self.ksActionGlobalRsrcShowAll ],
                    [ 'New Test Case',          self._sActionUrlBase + self.ksActionTestCaseAdd ],
                    [ 'New Test Group',         self._sActionUrlBase + self.ksActionTestGroupAdd ],
                    [ 'New Global Resource',    self._sActionUrlBase + self.ksActionGlobalRsrcShowAdd ],
                    [ 'Regenerate All Scheduling Queues', self._sActionUrlBase + self.ksActionTestCfgRegenQueues ],
                ]
            ],
            [
                '> Test Results', 'index.py?' + webutils.encodeUrlParams(self._dDbgParams), []
            ],
        ]
    def __init__(self, oSrvGlue):
        WuiDispatcherBase.__init__(self, oSrvGlue, self.ksScriptName);

        self._sTemplate     = 'template.html'

        #
        # Populate the action dispatcher dictionary.
        #

        # Use short form to avoid hitting the right margin (130) when using lambda.
        d = self._dDispatch;  # pylint: disable=C0103

        from testmanager.webui.wuitestresult import WuiGroupedResultList;
        #d[self.ksActionResultsUnGrouped]          = lambda: self._actionResultsListing(TestResultLogic, WuiGroupedResultList)
        d[self.ksActionResultsUnGrouped]          = lambda: self._actionGroupedResultsListing(
                                                                TestResultLogic.ksResultsGroupingTypeNone,
                                                                TestResultLogic,
                                                                WuiGroupedResultList)

        d[self.ksActionResultsGroupedByTestGroup] = lambda: self._actionGroupedResultsListing(
                                                                TestResultLogic.ksResultsGroupingTypeTestGroup,
                                                                TestResultLogic,
                                                                WuiGroupedResultList)

        d[self.ksActionResultsGroupedByBuildRev]  = lambda: self._actionGroupedResultsListing(
                                                                TestResultLogic.ksResultsGroupingTypeBuildRev,
                                                                TestResultLogic,
                                                                WuiGroupedResultList)

        d[self.ksActionResultsGroupedByTestBox]   = lambda: self._actionGroupedResultsListing(
                                                                TestResultLogic.ksResultsGroupingTypeTestBox,
                                                                TestResultLogic,
                                                                WuiGroupedResultList)

        d[self.ksActionResultsGroupedByTestCase]   = lambda: self._actionGroupedResultsListing(
                                                                TestResultLogic.ksResultsGroupingTypeTestCase,
                                                                TestResultLogic,
                                                                WuiGroupedResultList)

        d[self.ksActionResultsGroupedBySchedGroup] = lambda: self._actionGroupedResultsListing(
                                                                TestResultLogic.ksResultsGroupingTypeSchedGroup,
                                                                TestResultLogic,
                                                                WuiGroupedResultList)

        d[self.ksActionTestResultDetails]          = self.actionTestResultDetails

        d[self.ksActionViewLog]                 = self.actionViewLog;
        d[self.ksActionGetFile]                 = self.actionGetFile;
        from testmanager.webui.wuireport import WuiReportSummary, WuiReportSuccessRate, WuiReportFailureReasons;
        d[self.ksActionReportSummary]           = lambda: self._actionGenericReport(ReportLazyModel, WuiReportSummary);
        d[self.ksActionReportRate]              = lambda: self._actionGenericReport(ReportLazyModel, WuiReportSuccessRate);
        d[self.ksActionReportFailureReasons]    = lambda: self._actionGenericReport(ReportLazyModel, WuiReportFailureReasons);
        d[self.ksActionGraphWiz]                = self._actionGraphWiz;
        d[self.ksActionVcsHistoryTooltip]       = self._actionVcsHistoryTooltip;


        #
        # Popupate the menus.
        #

        # Additional URL parameters keeping for time navigation.
        sExtraTimeNav = ''
        dCurParams = oSrvGlue.getParameters()
        if dCurParams is not None:
            asActionUrlExtras = [ self.ksParamItemsPerPage, self.ksParamEffectiveDate, self.ksParamEffectivePeriod, ];
            for sExtraParam in asActionUrlExtras:
                if sExtraParam in dCurParams:
                    sExtraTimeNav += '&%s' % webutils.encodeUrlParams({sExtraParam: dCurParams[sExtraParam]})

        # Shorthand to keep within margins.
        sActUrlBase = self._sActionUrlBase;

        self._aaoMenus = \
        [
            [
                'Inbox',            sActUrlBase + 'TODO', ## @todo list of failures that needs categorizing.
                []
            ],
            [
                'Reports',          sActUrlBase + self.ksActionReportSummary,
                [
                    [ 'Summary',                  sActUrlBase + self.ksActionReportSummary ],
                    [ 'Success Rate',             sActUrlBase + self.ksActionReportRate ],
                    [ 'Failure Reasons',          sActUrlBase + self.ksActionReportFailureReasons ],
                ]
            ],
            [
                'Test Results',     sActUrlBase + self.ksActionResultsUnGrouped + sExtraTimeNav,
                [
                    [ 'Ungrouped results',           sActUrlBase + self.ksActionResultsUnGrouped           + sExtraTimeNav ],
                    [ 'Grouped by Scheduling Group', sActUrlBase + self.ksActionResultsGroupedBySchedGroup + sExtraTimeNav ],
                    [ 'Grouped by Test Group',       sActUrlBase + self.ksActionResultsGroupedByTestGroup  + sExtraTimeNav ],
                    [ 'Grouped by TestBox',          sActUrlBase + self.ksActionResultsGroupedByTestBox    + sExtraTimeNav ],
                    [ 'Grouped by Test Case',        sActUrlBase + self.ksActionResultsGroupedByTestCase   + sExtraTimeNav ],
                    [ 'Grouped by Revision',         sActUrlBase + self.ksActionResultsGroupedByBuildRev   + sExtraTimeNav ],
                ]
            ],
            [
                '> Admin', 'admin.py?' + webutils.encodeUrlParams(self._dDbgParams), []
            ],
        ];
    def _generatePage(self):
        """Override parent handler in order to change page title."""
        if self._sPageTitle is not None:
            self._sPageTitle = 'Test Results - ' + self._sPageTitle

        return WuiDispatcherBase._generatePage(self)
    def __init__(self, oSrvGlue):
        WuiDispatcherBase.__init__(self, oSrvGlue, self.ksScriptName);

        self._sTemplate     = 'template.html';

        # Use short form to avoid hitting the right margin (130) when using lambda.
        d = self._dDispatch;  # pylint: disable=C0103

        #
        # System Log actions.
        #
        d[self.ksActionSystemLogList]           = lambda: self._actionGenericListing(SystemLogLogic, WuiAdminSystemLogList)

        #
        # User Account actions.
        #
        d[self.ksActionUserList]                = lambda: self._actionGenericListing(UserAccountLogic, WuiUserAccountList)
        d[self.ksActionUserAdd]                 = lambda: self._actionGenericFormAdd(UserAccountData, WuiUserAccount)
        d[self.ksActionUserEdit]                = lambda: self._actionGenericFormEdit(UserAccountData, WuiUserAccount,
                                                                                      UserAccountData.ksParam_uid);
        d[self.ksActionUserAddPost]             = lambda: self._actionGenericFormAddPost(UserAccountData, UserAccountLogic,
                                                                                         WuiUserAccount, self.ksActionUserList)
        d[self.ksActionUserEditPost]            = lambda: self._actionGenericFormEditPost(UserAccountData, UserAccountLogic,
                                                                                          WuiUserAccount, self.ksActionUserList)
        d[self.ksActionUserDelPost]             = lambda: self._actionGenericDoRemove(UserAccountLogic,
                                                                                      UserAccountData.ksParam_uid,
                                                                                      self.ksActionUserList)

        #
        # TestBox actions.
        #
        d[self.ksActionTestBoxList]             = lambda: self._actionGenericListing(TestBoxLogic, WuiTestBoxList);
        d[self.ksActionTestBoxListPost]         = self._actionTestBoxListPost;
        d[self.ksActionTestBoxAdd]              = lambda: self._actionGenericFormAdd(TestBoxData, WuiTestBox);
        d[self.ksActionTestBoxAddPost]          = lambda: self._actionGenericFormAddPost(TestBoxData, TestBoxLogic,
                                                                                         WuiTestBox, self.ksActionTestBoxList);
        d[self.ksActionTestBoxDetails]          = lambda: self._actionGenericFormDetails(TestBoxData, TestBoxLogic, WuiTestBox,
                                                                                         'idTestBox', 'idGenTestBox');
        d[self.ksActionTestBoxEdit]             = lambda: self._actionGenericFormEdit(TestBoxData, WuiTestBox,
                                                                                      TestBoxData.ksParam_idTestBox);
        d[self.ksActionTestBoxEditPost]         = lambda: self._actionGenericFormEditPost(TestBoxData, TestBoxLogic,
                                                                                          WuiTestBox, self.ksActionTestBoxList);
        d[self.ksActionTestBoxRemovePost]       = lambda: self._actionGenericDoRemove(TestBoxLogic,
                                                                                      TestBoxData.ksParam_idTestBox,
                                                                                      self.ksActionTestBoxList)
        d[self.ksActionTestBoxesRegenQueues]    = self._actionRegenQueuesCommon;

        #
        # Test Case actions.
        #
        d[self.ksActionTestCaseList]            = lambda: self._actionGenericListing(TestCaseLogic, WuiTestCaseList);
        d[self.ksActionTestCaseAdd]             = lambda: self._actionGenericFormAdd(TestCaseDataEx, WuiTestCase);
        d[self.ksActionTestCaseAddPost]         = lambda: self._actionGenericFormAddPost(TestCaseDataEx, TestCaseLogic,
                                                                                         WuiTestCase, self.ksActionTestCaseList);
        d[self.ksActionTestCaseClone]           = lambda: self._actionGenericFormClone(  TestCaseDataEx, WuiTestCase,
                                                                                         'idTestCase', 'idGenTestCase');
        d[self.ksActionTestCaseDetails]         = lambda: self._actionGenericFormDetails(TestCaseDataEx, TestCaseLogic,
                                                                                         WuiTestCase, 'idTestCase',
                                                                                         'idGenTestCase');
        d[self.ksActionTestCaseEdit]            = lambda: self._actionGenericFormEdit(TestCaseDataEx, WuiTestCase,
                                                                                      TestCaseDataEx.ksParam_idTestCase);
        d[self.ksActionTestCaseEditPost]        = lambda: self._actionGenericFormEditPost(TestCaseDataEx, TestCaseLogic,
                                                                                          WuiTestCase, self.ksActionTestCaseList);
        d[self.ksActionTestCaseDoRemove]        = lambda: self._actionGenericDoRemove(TestCaseLogic,
                                                                                      TestCaseData.ksParam_idTestCase,
                                                                                      self.ksActionTestCaseList);

        #
        # Global Resource actions
        #
        d[self.ksActionGlobalRsrcShowAll]       = lambda: self._actionGenericListing(GlobalResourceLogic, WuiGlobalResourceList)
        d[self.ksActionGlobalRsrcShowAdd]       = lambda: self._actionGlobalRsrcShowAddEdit(WuiAdmin.ksActionGlobalRsrcAdd)
        d[self.ksActionGlobalRsrcShowEdit]      = lambda: self._actionGlobalRsrcShowAddEdit(WuiAdmin.ksActionGlobalRsrcEdit)
        d[self.ksActionGlobalRsrcAdd]           = lambda: self._actionGlobalRsrcAddEdit(WuiAdmin.ksActionGlobalRsrcAdd)
        d[self.ksActionGlobalRsrcEdit]          = lambda: self._actionGlobalRsrcAddEdit(WuiAdmin.ksActionGlobalRsrcEdit)
        d[self.ksActionGlobalRsrcDel]           = lambda: self._actionGenericDoDelOld(GlobalResourceLogic,
                                                                                      GlobalResourceData.ksParam_idGlobalRsrc,
                                                                                      self.ksActionGlobalRsrcShowAll)

        #
        # Build Source actions
        #
        d[self.ksActionBuildSrcList]        = lambda: self._actionGenericListing(BuildSourceLogic, WuiAdminBuildSrcList)
        d[self.ksActionBuildSrcAdd]         = lambda: self._actionGenericFormAdd(BuildSourceData, WuiAdminBuildSrc);
        d[self.ksActionBuildSrcAddPost]     = lambda: self._actionGenericFormAddPost(BuildSourceData, BuildSourceLogic,
                                                                                     WuiAdminBuildSrc, self.ksActionBuildSrcList);
        d[self.ksActionBuildSrcClone]       = lambda: self._actionGenericFormClone(  BuildSourceData, WuiAdminBuildSrc,
                                                                                     'idBuildSrc');
        d[self.ksActionBuildSrcDetails]     = lambda: self._actionGenericFormDetails(BuildSourceData, BuildSourceLogic,
                                                                                     WuiAdminBuildSrc, 'idBuildSrc');
        d[self.ksActionBuildSrcDoRemove]    = lambda: self._actionGenericDoRemove(BuildSourceLogic,
                                                                                  BuildSourceData.ksParam_idBuildSrc,
                                                                                  self.ksActionBuildSrcList);
        d[self.ksActionBuildSrcEdit]        = lambda: self._actionGenericFormEdit(BuildSourceData, WuiAdminBuildSrc,
                                                                                  BuildSourceData.ksParam_idBuildSrc);
        d[self.ksActionBuildSrcEditPost]    = lambda: self._actionGenericFormEditPost(BuildSourceData, BuildSourceLogic,
                                                                                      WuiAdminBuildSrc,
                                                                                      self.ksActionBuildSrcList);


        #
        # Build actions
        #
        d[self.ksActionBuildList]           = lambda: self._actionGenericListing(BuildLogic, WuiAdminBuildList)
        d[self.ksActionBuildAdd]            = lambda: self._actionGenericFormAdd(BuildData, WuiAdminBuild)
        d[self.ksActionBuildAddPost]        = lambda: self._actionGenericFormAddPost(BuildData, BuildLogic, WuiAdminBuild,
                                                                                     self.ksActionBuildList)
        d[self.ksActionBuildClone]          = lambda: self._actionGenericFormClone(  BuildData, WuiAdminBuild, 'idBuild');
        d[self.ksActionBuildDetails]        = lambda: self._actionGenericFormDetails(BuildData, BuildLogic,
                                                                                     WuiAdminBuild, 'idBuild');
        d[self.ksActionBuildDoRemove]       = lambda: self._actionGenericDoRemove(BuildLogic, BuildData.ksParam_idBuild,
                                                                                  self.ksActionBuildList);
        d[self.ksActionBuildEdit]           = lambda: self._actionGenericFormEdit(BuildData, WuiAdminBuild,
                                                                                  BuildData.ksParam_idBuild);
        d[self.ksActionBuildEditPost]       = lambda: self._actionGenericFormEditPost(BuildData, BuildLogic, WuiAdminBuild,
                                                                                      self.ksActionBuildList)

        #
        # Build Black List actions
        #
        d[self.ksActionBuildBlacklist]          = lambda: self._actionGenericListing(BuildBlacklistLogic,
                                                                                     WuiAdminListOfBlacklistItems);
        d[self.ksActionBuildBlacklistAdd]       = lambda: self._actionGenericFormAdd(BuildBlacklistData, WuiAdminBuildBlacklist);
        d[self.ksActionBuildBlacklistAddPost]   = lambda: self._actionGenericFormAddPost(BuildBlacklistData, BuildBlacklistLogic,
                                                                                         WuiAdminBuildBlacklist,
                                                                                         self.ksActionBuildBlacklist);
        d[self.ksActionBuildBlacklistClone]     = lambda: self._actionGenericFormClone(BuildBlacklistData,
                                                                                       WuiAdminBuildBlacklist,
                                                                                       'idBlacklisting');
        d[self.ksActionBuildBlacklistDetails]   = lambda: self._actionGenericFormDetails(BuildBlacklistData,
                                                                                         BuildBlacklistLogic,
                                                                                         WuiAdminBuildBlacklist,
                                                                                         'idBlacklisting');
        d[self.ksActionBuildBlacklistDoRemove]  = lambda: self._actionGenericDoRemove(BuildBlacklistLogic,
                                                                                      BuildBlacklistData.ksParam_idBlacklisting,
                                                                                      self.ksActionBuildBlacklist)
        d[self.ksActionBuildBlacklistEdit]      = lambda: self._actionGenericFormEdit(BuildBlacklistData,
                                                                                      WuiAdminBuildBlacklist,
                                                                                      BuildBlacklistData.ksParam_idBlacklisting);
        d[self.ksActionBuildBlacklistEditPost]  = lambda: self._actionGenericFormEditPost(BuildBlacklistData,
                                                                                          BuildBlacklistLogic,
                                                                                          WuiAdminBuildBlacklist,
                                                                                          self.ksActionBuildBlacklist)


        #
        # Failure Category actions
        #
        d[self.ksActionFailureCategoryList]     = lambda: self._actionGenericListing(
                                                                FailureCategoryLogic,
                                                                WuiFailureCategoryList)

        d[self.ksActionFailureCategoryShowAdd]  = lambda: self._actionGenericFormAdd(
                                                                FailureCategoryData,
                                                                WuiFailureCategory)

        d[self.ksActionFailureCategoryShowEdit] = lambda: self._actionGenericFormEditL(
                                                                FailureCategoryLogic,
                                                                FailureCategoryData.ksParam_idFailureCategory,
                                                                WuiFailureCategory)

        d[self.ksActionFailureCategoryAdd]      = lambda: self._actionGenericFormAddPost(
                                                                FailureCategoryData,
                                                                FailureCategoryLogic,
                                                                WuiFailureCategory,
                                                                self.ksActionFailureCategoryList)

        d[self.ksActionFailureCategoryEdit]     = lambda: self._actionGenericFormEditPost(
                                                                FailureCategoryData,
                                                                FailureCategoryLogic,
                                                                WuiFailureCategory,
                                                                self.ksActionFailureCategoryList)

        d[self.ksActionFailureCategoryDel]      = lambda: self._actionGenericDoDelOld(
                                                                FailureCategoryLogic,
                                                                FailureCategoryData.ksParam_idFailureCategory,
                                                                self.ksActionFailureCategoryList)

        #
        # Failure Reason actions
        #
        d[self.ksActionFailureReasonList]       = lambda: self._actionGenericListing(
                                                                FailureReasonLogic,
                                                                WuiAdminFailureReasonList)

        d[self.ksActionFailureReasonShowAdd]    = lambda: self._actionGenericFormAdd(
                                                                FailureReasonData,
                                                                WuiAdminFailureReason)

        d[self.ksActionFailureReasonShowEdit]   = lambda: self._actionGenericFormEditL(
                                                                FailureReasonLogic,
                                                                FailureReasonData.ksParam_idFailureReason,
                                                                WuiAdminFailureReason)

        d[self.ksActionFailureReasonAdd]        = lambda: self._actionGenericFormAddPost(
                                                                FailureReasonData,
                                                                FailureReasonLogic,
                                                                WuiAdminFailureReason,
                                                                self.ksActionFailureReasonList)

        d[self.ksActionFailureReasonEdit]       = lambda: self._actionGenericFormEditPost(
                                                                FailureReasonData,
                                                                FailureReasonLogic,
                                                                WuiAdminFailureReason,
                                                                self.ksActionFailureReasonList)

        d[self.ksActionFailureReasonDel]        = lambda: self._actionGenericDoDelOld(FailureReasonLogic,
                                                                                      FailureReasonData.ksParam_idFailureReason,
                                                                                      self.ksActionFailureReasonList)

        #
        # Build Category actions
        #
        d[self.ksActionBuildCategoryList]       = lambda: self._actionGenericListing(BuildCategoryLogic, WuiAdminBuildCatList);
        d[self.ksActionBuildCategoryAdd]        = lambda: self._actionGenericFormAdd(BuildCategoryData, WuiAdminBuildCat);
        d[self.ksActionBuildCategoryAddPost]    = lambda: self._actionGenericFormAddPost(BuildCategoryData, BuildCategoryLogic,
                                                                                     WuiAdminBuildCat,
                                                                                     self.ksActionBuildCategoryList);
        d[self.ksActionBuildCategoryClone]      = lambda: self._actionGenericFormClone(  BuildCategoryData, WuiAdminBuildCat,
                                                                                         'idBuildCategory');
        d[self.ksActionBuildCategoryDetails]    = lambda: self._actionGenericFormDetails(BuildCategoryData, BuildCategoryLogic,
                                                                                         WuiAdminBuildCat, 'idBuildCategory');
        d[self.ksActionBuildCategoryDoRemove]   = lambda: self._actionGenericDoRemove(BuildCategoryLogic,
                                                                                  BuildCategoryData.ksParam_idBuildCategory,
                                                                                  self.ksActionBuildCategoryList)

        #
        # Test Group actions
        #
        d[self.ksActionTestGroupList]       = lambda: self._actionGenericListing(TestGroupLogic, WuiTestGroupList);
        d[self.ksActionTestGroupAdd]        = lambda: self._actionGenericFormAdd(TestGroupDataEx, WuiTestGroup);
        d[self.ksActionTestGroupAddPost]    = lambda: self._actionGenericFormAddPost(TestGroupDataEx, TestGroupLogic,
                                                                                     WuiTestGroup, self.ksActionTestGroupList);
        d[self.ksActionTestGroupClone]      = lambda: self._actionGenericFormClone(  TestGroupDataEx, WuiTestGroup,
                                                                                     'idTestGroup');
        d[self.ksActionTestGroupDetails]    = lambda: self._actionGenericFormDetails(TestGroupDataEx, TestGroupLogic,
                                                                                     WuiTestGroup, 'idTestGroup');
        d[self.ksActionTestGroupEdit]       = lambda: self._actionGenericFormEdit(TestGroupDataEx, WuiTestGroup,
                                                                                  TestGroupDataEx.ksParam_idTestGroup);
        d[self.ksActionTestGroupEditPost]   = lambda: self._actionGenericFormEditPost(TestGroupDataEx, TestGroupLogic,
                                                                                      WuiTestGroup, self.ksActionTestGroupList);
        d[self.ksActionTestGroupDoRemove]   = lambda: self._actionGenericDoRemove(TestGroupLogic,
                                                                                  TestGroupDataEx.ksParam_idTestGroup,
                                                                                  self.ksActionTestGroupList)
        d[self.ksActionTestCfgRegenQueues]  = self._actionRegenQueuesCommon;

        #
        # Scheduling Group actions
        #
        d[self.ksActionSchedGroupList]      = lambda: self._actionGenericListing(SchedGroupLogic, WuiAdminSchedGroupList)
        d[self.ksActionSchedGroupAdd]       = lambda: self._actionGenericFormAdd(SchedGroupDataEx, WuiSchedGroup);
        d[self.ksActionSchedGroupClone]     = lambda: self._actionGenericFormClone(  SchedGroupDataEx, WuiSchedGroup,
                                                                                     'idSchedGroup');
        d[self.ksActionSchedGroupDetails]   = lambda: self._actionGenericFormDetails(SchedGroupDataEx, SchedGroupLogic,
                                                                                     WuiSchedGroup, 'idSchedGroup');
        d[self.ksActionSchedGroupEdit]      = lambda: self._actionGenericFormEdit(SchedGroupDataEx, WuiSchedGroup,
                                                                                  SchedGroupData.ksParam_idSchedGroup);
        d[self.ksActionSchedGroupAddPost]   = lambda: self._actionGenericFormAddPost(SchedGroupDataEx, SchedGroupLogic,
                                                                                     WuiSchedGroup, self.ksActionSchedGroupList);
        d[self.ksActionSchedGroupEditPost]  = lambda: self._actionGenericFormEditPost(SchedGroupDataEx, SchedGroupLogic,
                                                                                      WuiSchedGroup, self.ksActionSchedGroupList);
        d[self.ksActionSchedGroupDoRemove]  = lambda: self._actionGenericDoRemove(SchedGroupLogic,
                                                                                  SchedGroupData.ksParam_idSchedGroup,
                                                                                  self.ksActionSchedGroupList)

        self._aaoMenus = \
        [
            [
                'Builds',       self._sActionUrlBase + self.ksActionBuildList,
                [
                    [ 'Builds',                 self._sActionUrlBase + self.ksActionBuildList ],
                    [ 'Blacklist',              self._sActionUrlBase + self.ksActionBuildBlacklist ],
                    [ 'Build Sources',          self._sActionUrlBase + self.ksActionBuildSrcList ],
                    [ 'Build Categories',       self._sActionUrlBase + self.ksActionBuildCategoryList ],
                    [ 'New Build',              self._sActionUrlBase + self.ksActionBuildAdd ],
                    [ 'New Blacklisting',       self._sActionUrlBase + self.ksActionBuildBlacklistAdd ],
                    [ 'New Build Source',       self._sActionUrlBase + self.ksActionBuildSrcAdd],
                    [ 'New Build Category',     self._sActionUrlBase + self.ksActionBuildCategoryAdd ],
                ]
            ],
            [
                'Failure Reasons',       self._sActionUrlBase + self.ksActionFailureReasonList,
                [
                    [ 'Failure Categories',     self._sActionUrlBase + self.ksActionFailureCategoryList ],
                    [ 'Failure Reasons',        self._sActionUrlBase + self.ksActionFailureReasonList ],
                    [ 'New Failure Category',   self._sActionUrlBase + self.ksActionFailureCategoryShowAdd ],
                    [ 'New Failure Reason',     self._sActionUrlBase + self.ksActionFailureReasonShowAdd ],
                ]
            ],
            [
                'System',      self._sActionUrlBase + self.ksActionSystemLogList,
                [
                    [ 'System Log',             self._sActionUrlBase + self.ksActionSystemLogList ],
                    [ 'User Accounts',          self._sActionUrlBase + self.ksActionUserList ],
                    [ 'New User',               self._sActionUrlBase + self.ksActionUserAdd ],
                ]
            ],
            [
                'TestBoxes',   self._sActionUrlBase + self.ksActionTestBoxList,
                [
                    [ 'TestBoxes',              self._sActionUrlBase + self.ksActionTestBoxList ],
                    [ 'Scheduling Groups',      self._sActionUrlBase + self.ksActionSchedGroupList ],
                    [ 'New TestBox',            self._sActionUrlBase + self.ksActionTestBoxAdd ],
                    [ 'New Scheduling Group',   self._sActionUrlBase + self.ksActionSchedGroupAdd ],
                    [ 'Regenerate All Scheduling Queues', self._sActionUrlBase + self.ksActionTestBoxesRegenQueues ],
                ]
            ],
            [
                'Test Config', self._sActionUrlBase + self.ksActionTestGroupList,
                [
                    [ 'Test Cases',             self._sActionUrlBase + self.ksActionTestCaseList ],
                    [ 'Test Groups',            self._sActionUrlBase + self.ksActionTestGroupList ],
                    [ 'Global Resources',       self._sActionUrlBase + self.ksActionGlobalRsrcShowAll ],
                    [ 'New Test Case',          self._sActionUrlBase + self.ksActionTestCaseAdd ],
                    [ 'New Test Group',         self._sActionUrlBase + self.ksActionTestGroupAdd ],
                    [ 'New Global Resource',    self._sActionUrlBase + self.ksActionGlobalRsrcShowAdd ],
                    [ 'Regenerate All Scheduling Queues', self._sActionUrlBase + self.ksActionTestCfgRegenQueues ],
                ]
            ],
            [
                '> Test Results', 'index.py?' + webutils.encodeUrlParams(self._dDbgParams), []
            ],
        ];