Subversion Repositories DevTools

Rev

Rev 5957 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
Option explicit
129 ghuddy 4
Response.Expires = 0   ' always load the page, dont store
119 ghuddy 5
%>
6
<%
7
'==================================================================================
129 ghuddy 8
'            Modify   Product   State(Pending   For   Integration, Test, Deployment)
119 ghuddy 9
'==================================================================================
10
%>
11
<!--#include file="common/conf.asp"-->
12
<!--#include file="common/globals.asp"-->
13
<!--#include file="common/formating.asp"-->
14
<!--#include file="common/qstr.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/common_dbedit.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_login.asp"-->
21
<!--#include file="_access_control_general.asp"-->
22
<!--#include file="_access_control_project.asp"-->
23
<%
24
'------------ Variable Definition -------------
25
Dim parPv_id
26
Dim parRfile
27
Dim rsPkgInfo
28
Dim retERRmsg
29
Dim retALRTmsg
30
Dim retParameters
129 ghuddy 31
Dim parSReq      ' Skip requirements test
119 ghuddy 32
Dim pkgType
129 ghuddy 33
Dim   prodState
119 ghuddy 34
'------------ Constants Declaration -----------
35
'------------ Variable Init -------------------
36
parPv_id = QStrPar("pv_id")
37
parRfile = QStrPar("rfile")
38
parSReq = QStrPar("sreq")
129 ghuddy 39
prodState   =   Request("state_id")
119 ghuddy 40
'----------------------------------------------
41
%>
42
<%
43
Sub ModifyProductState ( NNpv_id, NNrtag_id, NNstate_id )
129 ghuddy 44
   On Error Resume Next
45
   'objEH.ErrorRedirect = TRUE
46
 
47
   OraDatabase.Parameters.Add "PV_ID",          NNpv_id,    ORAPARM_INPUT, ORATYPE_NUMBER
48
   OraDatabase.Parameters.Add "RTAG_ID",          NNrtag_id,    ORAPARM_INPUT, ORATYPE_NUMBER
49
   OraDatabase.Parameters.Add "STATE_ID",          NNstate_id,    ORAPARM_INPUT, ORATYPE_NUMBER
50
   OraDatabase.Parameters.Add "USER_ID",          objAccessControl.UserId,    ORAPARM_INPUT, ORATYPE_NUMBER
51
 
52
   objEH.TryORA ( OraSession )
53
 
54
   OraDatabase.ExecuteSQL _
55
     "BEGIN "&_
56
   " PK_PACKAGE.MODIFY_PRODUCT_STATE ( :PV_ID, :RTAG_ID, :STATE_ID, :USER_ID );"&_
57
   "END; "
58
 
59
   objEH.CatchORA ( OraSession )
60
 
61
   OraDatabase.Parameters.Remove "PV_ID"
62
   OraDatabase.Parameters.Remove "RTAG_ID"
63
   OraDatabase.Parameters.Remove "STATE_ID"
64
   OraDatabase.Parameters.Remove "USER_ID"
65
 
66
   '/* Log Action */
67
   'Call Log_Action ( NNpv_id, "makeofficial", NULL )
68
 
119 ghuddy 69
End Sub
70
'------------------------------------------------------------------------------------
71
Sub NotifySBOMManagement ( parPv_id, parRtag_id, prodState )
72
 
129 ghuddy 73
   On Error Resume Next
3959 dpurdie 74
   Dim Query_String, rsQry, rsTemp, emailRecipients, stateComments
119 ghuddy 75
 
5975 dpurdie 76
   emailRecipients = ServiceConfig("SBOM MANAGEMENT")
119 ghuddy 77
 
129 ghuddy 78
   Set rsTemp = OraDatabase.DbCreateDynaset( "select * from product_states where state_id="&prodState , cint(0) )
79
   stateComments = rsTemp("state")
80
   rsTemp.Close()
81
   Set rsTemp = Nothing
119 ghuddy 82
 
83
 
129 ghuddy 84
   Query_String = _
85
   "   SELECT * FROM PACKAGES PKG, PACKAGE_VERSIONS PV,"&_
86
   "   RELEASE_TAGS RT, PROJECTS PRJ WHERE RT.RTAG_ID = "& parRtag_id &""&_
87
   "   AND PV.PV_ID = "& parPv_id &" AND PV.PKG_ID = PKG.PKG_ID AND "&_
88
   "   PRJ.PROJ_ID = RT.PROJ_ID"
119 ghuddy 89
 
129 ghuddy 90
   Set rsQry = OraDatabase.DbCreateDynaset( Query_String , cint(0) )
91
 
92
   If rsQry.RecordCount <> "" Then
93
      While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
3959 dpurdie 94
         Send_Email "Release Manager Notification",_
5357 dpurdie 95
                    ADMIN_EMAIL, _
3959 dpurdie 96
                    emailRecipients,_
97
                    "Version "& rsQry("pkg_version") &" of Product "& rsQry("pkg_name") &" in Project " & rsQry("proj_name") &" on Release Branch " & rsQry("rtag_name") &" has been "& stateComments &".",_
98
                    "You have received this email as a result of being part of the SBOM Management.",_
99
                    NULL
129 ghuddy 100
         rsQry.MoveNext
101
      Wend
102
 
103
   End If
104
 
105
   rsQry.Close()
106
   set rsQry = nothing
107
 
108
 
119 ghuddy 109
End Sub
110
'-------------------------------------------------------------------------------------
111
%>
112
<%
113
'---------------------------------- MAIN LINE ----------------------------------------
114
 
115
' REQUREMENTS CHECK for ALL
116
Call CheckRequirementsForMakeDeployable ( parPv_id, parRtag_id, pkgType, retERRmsg, retALRTmsg, retParameters )
117
 
118
If IsNull(retERRmsg) Then
129 ghuddy 119
   Call ModifyProductState ( parPv_id, parRtag_id, prodState )
119 ghuddy 120
 
129 ghuddy 121
   Call NotifySBOMManagement ( parPv_id, parRtag_id, prodState )
119 ghuddy 122
 
129 ghuddy 123
   If objEH.Finally Then
5957 dpurdie 124
      Call Destroy_All_Objects
129 ghuddy 125
      Response.Redirect ( "fixed_issues.asp?rfile="& parRfile &"&pv_id="& parPv_id &"&rtag_id="& parRtag_id )
126
   End If
127
 
119 ghuddy 128
Else
129
 
129 ghuddy 130
   Call RaiseMsg ( Eval(retERRmsg), parRtag_id &"|"& parPv_id &"|"& retParameters &"|"& "N" )
119 ghuddy 131
 
129 ghuddy 132
End If
119 ghuddy 133
%>
134
<!-- DESTRUCTOR ------->
129 ghuddy 135
<!--#include file="common/destructor.asp"-->