Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
129 ghuddy 4
'                  MAKE UNOFFICIAL
119 ghuddy 5
'               --- PROCESS FORM ---
6
'=====================================================
7
%>
8
<%
9
Option explicit
10
' Good idea to set when using redirect
129 ghuddy 11
Response.Expires = 0   ' always load the page, dont store
119 ghuddy 12
%>
13
 
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/common_dbedit.asp"-->
20
<%
21
'------------ ACCESS CONTROL ------------------
22
%>
23
<!--#include file="_access_control_login.asp"-->
24
<!--#include file="_access_control_general.asp"-->
25
<!--#include file="_access_control_project.asp"-->
26
<%
27
'------------ Variable Definition -------------
143 ghuddy 28
Dim isDLocked
119 ghuddy 29
'------------ Constants Declaration -----------
30
'------------ Variable Init -------------------
31
'----------------------------------------------
32
%>
33
<%
34
Sub MakeReject ()
129 ghuddy 35
   Dim objWSH
36
   Set objWSH = Server.CreateObject("WScript.Shell")
37
 
38
   objEH.TryORA ( OraSession )
39
   On Error Resume Next
40
 
143 ghuddy 41
   OraDatabase.Parameters.Add "PV_ID",   Request("pv_id"),        ORAPARM_INPUT, ORATYPE_NUMBER
42
   OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"),      ORAPARM_INPUT, ORATYPE_NUMBER
43
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
129 ghuddy 44
 
45
   OraDatabase.ExecuteSQL _
46
   "BEGIN "&_
47
   " PK_ENVIRONMENT.MAKE_REJECT ( :PV_ID, :RTAG_ID, :USER_ID ); "&_
48
   "END; "
49
 
50
   objEH.CatchORA ( OraSession )
51
 
52
   OraDatabase.Parameters.Remove "PV_ID"
53
   OraDatabase.Parameters.Remove "RTAG_ID"
54
   OraDatabase.Parameters.Remove "USER_ID"
55
 
119 ghuddy 56
End Sub
143 ghuddy 57
 
58
Sub RejectAutobuild()
59
 
60
   OraDatabase.Parameters.Add "PV_ID",            Request("pv_id"),        ORAPARM_INPUT, ORATYPE_NUMBER
61
   OraDatabase.Parameters.Add "RTAG_ID",          Request("rtag_id"),      ORAPARM_INPUT, ORATYPE_NUMBER
62
   OraDatabase.Parameters.Add "USER_ID",          objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
63
   OraDatabase.Parameters.Add "ACTION_TYPE_NAME", "reject_package",        ORAPARM_INPUT, ORATYPE_VARCHAR2
64
   OraDatabase.Parameters.Add "DESCRIPTION",      "Rejected manually following autobuild failure", ORAPARM_INPUT, ORATYPE_VARCHAR2
65
 
66
   On Error Resume Next
67
   objEH.TryORA( OraSession )
68
 
69
   ' Move package back to work-in-progress table (changes dlocked to "R" in doing so)
70
   OraDatabase.ExecuteSQL _
71
   "BEGIN "&_
72
   " PK_ENVIRONMENT.MAKE_REJECT ( :PV_ID, :RTAG_ID, :USER_ID ); "&_
73
   "END; "
74
 
75
   If Err.Number = 0 Then
76
 
77
      ' Remove the entry from the do not ripple table but only if it is a direct exlusion entry caused by some build problem.
78
      ' This way, if user has deliberately excluded the package from the build (root_pv_id is null, root_cause is null
79
      ' and root_file is null) then it will remain exlcuded, as it will if there is some underlying package that has caused
80
      ' the exclusion.
81
      OraDatabase.ExecuteSQL ("DELETE FROM do_not_ripple "&_
82
                              "      WHERE pv_id   = :PV_ID "&_
83
                              "        AND rtag_id = :RTAG_ID "&_
84
                              "        AND root_pv_id IS NULL"&_
85
                              "        AND ((root_cause IS NOT NULL) OR (root_file IS NOT NULL))" )
86
 
87
      If Err.Number = 0 Then
88
 
89
         OraDatabase.ExecuteSQL ("BEGIN Log_Action ( :PV_ID, :ACTION_TYPE_NAME, :USER_ID, :DESCRIPTION ); END;")
90
 
91
      End If
92
 
93
   End If
94
 
95
   objEH.CatchORA( OraSession )
96
 
97
   OraDatabase.Parameters.Remove "PV_ID"
98
   OraDatabase.Parameters.Remove "RTAG_ID"
99
   OraDatabase.Parameters.Remove "USER_ID"
100
   OraDatabase.Parameters.Remove "ACTION_TYPE_NAME"
101
   OraDatabase.Parameters.Remove "DESCRIPTION"
102
 
103
End Sub
104
 
119 ghuddy 105
%>
106
<%
107
'-----------------------  MAIN LINE  ---------------------------
108
 
143 ghuddy 109
'--- Process submit ---
119 ghuddy 110
If (Request("rtag_id") <> "") AND (Request("pv_id") <> "")  Then
129 ghuddy 111
 
112
 
143 ghuddy 113
   Call Get_Pkg_Short_Info( Request("pv_id"), NULL, NULL, NULL, NULL, NULL, isDLocked )
129 ghuddy 114
 
143 ghuddy 115
   If isDLocked = "A" Then
116
      'Do the reject operation - this execution path rejects an Approved package version back to Pending
117
 
118
      'We can only do this operation if the build daemon is not going to be doing anything with the entry in
119
      'the "package versions" table. We can only guarantee this if the Daemon has failed to build the package version
120
      'and placed an entry for it in the "do not ripple" table, so check this.
121
      If isInDoNotRippleTable( Request("rtag_id"), Request("pv_id") ) = TRUE Then
122
         Call RejectAutobuild()
123
      Else
124
         Call RaiseMsg(enum_MSG_ERROR, "Cannot reject unless item is certain not to be examined concurrently by a build daemon during the reject operation. Wait for the build to fail.")
125
      End If
126
   Else
127
      'Do the reject operation - this execution path rejects a Pending package version back to Work In Progress
128
      Call MakeReject()
129
   End If
130
 
131
 
132
 
129 ghuddy 133
   If Request("rfile") <> "" Then
134
      Response.Redirect ( Request("rfile") &"?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") )
135
   Else
136
      Response.Redirect ( "dependencies?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") )
137
   End If
138
 
119 ghuddy 139
Else
129 ghuddy 140
   Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
141
   Response.write QSTR_All
119 ghuddy 142
End If
143
%>
144
 
145
<!-- DESTRUCTOR ------->
129 ghuddy 146
<!--#include file="common/destructor.asp"-->