<% '===================================================== ' COMMON DB EDIT '===================================================== %> <% Sub Update_Pkg_Category ( SSrtag_id, SSpv_id, SSbase_view_id ) OraDatabase.Parameters.Add "PV_ID", SSpv_id, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "RTAG_ID", SSrtag_id, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "VIEW_ID", SSbase_view_id, ORAPARM_INPUT, ORATYPE_NUMBER objEH.TryORA ( OraSession ) On Error Resume Next OraDatabase.ExecuteSQL _ "BEGIN PK_ENVIRONMENT.CHANGE_PACKAGE_VIEW ( :PV_ID, :RTAG_ID, :VIEW_ID ); END;" objEH.CatchORA ( OraSession ) OraDatabase.Parameters.Remove "PV_ID" OraDatabase.Parameters.Remove "RTAG_ID" OraDatabase.Parameters.Remove "VIEW_ID" End Sub '----------------------------------------------------------------------------------------------------------------------------- Sub Seed_Package_Names_Versions ( ARRdep, NNretPV_ID ) Dim i OraDatabase.Parameters.Add "retPV_ID", 0, ORAPARM_OUTPUT, ORATYPE_NUMBER objEH.TryORA ( OraSession ) On Error Resume Next For i = 0 To UBound( ARRdep, 2 ) OraDatabase.ExecuteSQL "BEGIN Seed_Package_Names_Versions ('"& ARRdep(0,i) &"','"& ARRdep(1,i) &"', "& objAccessControl.UserId &", :retPV_ID); END;" Next objEH.CatchORA ( OraSession ) OraDatabase.Parameters.Remove "retPV_ID" End Sub '----------------------------------------------------------------------------------------------------------------------------- Function IsExtention ( SSstr ) Dim objRegEx, Match, Matches, StrReturnStr Set objRegEx = New RegExp objRegEx.IgnoreCase = True objRegEx.Pattern = "[A-Za-z]+" Set Matches = objRegEx.Execute( SSstr ) For Each Match in Matches IsExtention = true Next End Function '----------------------------------------------------------------------------------------------------------------------------- Function Get_Pkg_Base_View_ID ( NNpv_id, NNrtag_id ) Dim rsTemp, Query_String If Request("rtag_id") = "" Then Get_Pkg_Base_View_ID = -1 Exit Function End If Query_String = _ " SELECT rc.base_view_id"&_ " FROM release_content rc"&_ " WHERE rc.rtag_id = "& NNrtag_id &_ " AND rc.pv_id = "& NNpv_id Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0)) If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then Get_Pkg_Base_View_ID = CInt( rsTemp("base_view_id") ) Else Get_Pkg_Base_View_ID = NULL End If rsTemp.Close Set rsTemp = nothing End Function '----------------------------------------------------------------------------------------------------------------------------- Function Get_V_EXT ( SSversion ) Dim v_ext v_ext = Right(SSversion, Len(SSversion) - InStrRev( SSversion, "." )) If IsExtention ( v_ext ) Then Get_V_EXT = v_ext Else Get_V_EXT = NULL End If End Function '----------------------------------------------------------------------------------------------------------------------------- Sub Touch_Package ( NNpv_id ) If NNpv_id = "" Then Exit Sub objEH.TryORA ( OraSession ) On Error Resume Next OraDatabase.ExecuteSQL " UPDATE package_versions "&_ " SET modified_stamp = "& ORA_SYSDATETIME &", modifier_id = "& objAccessControl.UserId &_ " WHERE pv_id = "& NNpv_id objEH.CatchORA ( OraSession ) End Sub '----------------------------------------------------------------------------------------------------------------------------- Function Rebuild_Environment_Necessary(NNrtag_id) Dim Query_String, rsTemp Rebuild_Environment_Necessary = FALSE If IsNull(NNrtag_id) OR NNrtag_id = "" Then Exit Function ' Exit if rtag_id is not supplied ' Find if rebuild is required Query_String = "SELECT rebuild_env FROM release_tags WHERE rtag_id = "& NNrtag_id Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0)) If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then If rsTemp("rebuild_env") = "Y" Then Rebuild_Environment_Necessary = TRUE End If End If rsTemp.Close Set rsTemp = nothing End Function '----------------------------------------------------------------------------------------------------------------------------- Sub Rebuild_Environment ( NNrtag_id ) If Rebuild_Environment_Necessary(NNrtag_id) Then Call Rebuild_Environment_Body(NNrtag_id, FALSE) End If End Sub '----------------------------------------------------------------------------------------------------------------------------- Sub Rebuild_Environment_Body ( NNrtag_id , BallStates) On Error Resume Next ' It is important to set the flag rebuild_env = 'N' first, ' to stop multiple processes doing the same thing objEH.TryORA ( OraSession ) OraDatabase.ExecuteSQL " UPDATE release_tags "&_ " SET rebuild_env = 'N'"&_ " WHERE rtag_id = "& NNrtag_id objEH.CatchORA ( OraSession ) ' Only proceed if the last update succeeded If objEH.LastOraFailed = FALSE Then ' Now rebuild environment objEH.TryORA ( OraSession ) OraDatabase.ExecuteSQL " BEGIN Rebuild_Environment( "& NNrtag_id &" ); END;" objEH.CatchORA ( OraSession ) End If If BallStates Then objEH.TryORA ( OraSession ) OraDatabase.ExecuteSQL " BEGIN REBUILD_DEPRECATE_STATE( "& NNrtag_id &" ); END;" objEH.CatchORA ( OraSession ) End If End Sub '----------------------------------------------------------------------------------------------------------------------------- Sub Rebuild_Release_Metrics ( NNrtag_id ) On Error Resume Next objEH.TryORA ( OraSession ) OraDatabase.ExecuteSQL "BEGIN PK_RMAPI.UPDATE_RELEASE_METRICS( "& NNrtag_id &" ); END;" objEH.CatchORA ( OraSession ) End Sub '----------------------------------------------------------------------------------------------------------------------------- Sub CheckRequirements ( nPv_id, nRtag_id, nPkgType, returnERRmsg, returnALRTmsg, returnParameters, sQuery ) Dim rsErr, Query_String Query_String = sQuery ' --------- SQL PARAMETERS ------------ OraDatabase.Parameters.Add "RTAG_ID", nRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "PV_ID", nPv_id, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "enumPKG_STATE_OK", enumPKG_STATE_OK, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "enumISSUES_STATE_FIXED", enumISSUES_STATE_FIXED, ORAPARM_INPUT, ORATYPE_NUMBER ' ------------------------------------- Set rsErr = OraDatabase.DbCreateDynaset( Query_String, cint(0)) returnERRmsg = NULL returnALRTmsg = NULL If ( nPkgType = enumBASE_VIEW_PRODUCTS ) Then ' Check Requirement for products Do While ((NOT rsErr.BOF) AND (NOT rsErr.EOF)) If Not IsNull(rsErr("err_message")) Then returnERRmsg = rsErr("err_message") returnALRTmsg = rsErr("products_msg") returnParameters = "_make_released.asp" &"|" If returnALRTmsg = "ERROR" Then returnParameters = rsErr("rfile") &"|"& rsErr("anchor") Exit Do End If End If rsErr.MoveNext Loop Else ' Check Requirements for other packages Do While ((NOT rsErr.BOF) AND (NOT rsErr.EOF)) If Not IsNull(rsErr("err_message")) Then returnERRmsg = rsErr("err_message") returnParameters = rsErr("rfile") &"|"& rsErr("anchor") Exit Do End If rsErr.MoveNext Loop End If rsErr.Close Set rsErr = nothing OraDatabase.Parameters.Remove "RTAG_ID" OraDatabase.Parameters.Remove "PV_ID" OraDatabase.Parameters.Remove "enumPKG_STATE_OK" OraDatabase.Parameters.Remove "enumISSUES_STATE_FIXED" End Sub '----------------------------------------------------------------------------------------------------------------------------- Sub CheckRequirementsForMakeRelease ( nPv_id, nRtag_id, nPkgType, returnERRmsg, returnALRTmsg, returnParameters ) Dim QueryString, rsQry QueryString = "SELECT pv.IS_PATCH FROM PACKAGE_VERSIONS pv WHERE pv.PV_ID = "& nPv_id Set rsQry = OraDatabase.DbCreateDynaset( QueryString, cint(0)) If IsNull(rsQry("is_patch")) Then ' For Package Call CheckRequirements ( nPv_id, nRtag_id, nPkgType, returnERRmsg, returnALRTmsg, returnParameters, ReadFile( rootPath & "queries\req_make_official.sql" ) ) Else ' For Patch Call CheckRequirements ( nPv_id, nRtag_id, nPkgType, returnERRmsg, returnALRTmsg, returnParameters, ReadFile( rootPath & "queries\req_make_official_patch.sql" ) ) End If rsQry.Close() Set rsQry = nothing End Sub '----------------------------------------------------------------------------------------------------------------------------- Sub CheckRequirementsForMakePending ( nPv_id, nRtag_id, nPkgType, returnERRmsg, returnALRTmsg, returnParameters ) Call CheckRequirements ( nPv_id, nRtag_id, nPkgType, returnERRmsg, returnALRTmsg, returnParameters, ReadFile( rootPath & "queries\req_make_pending.sql" ) ) End Sub '----------------------------------------------------------------------------------------------------------------------------- Sub CheckRequirementsForMakeApproved ( nPv_id, nRtag_id, nPkgType, returnERRmsg, returnALRTmsg, returnParameters ) Call CheckRequirements ( nPv_id, nRtag_id, nPkgType, returnERRmsg, returnALRTmsg, returnParameters, ReadFile( rootPath & "queries\req_make_approved.sql" ) ) End Sub '----------------------------------------------------------------------------------------------------------------------------- Sub CheckRequirementsForMakeDeployable ( nPv_id, nRtag_id, nPkgType, returnERRmsg, returnALRTmsg, returnParameters ) Call CheckRequirements ( nPv_id, nRtag_id, nPkgType, returnERRmsg, returnALRTmsg, returnParameters, ReadFile( rootPath & "queries\req_make_deployable.sql" ) ) End Sub '----------------------------------------------------------------------------------------------------------------------------- Sub Notify ( NNrtag_id ) Dim Query_String, Location_SQL, rsNotify, emailBody, readyPv_id_list, SentTODict, releaseSTR Dim httpRef, URL_root, headerSTR, footerSTR, oAttachmentsDict Set SentTODict = CreateObject("Scripting.Dictionary") Set oAttachmentsDict = CreateObject("Scripting.Dictionary") On Error Resume Next objEH.TryORA ( OraSession ) Query_String = ReadFile( rootPath & "queries\to_notify.sql" ) Query_String = Replace( Query_String, "/*PKG_STATE_MAJOR_READY*/", enumPKG_STATE_MAJOR_READY) Query_String = Replace( Query_String, "/*PKG_STATE_MINOR_READY*/", enumPKG_STATE_MINOR_READY) Query_String = Replace( Query_String, "/*PKG_STATE_OK*/", enumPKG_STATE_OK) Query_String = Replace( Query_String, "/*ORA_SYSDATETIME*/", ORA_SYSDATETIME) ' --------- SQL PARAMETERS ------------ OraDatabase.Parameters.Add "RTAG_ID", NNrtag_id, ORAPARM_INPUT OraDatabase.Parameters("RTAG_ID").ServerType = ORATYPE_NUMBER OraDatabase.Parameters.Add "CURRENT_USER", objAccessControl.UserId, ORAPARM_INPUT OraDatabase.Parameters("CURRENT_USER").ServerType = ORATYPE_NUMBER ' ------------------------------------- 'Response.write Query_String Set rsNotify = OraDatabase.DbCreateDynaset( Query_String, cint(0)) readyPv_id_list = "-1" emailBody = "" '---- Get notification list ---- If ((NOT rsNotify.BOF) AND (NOT rsNotify.EOF)) Then httpRef = Request.ServerVariables("HTTP_REFERER") URL_root = Left( httpRef, InStrRev(httpRef, "/") ) emailBody = emailBody & "" emailBody = emailBody & "Owner" emailBody = emailBody & "Package Name" emailBody = emailBody & "Version" emailBody = emailBody & "" While ((NOT rsNotify.BOF) AND (NOT rsNotify.EOF)) emailBody = emailBody & "" emailBody = emailBody & ""& rsNotify("full_name") &"" emailBody = emailBody & ""& rsNotify("pkg_name") &"" emailBody = emailBody & ""& rsNotify("pkg_version") &"" emailBody = emailBody & "" readyPv_id_list = readyPv_id_list &","& rsNotify("pv_id") If NOT SentTODict.Exists (Cstr(rsNotify("user_email"))) Then SentTODict.Add Cstr(rsNotify("user_email")), Cstr(rsNotify("full_name")) rsNotify.MoveNext WEnd emailBody = "" & emailBody & "
" End If rsNotify.Close Set rsNotify = nothing If readyPv_id_list <> "-1" Then '---- Header ---- headerSTR = _ ""&_ " "&_ " "&_ " "&_ " "&_ " "&_ " "&_ " "&_ " "&_ "
releasemanager Notifications


" '---- Footer ---- footerSTR = _ "

"&_ ""&_ " "&_ " "&_ " "&_ " "&_ " "&_ " "&_ " "&_ "

 massERG Confidential © ERG
" '---- Get Release loction ---- Location_SQL = _ " SELECT proj.proj_name, rt.rtag_name"&_ " FROM release_tags rt,"&_ " projects proj"&_ " WHERE rt.proj_id = proj.proj_id"&_ " AND rt.rtag_id = :RTAG_ID" Set rsNotify = OraDatabase.DbCreateDynaset( Location_SQL, cint(0)) If ((NOT rsNotify.BOF) AND (NOT rsNotify.EOF)) Then releaseSTR = rsNotify("proj_name") &" > "& rsNotify("rtag_name") emailBody = ""&_ "Following packages are ready to build.

"&_ rsNotify("proj_name") &" > "& rsNotify("rtag_name") &"
"&_ ""& URL_root &"dependencies.asp?rtag_id="& NNrtag_id &""&_ "
"&_ emailBody End If rsNotify.Close Set rsNotify = nothing emailBody = headerSTR & emailBody & footerSTR '---- Remove pkg from notification history ---- OraDatabase.ExecuteSQL " DELETE FROM notification_history WHERE rtag_id = :RTAG_ID AND pv_id IN ( "& readyPv_id_list &" )" '---- Insert into notification history ---- OraDatabase.ExecuteSQL "INSERT INTO notification_history (rtag_id, pv_id, user_id, date_time_stamp) "&_ " SELECT ins.rtag_id, ins.pv_id, ins.user_id, ins.date_time_stamp"&_ " FROM ("&_ Query_String &_ " ) ins" End If objEH.CatchORA ( OraSession ) '================= Send Email ========================== 'Call Send_Email ( "Release Manager Notifications", ADMIN_EMAIL, ADMIN_EMAIL, "Your package is ready to build at "& releaseSTR, emailBody, oAttachmentsDict ) ' ---------- Attachments ------------- oAttachmentsDict.Add "images\i_mail.gif", "RM-Envelop" oAttachmentsDict.Add "images\s_masslogo_w.gif", "RM-MASSlogo" Call Send_Email ( "Release Manager Notifications", ADMIN_EMAIL, SentTODict, "Your package is ready to build at "& releaseSTR, emailBody, oAttachmentsDict ) OraDatabase.Parameters.Remove "RTAG_ID" OraDatabase.Parameters.Remove "CURRENT_USER" End Sub '----------------------------------------------------------------------------------------------------------------------------- Function NeedSync ( nPv_id, nRtag_id ) Dim rsTemp, Query_String Query_String = ReadFile( rootPath & "queries\sync_check.sql" ) ' --------- SQL PARAMETERS ------------ OraDatabase.Parameters.Add "RTAG_ID", nRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "PV_ID", nPv_id, ORAPARM_INPUT, ORATYPE_NUMBER ' ------------------------------------- Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0)) If rsTemp.RecordCount > 0 Then NeedSync = TRUE Else NeedSync = FALSE End If rsTemp.Close Set rsTemp = nothing OraDatabase.Parameters.Remove "RTAG_ID" OraDatabase.Parameters.Remove "PV_ID" End Function '----------------------------------------------------------------------------------------------------------------------------- Function Lookup_Document ( sDocNum, outDocTitle, outDoc_id, outDoc_version, outDoc_created ) Dim rsDocReg outDocTitle = NULL outDoc_id = NULL outDoc_version = NULL outDoc_created = NULL Set rsDocReg = Server.CreateObject("ADODB.Recordset") rsDocReg.ActiveConnection = DOCREP_conn rsDocReg.Source = "EXEC docregister.dbo.sp_RM_getDocumentFiles '"& sDocNum &"';" rsDocReg.CursorType = 0 rsDocReg.CursorLocation = 2 rsDocReg.LockType = 3 On Error Resume Next rsDocReg.Open() If (NOT rsDocReg.BOF) AND (NOT rsDocReg.EOF) Then outDocTitle = rsDocReg("title") outDoc_id = rsDocReg("id") outDoc_version = rsDocReg("version") outDoc_created = rsDocReg("created") End If rsDocReg.Close Lookup_Document = Err.Number ' Return Error number Set rsDocReg = nothing End Function '----------------------------------------------------------------------------------------------------------------------------- Function Short_Document_Details ( nDocId, outDocTitle, outDoc_version, outDoc_created ) Dim rsDocReg outDocTitle = NULL outDoc_version = NULL outDoc_created = NULL Set rsDocReg = Server.CreateObject("ADODB.Recordset") rsDocReg.ActiveConnection = DOCREP_conn rsDocReg.Source = "EXEC docregister.dbo.sp_RM_getFileDetails "& nDocId &";" rsDocReg.CursorType = 0 rsDocReg.CursorLocation = 2 rsDocReg.LockType = 3 On Error Resume Next rsDocReg.Open() If (NOT rsDocReg.BOF) AND (NOT rsDocReg.EOF) Then outDocTitle = rsDocReg("title") outDoc_version = rsDocReg("version") outDoc_created = rsDocReg("created") End If rsDocReg.Close Short_Document_Details = Err.Number ' Return Error number Set rsDocReg = nothing End Function '----------------------------------------------------------------------------------------------------------------------------- ' ClearQuest Interface ' Convert is CQ Issue number into a DEVI Number ' Function GetIssueNumber ( nIssDB, nIssId ) Dim rsQry, rsSQL GetIssueNumber = "" If CInt(nIssDB) = enumCLEARQUEST_DEVI_ID Then rsSQL = "SELECT dbid AS iss_id, new_num AS iss_num " &_ " FROM release_manager.cq_software_issue si" &_ " WHERE si.dbid = " & nIssId On Error Resume Next Set rsQry = OraDatabase.DbCreateDynaset( rsSQL, cint(0)) If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then GetIssueNumber = rsQry("iss_num") End If rsQry.Close Set rsQry = nothing End If End Function '----------------------------------------------------------------------------------------------------------------------------- ' Note: Some OraDatabase.Parameters may be in use when this function is called ' Attempt to use unqiue names to avaid issues ' Sub Log_Action ( nPvId, sActionTypeName, sComments ) OraDatabase.Parameters.Add "LA_PV_ID", nPvId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "LA_USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "LA_ACTION_TYPE_NAME", sActionTypeName, ORAPARM_INPUT, ORATYPE_VARCHAR2 OraDatabase.Parameters.Add "LA_COMMENTS", sComments, ORAPARM_INPUT, ORATYPE_VARCHAR2 objEH.TryORA ( OraSession ) On Error Resume Next OraDatabase.ExecuteSQL _ "BEGIN Log_Action ( :LA_PV_ID, :LA_ACTION_TYPE_NAME, :LA_USER_ID, :LA_COMMENTS ); END;" objEH.CatchORA ( OraSession ) OraDatabase.Parameters.Remove "LA_PV_ID" OraDatabase.Parameters.Remove "LA_USER_ID" OraDatabase.Parameters.Remove "LA_ACTION_TYPE_NAME" OraDatabase.Parameters.Remove "LA_COMMENTS" End Sub '----------------------------------------------------------------------------------------------------------------------------- Function GetUsername ( nUser_id ) Dim rsQry, sQuery OraDatabase.Parameters.Add "USER_ID", nUser_id, ORAPARM_INPUT, ORATYPE_VARCHAR2 sQuery = "SELECT full_name FROM users WHERE user_id = :USER_ID" Set rsQry = OraDatabase.DbCreateDynaset( sQuery, cint(0)) If rsQry.RecordCount = 1 Then GetUsername = rsQry.Fields("full_name").Value Else GetUsername = nothing End If OraDatabase.Parameters.remove "USER_ID" rsQry.Close Set rsQry = nothing End Function '----------------------------------------------------------------------------------------------------------------------------- Function GetUserEmail ( nUser_id ) Dim rsQry, sQuery OraDatabase.Parameters.Add "USER_ID", nUser_id, ORAPARM_INPUT, ORATYPE_VARCHAR2 sQuery = "SELECT user_email FROM users WHERE user_id = :USER_ID" Set rsQry = OraDatabase.DbCreateDynaset( sQuery, cint(0)) If rsQry.RecordCount = 1 Then GetUserEmail = rsQry.Fields("user_email").Value Else GetUserEmail = nothing End If OraDatabase.Parameters.remove "USER_ID" rsQry.Close Set rsQry = nothing End Function '--------------------------------------------------------------------------------------------------------------------- Sub SetIgnoreWarnings (dpvId, pvId, rtagId) Dim Query_String, rsTemp OraDatabase.Parameters.Add "RTAG_ID", rtagId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "PV_ID", pvId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "IGNORE_ID_LIST", dpvId, ORAPARM_INPUT, ORATYPE_VARCHAR2 On Error Resume Next objEH.TryORA ( OraSession ) OraDatabase.ExecuteSQL _ "BEGIN "&_ " Ignore_Dependency_Warnings( :RTAG_ID, :PV_ID, :IGNORE_ID_LIST, FALSE, :USER_ID ); "&_ "END; " objEH.CatchORA ( OraSession ) OraDatabase.Parameters.Remove "USER_ID" OraDatabase.Parameters.Remove "IGNORE_ID_LIST" If objEH.LastOraFailed = FALSE Then ' DEVI-051154 has prompted the removal of the code to call touch_release from the ' Ignore_Dependency_Warnings stored procedure, and re-locate it here in the website code, since ' Ignore_Dependency_Warnings is called internally by other SQL code in the database where ' we do not want to touch_release. This is what Ignore_Dependency_Warnings used to do: ' IF PK_ENVIRONMENT.GET_PACKAGE_AREA ( nPvId, nRtagId ) = 2 THEN ' Touch_Release (nRtagId); ' END IF; ' Doing the same in the website code is a bit more verbose, and we shouldn't do it if it ' is not necessary. ' Get the tab in which the package version resides (0=wip, 1=planned, 2=released) OraDatabase.Parameters.Add "ENVTAB", NULL, ORAPARM_OUT, ORATYPE_NUMBER OraDatabase.ExecuteSQL _ "BEGIN "&_ " :ENVTAB = PK_ENVIRONMENT.GET_PACKAGE_AREA ( :PV_ID, :RTAG_ID ); "&_ "END; " ' only need to touch release if it is not already in touched state. The purpose of this is to prevent the ' code inside the body of this "if-statement" from executing during the period of time when the database schema ' has yet to be updated to remove the intenral call to touch_release. Once the database schema is updated, ' the Rebuild_Environment_Necessary call is no longer necessary since it will always return FALSE at this ' point. Leaving the statement in place post the database schema update will do no harm though. If Rebuild_Environment_Necessary(rtagId) = FALSE Then ' If the package version is 'Released' then allow the rebuild of the environment so that the states ' of higher level packages can be re-evaluated If OraDatabase.Parameters("ENVTAB").Value = 2 Then objEH.TryORA ( OraSession ) OraDatabase.ExecuteSQL _ "BEGIN "&_ " Touch_Release ( :RTAG_ID ); "&_ "END; " objEH.CatchORA ( OraSession ) End If End If OraDatabase.Parameters.Remove "ENVTAB" End If OraDatabase.Parameters.Remove "RTAG_ID" OraDatabase.Parameters.Remove "PV_ID" End Sub '------------------------------------------------------------------------------------------------------------------ Sub UpdateChangeType (nPvId, nChangeType) Dim rsTemp, Query_String On Error Resume Next If (NOT IsNull(nChangeType)) AND (nChangeType <> "") AND (NOT IsNull(nPvId)) AND (nPvId <> "") Then OraDatabase.Parameters.Add "PV_ID", nPvId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "CHANGE_TYPE", nChangeType, ORAPARM_INPUT, ORATYPE_CHAR objEH.TryORA ( OraSession ) On Error Resume Next OraDatabase.ExecuteSQL "UPDATE package_versions pv SET pv.change_type = :CHANGE_TYPE WHERE pv.pv_id = :PV_ID" objEH.CatchORA ( OraSession ) OraDatabase.Parameters.Remove "PV_ID" OraDatabase.Parameters.Remove "CHANGE_TYPE" If objEH.LastOraFailed = FALSE Then '/* Log Action */ If nChangeType = "M" Then Call Log_Action ( nPvId, "change_type_update", "Major Change" ) ElseIf nChangeType = "N" Then Call Log_Action ( nPvId, "change_type_update", "Minor Change" ) ElseIf nChangeType = "P" Then Call Log_Action ( nPvId, "change_type_update", "Patch Change" ) End If End If End If End Sub '------------------------------------------------------------------------------------------------------------------ Sub UpdateReasonForVersion (nPvId, nReason) Dim rsTemp, Query_String On Error Resume Next If (NOT IsNull(nReason)) AND (nReason <> "") AND (NOT IsNull(nPvId)) AND (nPvId <> "") Then OraDatabase.Parameters.Add "PV_ID", nPvId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "COMMENTS", nReason, ORAPARM_INPUT, ORATYPE_VARCHAR2 objEH.TryORA ( OraSession ) On Error Resume Next OraDatabase.ExecuteSQL _ "UPDATE package_versions pv SET pv.comments = '"& SQLstring(nReason) &"' WHERE pv.pv_id = "& nPvId objEH.CatchORA ( OraSession ) OraDatabase.Parameters.Remove "PV_ID" OraDatabase.Parameters.Remove "COMMENTS" If objEH.LastOraFailed = FALSE Then '/* Log Action */ Call Log_Action ( nPvId, "reason_for_release", nReason ) End If End If End Sub '------------------------------------------------------------------------------------------------------------------ ' Currently used to specify non-vix licence when creating the first veersion of a new package ' Negative nLicence iis used to indicate that the user selected 100% vix. This is not stored. It is assumed Sub UpdateLicenceInfo (nPvId, nLicence) Dim rsTemp, logMsg On Error Resume Next If (NOT IsNull(nLicence)) AND (nLicence <> "") AND (nLicence > 0) AND (NOT IsNull(nPvId)) AND (nPvId <> "") Then OraDatabase.Parameters.Add "PV_ID", nPvId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "LICENCE", nLicence, ORAPARM_INPUT, ORATYPE_NUMBER objEH.TryORA ( OraSession ) On Error Resume Next OraDatabase.ExecuteSQL "insert into licencing (pv_id,licence ) values (:PV_ID,:LICENCE)" objEH.CatchORA ( OraSession ) OraDatabase.Parameters.Remove "PV_ID" OraDatabase.Parameters.Remove "LICENCE" If objEH.LastOraFailed = FALSE Then OraDatabase.Parameters.Add "LICENCE", nLicence, ORAPARM_INPUT, ORATYPE_NUMBER Set rsTemp = OraDatabase.DbCreateDynaset("select name from licences where licence = :LICENCE", cint(0)) If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then logMsg = "Set to " & rsTemp("name") Else logMsg = "Set to unknown(" & nPvId & ")" End If rsTemp.Close() Set rsTemp = nothing OraDatabase.Parameters.Remove "LICENCE" '/* Log Action */ Call Log_Action ( nPvId, "software_licence", logMsg ) End If End If End Sub '------------------------------------------------------------------------------------------------------------------ %>