cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# -*- coding: utf-8 -*-
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncTest Manager WUI - Builds.
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# Validation Kit imports.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuicontentbase import WuiFormContentBase, WuiListContentBase, WuiTmLink, WuiBuildLogLink, \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.build import BuildData, BuildCategoryLogic;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.buildblacklist import BuildBlacklistData;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.core.db import isDbTimestampInfinity;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WUI Build HTML content generator.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiFormContentBase.__init__(self, oData, sMode, 'Build', oDisp, sTitle);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oForm.addIntRO (BuildData.ksParam_idBuild, oData.idBuild, 'Build ID')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oForm.addTimestampRO(BuildData.ksParam_tsCreated, oData.tsCreated, 'Created')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oForm.addTimestampRO(BuildData.ksParam_tsEffective, oData.tsEffective, 'Last changed')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oForm.addTimestampRO(BuildData.ksParam_tsExpire, oData.tsExpire, 'Expires (excl)')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oForm.addIntRO (BuildData.ksParam_uidAuthor, oData.uidAuthor, 'Changed by UID')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oForm.addComboBox (BuildData.ksParam_idBuildCategory, oData.idBuildCategory, 'Build category',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync BuildCategoryLogic(self._oDisp.getDb()).fetchForCombo());
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oForm.addInt (BuildData.ksParam_iRevision, oData.iRevision, 'Revision')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oForm.addText (BuildData.ksParam_sVersion, oData.sVersion, 'Version')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oForm.addWideText (BuildData.ksParam_sLogUrl, oData.sLogUrl, 'Log URL')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oForm.addWideText (BuildData.ksParam_sBinaries, oData.sBinaries, 'Binaries')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oForm.addCheckBox (BuildData.ksParam_fBinariesDeleted, oData.fBinariesDeleted, 'Binaries deleted')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WUI Admin Build List Content Generator.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def __init__(self, aoEntries, iPage, cItemsPerPage, tsEffective, fnDPrint, oDisp):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiListContentBase.__init__(self, aoEntries, iPage, cItemsPerPage, tsEffective,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTitle = 'Builds', sId = 'builds', fnDPrint = fnDPrint, oDisp = oDisp);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._asColumnHeaders = ['ID', 'Product', 'Branch', 'Version',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self._asColumnAttribs = ['align="right"', 'align="center"', 'align="center"', 'align="center"',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'align="center"', 'align="center"', 'align="center"', 'align="center"',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aoActions.append(WuiBuildLogLink(oEntry.sLogUrl, 'Build Log'));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync dParams = { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildBlacklistAdd,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync BuildBlacklistData.ksParam_sProduct: oEntry.oCat.sProduct,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync BuildBlacklistData.ksParam_sBranch: oEntry.oCat.sBranch,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync BuildBlacklistData.ksParam_asTypes: oEntry.oCat.sType,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync BuildBlacklistData.ksParam_asOsArches: oEntry.oCat.asOsArches,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync BuildBlacklistData.ksParam_iFirstRevision: oEntry.iRevision,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync BuildBlacklistData.ksParam_iLastRevision: oEntry.iRevision }
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiTmLink('Blacklist', WuiAdmin.ksScriptName, dParams),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildDetails,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiAdmin.ksParamEffectiveDate: self._tsEffectiveDate, }),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildClone,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiAdmin.ksParamEffectiveDate: self._tsEffectiveDate, }),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildEdit,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync { WuiAdmin.ksParamAction: WuiAdmin.ksActionBuildDoRemove,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sConfirm = 'Are you sure you want to remove build #%d?' % (oEntry.idBuild,) ),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync WuiSvnLinkWithTooltip(oEntry.iRevision, oEntry.oCat.sRepository,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sName = '%s r%s' % (oEntry.sVersion, oEntry.iRevision,)),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'batch' if oEntry.uidAuthor is None else oEntry.uidAuthor,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync oEntry.sBinaries if not oEntry.fBinariesDeleted else '<Deleted>',