Subversion Repositories DevTools

Rev

Rev 7379 | Rev 7458 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%
'=====================================================
'               CONFIG FILE
'=====================================================
%>
<!--#include file="base_conf.asp"-->

<%
' -- Variable Definition ------------------------------
Dim OraSession, OraDatabase      ' DB connection
Dim scriptName
Dim rootPath
Dim DocRepositiryLink, DocRepositiryLinkOld, DocBrowseLink
Dim APP_ROOT, QUERIES_PATH
Dim archive_server
Dim lxr_server
Dim LXR_URL
Dim dpkg_archiveURL
Dim HTTP_PKG_ARCHIVE
Dim release_archiveURL
Dim ACCESS_MANAGER_URL
Dim DEPLOYMENT_MANAGER_URL
Dim PRODUCTION_MANAGER_URL
Dim RELEASE_MANAGER_URL
Dim ABTLOG_URL
Dim strRelativePath             ' Rel Path from script to URL
Dim managerSuiteBase            ' Url to the base of the Manager Suite
Dim siteRootUrl                 ' Full url to the base of the site
Dim MAIL_SERVER
Dim FAULT_EMAIL_LIST
Dim FavIcon                     ' Favorite Icon
Dim ServiceConfig               ' All service config
Dim ForcePageLogon              ' Page Protection Mode
Dim IndefPause                  ' Global indication of error
Dim VixVerNum : VixVerNum = 35  ' Bump to force cache reload of many resources

' -- Variable Initialisation --------------------------
'Set OraSession = CreateObject("OracleInProcServer.XOraSession")
'OraSession.CreateDatabasePool 1,2,1, TNS_NAME, DB_AUTHENTICATION, 0
'Set OraDatabase = OraSession.GetDatabaseFromPool(5000)

'Set OraSession = Application("ORA_SESSION")
'Set OraDatabase =    OraSession.GetDatabaseFromPool(5000)
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDatabase( TNS_NAME, DB_AUTHENTICATION, Cint(0))
Set ServiceConfig = CreateObject("Scripting.Dictionary")
GetServiceConfig()
GetIndefPause()

'--------------------------------------------------------------------------------------
'Populate ServiceConfig
Sub GetIndefPause()
    IndefPause = FALSE

    Dim sqry : sqry = "select * from run_level_schedule rls where rls.indefinite_pause = 'P'"
    Dim rsTemp : Set rsTemp = OraDatabase.DbCreateDynaset( sqry , cint(0) )

    If rsTemp.RecordCount > 0 Then
        IndefPause = TRUE
    End If
   rsTemp.Close()
   Set rsTemp = Nothing
End Sub

'--------------------------------------------------------------------------------------
'Populate ServiceConfig
Sub GetServiceConfig()
   Dim sqry: sqry = "SELECT * FROM BUILD_SERVICE_CONFIG WHERE service NOT IN ('MUTEX','WEB SERVER')"
   Dim rsTemp : Set rsTemp = OraDatabase.DbCreateDynaset( sqry , cint(0) )

   Do While(rsTemp.EOF=FALSE)
        Dim name : name = rsTemp(0)
        Dim val : val  = rsTemp(1)
        ServiceConfig.Add name, val
        rsTemp.MoveNext
   Loop

   rsTemp.Close()
   Set rsTemp = Nothing

End Sub

'--------------------------------------------------------------------------------------
'Return a relative path to the server base. Used for relative pathing to 'images'
'Assumes server base is two directores below the web serve root (ManageSuite/Release_Manager)
Function GetPathToBase()
    Dim url,depth,rv,ii
    url = request.servervariables("URL")
    depth =  len(url) - len(replace(url, "/", ""))
    rv = ""
    For ii = 4 To depth
        rv = rv & "../"
    Next
    GetPathToBase = rv
End Function

' Return a URL to the base of the Manager suite
' Assumes this is one directory down from the web server root
Function GetManagerSuiteBase
    Dim data
    data = Split(request.servervariables("URL"),"/")
    GetManagerSuiteBase =  "/" & data(1)
End Function

'--------------------------------------------------------------------------------------
Function getSiteRootUrl()
    dim siteRootUrl, protocol, hostname, port

    if Request.ServerVariables("HTTPS") = "off" then
        protocol = "http"
    else
        protocol = "https"
    end if
    siteRootUrl = protocol & "://"

    hostname = Request.ServerVariables("HTTP_HOST")
    siteRootUrl = siteRootUrl & hostname        

    getSiteRootUrl = siteRootUrl
End Function

'--------------------------------------------------------------------------------------
' Determine if a variable or Const exists and is not empty
'   Use to check if a vbscript variable has been declared and contains a non-empty value
Function isDefined( var)
    If (not IsEmpty(Eval(var))) AND Eval(var & " <> """"") Then
        isDefined = TRUE
    Else
        isDefined = FALSE
   End If
End Function

'--------------------------------------------------------------------------------------
'   Get an application varibale as a Boolean with defult value
Function bGetApplication(name, defvalue)
    If IsEmpty (Application(name)) Then
        bGetApplication = CBool(defvalue)
    Else
        bGetApplication = CBool(Application(name))
   End If
End Function

'--------------------------------------------------------------------------------------
' Debug Support function
'   Add string to the debug string
Sub AddRmDebug(str)
    If Len(RmDebug) > 0  Then RmDebug = RmDebug + ":"
    RmDebug = RmDebug + Cstr(str)
End Sub

'-----------------------------------------------------------------------------------------------------------------------------
'   Destroy_All_Objects
'   Should be used by ALL pages and error handling code in order to reduce memory and handle leaks
'   Needs to kept in sync with common/destructor.asp
Sub Destroy_All_Objects
    On Error Resume Next

    '   Some global objects
    Set objAccessControl = Nothing
    Set objPMod = Nothing
    Set objEH = Nothing
    Set objTabControl = Nothing
    Set ServiceConfig = Nothing

    '   Global package info
    Set pkgInfoHash = Nothing
    Set releaseInfoHash = Nothing

    '   Delete ALL Oracle bound variables
    '   Note: Bound Variables that remain at the end of a Page Process will cause an Oracle Session leak
    If TypeName(OraDatabase) = "IOraDatabase" Then
        While OraDatabase.Parameters.Count > 0
            OraDatabase.Parameters.Remove(0)
        Wend
    End  If

    '   Some commonly used database objects
    rsTemp.Close
    Set rsTemp = Nothing

    rsRep.Close
    Set rsRep = Nothing

    rsQry.Close
    Set rsQry = Nothing

    '   Database objects
    set OraDatabase = Nothing
    set OraSession = Nothing
End Sub
'--------------------------------------------------------------------------------------
archive_server = ServiceConfig("ARCHIVE SERVER")
lxr_server = ServiceConfig("LXR SERVER")
LXR_URL = "http://" & lxr_server & "/lxr/source"
MAIL_SERVER = ServiceConfig("MAIL SERVER")
FAULT_EMAIL_LIST = ServiceConfig("FAULT EMAIL ADDRESS LIST")
strRelativePath = GetPathToBase()
managerSuiteBase = GetManagerSuiteBase()
siteRootUrl = getSiteRootUrl()
APP_ROOT = Server.MapPath(".")
QUERIES_PATH = APP_ROOT &"\queries"
scriptName = Mid(Request.ServerVariables("SCRIPT_NAME"), InStrRev(Request.ServerVariables("SCRIPT_NAME"), "/") + 1 )
rootPath = Left( Server.MapPath( scriptName ), InStrRev(Server.MapPath( scriptName ), "\") )
DocRepositiryLink = DOC_REPOSITORY_URL & "docLinkTo.asp?docnum="
DocRepositiryLinkOld = DOC_REPOSITORY_URL & "docLinkTo.asp?old=1&fileid="
DocBrowseLink = DOC_REPOSITORY_URL & "docbrowse.asp"
FavIcon = strRelativePath & "favicons/RM" & Application("FavIconSuffix") & ".png"
ForcePageLogon = TRUE

' -- Constants ----------------------------------------
HTTP_PKG_ARCHIVE        = "http://" & archive_server
dpkg_archiveURL         = HTTP_PKG_ARCHIVE & "/dpkg_archive/"
release_archiveURL      = HTTP_PKG_ARCHIVE & "/releases/"
ACCESS_MANAGER_URL      = ManagerSuiteBase & "/Access_Manager"
DEPLOYMENT_MANAGER_URL  = ManagerSuiteBase & "/Deployment_Manager"
PRODUCTION_MANAGER_URL  = ManagerSuiteBase & "/Production_Manager"
RELEASE_MANAGER_URL     = ManagerSuiteBase & "/Release_Manager"
ABTLOG_URL              = HTTP_PKG_ARCHIVE & "/devl/abtlog"
%>
<%
'-- ERROR MESSAGES ---------------------------
Const enum_MSG_ERROR    = "msg_error.asp"
Const enum_WMSG_ERROR   = "wmsg_error.asp"

Const enum_MSG_SELECTED_PACKAGES_NOW_OFFICIAL               = "msg_selected_packages_now_official.asp"
Const enum_MSG_PACKAGES_NOT_MADE_OFFICIAL                   = "msg_packages_not_made_official.asp"
Const enum_MSG_PACKAGE_NOT_MADE_OFFICIAL                    = "msg_package_not_made_official.asp"
Const enum_MSG_PACKAGE_NOT_MADE_OFFICIAL_2                  = "msg_package_not_made_official_2.asp"
Const enum_MSG_UNOFFICIAL_DEPENDENCIES                      = "msg_unofficial_dependencies.asp"
Const enum_MSG_PACKAGE_CHANGETYPE_INCOMPLETE                = "msg_change_type_incomplete.asp"
Const enum_MSG_PACKAGE_SBOMPRIORITY_INCOMPLETE              = "msg_sbom_priority_incomplete.asp"
Const enum_MSG_VERSION_EXISTS                               = "msg_version_exists.asp"
Const enum_DUPLICATE_RUNTIME_DEPENDENCY                     = "msg_duplicate_runtime_dependency.asp"
Const enum_DUPLICATE_BUILD_DEPENDENCIES_IGNORED             = "msg_duplicate_build_dependencies_ignored.asp"
Const enum_MSG_BROKEN_DEPENDENCIES_FOUND                    = "msg_broken_dependencies_found.asp"
Const enum_MSG_MISSING_DEPENDENCIES                         = "msg_missing_dependencies.asp"
Const enum_MSG_UNOFFICIAL_DEPENDENCIES_FOUND                = "msg_unofficial_dependencies_found.asp"
Const enum_MSG_RELEASE_IS_NOW_OFFICIAL                      = "msg_release_is_now_official.asp"
Const enum_MSG_NEW_UNOFFICIAL_RELEASE_CREATED               = "msg_new_unofficial_release_created.asp"
Const enum_MSG_DUPLICATE_AN                                 = "msg_duplicate_an.asp"
Const enum_MSG_DUPLICATE_UT                                 = "msg_duplicate_ut.asp"
Const enum_MSG_PACKAGE_INFORMATION_INCOMPLETE               = "msg_package_information_incomplete.asp"
Const enum_MSG_VCS_INFORMATION_INCOMPLETE                   = "msg_vcs_information_incomplete.asp"
Const enum_MSG_MIXED_VCS                                    = "msg_mixed_vcs.asp"
Const enum_MSG_VCS_SVN_NOT_PEGGED                           = "msg_vcs_svn_not_pegged.asp"
Const enum_MSG_AUTOBUILD_PACKAGE_IS_UNCONTROLLED            = "msg_autobuild_package_is_uncontrolled.asp"
Const enum_MSG_AUTOBUILD_PACKAGE_REQUIRES_BUILD_STD_AND_ENV = "msg_autobuild_package_requires_build_std_and_env.asp"
Const enum_MSG_UNIT_TESTS_NOT_SUPPLIED                      = "msg_unit_tests_not_supplied.asp"
Const enum_MSG_REASON_FOR_THIS_VERSION_NOT_SUPLIED          = "msg_reason_for_this_version_not_suplied.asp"
Const enum_MSG_CANNOT_REMOVE_PACKAGE                        = "msg_cannot_remove_package.asp"
Const enum_MSG_PACKAGE_IN_USE                               = "msg_package_in_use.asp"
Const enum_MSG_PROCESS_EXISTS                               = "msg_process_exists.asp"
Const enum_MSG_NO_LICENCES_EXIST                            = "msg_no_licences.asp"
Const enum_MSG_PACKAGE_VERSION_EXISTS                       = "msg_package_version_exists.asp"
Const enum_MSG_PACKAGE_WIP_EXISTS                           = "msg_package_wip_exists.asp"
Const enum_MSG_PACKAGE_VERSION_INVALID                      = "msg_package_version_invalid.asp"
Const enum_MSG_CANNOT_AUTO_GENERATE_COTS_PKG                = "msg_cannot_auto_generate_cots_pkg.asp"
Const enum_MSG_PACKAGE_WIP_EXISTS_BULK_RELEASE              = "msg_package_wip_exists_bulk_release.asp"
Const enum_MSG_PERMISSION_PROBLEMS_BULK_RELEASE             = "msg_permission_problems_bulk_release.asp"
Const enum_MSG_UNBUILDABLE_PACKAGE                          = "msg_unbuildable_package.asp"
'---------------------------------------------
%>
<%
'-- ICONS Package State ----------------------
Const enum_imgBlank               = "<img src='images/h_trsp_dot.gif' width='19' height='17' border='0'>"
Const enum_imgCritical            = "<img src='images/s_critical.gif' width='19' height='17' border='0' title='Not ready to be built.  Dependent packages, with a major or minor version, require building'>"
Const enum_imgDeprecated          = "<img src='images/bomb.gif' width='19' height='17' border='0' title='Deprecated'>"
Const enum_imgProductRejected     = "<img src='icons/i_product_rejected.gif' width='19' height='17' border='0' title='Rejected'>"
Const enum_imgDeprecatedDependent = "<img src='images/bomb_dependant.gif' width='19' height='17' border='0' title='Dependent deprecated'>"
Const enum_imgCReady              = "<img src='images/s_update_critical.gif' width='19' height='17' border='0' title='Ready to build, however at least one dependency has been superseded with a major or minor version'>"
Const enum_imgAR                  = "<img src='images/i_advisory_ripple.gif' width='19' height='17' border='0' title='Marked as advisory ripple'>"
Const enum_imgARD                 = "<img src='images/s_advisory_ripple_dependant.png' width='19' height='17' border='0' title='Dependent marked as advisory ripple'>"
Const enum_imgWarning             = "<img src='images/s_warning.gif' width='19' height='17' border='0' title='Not ready to be built.  Dependent packages, with a patch version, require building'>"
Const enum_imgWReady              = "<img src='images/s_update_warning.gif' width='19' height='17' border='0' title='Ready to build, however at least one dependency has been superseded with a patch version'>"
Const enum_imgBuilding            = "<img src='images/s_gear.gif' width='19' height='17' border='0' title='Work in progress'>"
Const enum_imgNotFound            = "<img src='images/s_not_found.gif' width='19' height='17' border='0' title='Not found'>"
Const enum_imgIgnoring            = "<img src='images/s_ignoring.gif' width='15' height='15' border='0' title='Latest version is ignored'>"
Const enum_imgPatchIgnoring       = "<img src='images/s_patch_ignoring.gif' width='19' height='17' border='0' title='Latest version is included in a patch'>"
Const enum_imgPatchAvailable      = "<img src='images/s_patch_available.gif' width='19' height='17' border='0' title='New patch is required'>"
Const enum_imgPatch               = "<img src='images/i_patch.gif' width='18' height='23' border='0' align='absmiddle' hspace='5' title='This is a patch'>"
Const enum_imgPatchObsolete       = "<img src='images/i_patch_obsolete.gif' width='18' height='23' border='0' align='absmiddle' hspace='5' title='Patch is obsolete'>"
Const enum_imgUser                = "<img src='images/i_user.gif' width='10' height='13' hspace='2' border='0' align='absmiddle' title='User'>"
Const enum_imgUserLg              = "<img src='images/i_user.gif' hspace='3' border='0' align='absmiddle' title='User'>"
Const enum_imgGreenPin            = "<img src='images/i_green_pin.gif' width='19' height='17' border='0' title='Pegged to prevent it being ripple built'>"
Const enum_imgPending             = "<img src='icons/i_pending.gif' width='11' height='17' border='0' title='Package Pending Build Approval'>"
Const enum_imgApproved            = "<img src='icons/i_approved.gif' width='11' height='17' border='0' title='Package Build Approved'>"
Const enum_imgReleasedLocked      = "<img src='images/i_locked.gif' width='13' height='15' border='0' title='Released and locked'>"
Const enum_imgReleasedUnlocked    = "<img src='images/i_unlocked.gif' width='16' height='15' border='0' title='Released and unlocked'>"
Const enum_imgNotInArchive        = "<img src='images/s_package_not_present.gif' width='16' height='15' border='0' title='Not found in archive'>"
Const enum_imgNotInRelease        = "<img src='images/s_not_inrelease.gif' width='16' height='15' border='0' title='This Version is not a member of this Release'>"
Const enum_imgSdkImport           = "<img src='images/i_sdkpkg.png' width='15' height='15' border='0' title='This version imported via an SDK'>"
Const enum_imgSdkDep              = "<img src='images/i_sdkdep.png' width='15' height='15' border='0' title='Not Found. Is a dependency only of the SDK and not required to be in this release.'>"
Const enum_imgUnBuildable         = "<img src='icons/s_unbuildable.png' width='15' height='15' border='0' title='This package is unbuildable.'>"
Const enum_imgRippleStop          = "<img src='images/RippleStop.gif' width='16' height='16' border='0' title='Package is waiting for user to release the ripple stop'>"
Const enum_imgRippleGo            = "<img src='images/RippleGo.gif' width='16' height='16' border='0' title='Ripple stop released. Package waiting to build.'>"
Const enum_imgClipBoard           = "<img src='images/CopyToClipboard.ico' width='15' height='15' border='0' title='Copy package details to clipboard'>"
Const enum_imgClipBoard10         = "<img src='images/CopyToClipboard.ico' width='10' height='10' border='0' title='Copy names to clipboard'>"
Const enum_imgClipBoard12         = "<img src='images/CopyToClipboard.ico' width='12' height='12' border='0' align='absmiddle' title='Copy names to clipboard'>"
Const enum_imgCompiling           = "<img src='images/compile.gif' width='17' height='17' border='0' title='Actively Building'>"
Const enum_imgScheduled           = "<img src='images/future.png' width='17' height='17' border='0' title='Scheduled to Build'>"
Const enum_imgBuildFail           = "<img src='images/build_failed.png' width='17' height='17' border='0' title='Package excluded from build'>"
Const enum_imgBuildExclude        = "<img src='images/build_excluded.png' width='17' height='17' border='0' title='Package indirectly excluded from build'>"

'------------ Release and Sdk States -----------
Const LIMG_OPEN_MODE = "<img src='images/i_rtag_open_mode.gif' border='0' align='absmiddle' hspace='2' title='Open Mode'>"
Const LIMG_RESTRICTIVE_MODE = "<img src='images/i_rtag_restrictive_mode.gif' border='0' align='absmiddle' hspace='2' title='Restrictive Mode'>"
Const LIMG_CCB_MODE = "<img src='images/i_rtag_ccb_mode.gif' border='0' align='absmiddle' hspace='2' title='CCB Mode'>"
Const LIMG_CLOSED_MODE = "<img src='images/i_rtag_closed_mode.gif' border='0' align='absmiddle' hspace='2' title='Closed Mode'>"
Const LIMG_CLOSED_MODE_WARN = "<img src='images/i_rtag_closed_mode_warn.gif' border='0' align='absmiddle' hspace='2'>"
Const LIMG_PRESERVE_MODE = "<img src='images/i_rtag_preserve_mode.gif' border='0' align='absmiddle' hspace='2' title='Preserved Mode'>"
Const LIMG_ARCHIVE_MODE = "<img src='images/i_rtag_archive_mode.gif' border='0' align='absmiddle' hspace='2' title='Archived'>"

'-- ICONS SMALL ------------------------------
Const enum_SMALL_imgOK           = "<img src='images/si_ok.gif' width='17' height='16' border='0' align='absmiddle' vspace='1' hspace='2'>"
Const enum_SMALL_imgCritical     = "<img src='images/si_critical.gif' width='17' height='16' border='0' align='absmiddle' vspace='1' hspace='2'>"
Const enum_SMALL_imgCReady       = "<img src='images/si_update_critical.gif' width='17' height='16' border='0' align='absmiddle' vspace='1' hspace='2'>"
Const enum_SMALL_imgWarning      = "<img src='images/si_warning.gif' width='17' height='16' border='0' align='absmiddle' vspace='1' hspace='2'>"
Const enum_SMALL_imgWReady       = "<img src='images/si_update_warning.gif' width='17' height='16' border='0' align='absmiddle' vspace='1' hspace='2'>"
Const enum_SMALL_imgBuilding     = "<img src='images/si_gear.gif' width='17' height='16' border='0' align='absmiddle' vspace='1' hspace='2'>"
Const enum_SMALL_imgNotFound     = "<img src='images/si_not_found.gif' width='17' height='16' border='0' align='absmiddle' vspace='1' hspace='2'>"

'-- ICONS MISC ------------------------------
Const enum_IMG_Critical           = "<img src='images/i_critical.gif' width='33' height='33' border='0' align='absmiddle' vspace='1' hspace='2'>"
Const imgPkgLocked                = "<img src='images/i_locked.gif' width='7' height='10' hspace='4' align='absmiddle'>"
Const imgPkgLockSpacer            = "<img src='images/spacer.gif' width='7' height='10' hspace='4' align='absmiddle'>"

Const LIMG_NDEL                   = "<img src='icons/i_remove.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
Const LIMG_NDEL_DISABLED          = "<img src='icons/i_remove_dis.gif' width='16' height='16' hspace='2' border='0' align='absmiddle' class='lessOpacity'>"
Const LIMG_USER                   = "<img src='images/i_user.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
Const LIMG_USER_DISABLED          = "<img src='images/i_user_disabled.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
Const LIMG_EDIT                   = "<img src='icons/i_edit.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
Const LIMG_EDIT_DISABLED          = "<img src='icons/i_edit.gif' width='16' height='16' hspace='2' border='0' align='absmiddle' class='lessOpacity'>"



'-- VERSION CONTROL CONSTANTS ------------------------------
Const enum_VCS_UNCONTROLLED_TAG  = "UC"
Const enum_VCS_CLEARCASE_TAG     = "CC"
Const enum_VCS_SUBVERSION_TAG    = "SVN"
Const enum_VCS_CVS_TAG           = "CVS"
Const enum_VCS_GIT_TAG           = "GIT"

'-- OP CODES for DAEMON INSTRUCTIONS, both in terms of strings and integers -------------------------------------------
'
'-- When adding to these, always update daemon_instructions.asp accordingly.
'-- Sometimes it might be necessary to update wAddDaemonInstruction.asp as well.

'-- human readable string names
Const OP_CODE_0_STR = "Ripple Build Package"          ' Corresponds to OP_CODE_0_RIPPLE_BUILD_PACKAGE
Const OP_CODE_1_STR = "Test Build Package"            ' Corresponds to OP_CODE_1_TEST_BUILD_PACKAGE
Const OP_CODE_2_STR = "Future Build"                  ' Corresponds to OP_CODE_2_FUTURE_BUILD

'-- equivalent integer values for use in query strings
Const OP_CODE_0_RIPPLE_BUILD_PACKAGE = "0"
Const OP_CODE_1_TEST_BUILD_PACKAGE   = "1"
Const OP_CODE_2_FUTURE_BUILD         = "2"

'-- PACKAGE AREA CONSTANTS ------------------------------
Const enum_PKG_AREA_WIP = 0
Const enum_PKG_AREA_PLANNED = 1
Const enum_PKG_AREA_RELEASED = 2

'-- BUILD DAEMON STATE CONSTANTS ------------------------------
Const enum_DAEMON_ENABLE = NULL
Const enum_DAEMON_PAUSE = 1
Const enum_DAEMON_DISABLE = 2

'-- Windows event logger types --------------------------------
' Used in Raise_Event
Const enumEVENT_SUCCESS = 0
Const enumEVENT_ERROR = 1
Const enumEVENT_WARNING = 2
Const enumEVENT_INFORMATION = 4

%>