| 4307 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
Option explicit
|
|
|
4 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
5 |
%>
|
|
|
6 |
<%
|
|
|
7 |
'=====================================================
|
|
|
8 |
' Import Release
|
|
|
9 |
'=====================================================
|
|
|
10 |
%>
|
|
|
11 |
<!--#include file="common/conf.asp"-->
|
|
|
12 |
<!--#include file="common/globals.asp"-->
|
|
|
13 |
<!--#include file="common/qstr.asp"-->
|
|
|
14 |
<!--#include file="common/common_subs.asp"-->
|
|
|
15 |
<!--#include file="common/common_dbedit.asp"-->
|
|
|
16 |
<!--#include file="common/_popup_window_common.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 parFRrtag_id ' Current Release
|
|
|
26 |
Dim parFRproj_id ' Selected Project
|
|
|
27 |
Dim hasDaemons ' Current Release Has daemons configured
|
|
|
28 |
Dim importHasDaemons ' Selected Import has daemons configured
|
|
|
29 |
|
|
|
30 |
'------------ Constants Declaration -----------
|
|
|
31 |
'------------ Variable Init -------------------
|
|
|
32 |
parFRrtag_id = QStrPar("FRrtag_id")
|
|
|
33 |
parFRproj_id = QStrPar("FRproj_id")
|
|
|
34 |
|
|
|
35 |
If parFRproj_id = "" Then parFRproj_id = -1
|
|
|
36 |
'----------------------------------------------
|
|
|
37 |
%>
|
|
|
38 |
<%
|
|
|
39 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
40 |
Sub Get_ProjectList ( nProjId )
|
|
|
41 |
Dim rsQry,tempLINK
|
|
|
42 |
|
|
|
43 |
OraDatabase.Parameters.Add "PROJ_ID", nProjId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
44 |
|
|
|
45 |
Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ProjectsCombo.sql"), ORADYN_DEFAULT )
|
|
|
46 |
|
|
|
47 |
If NOT ((NOT rsQry.BOF) AND (NOT rsQry.EOF) ) Then
|
|
|
48 |
If (nProjId > 0) Then
|
|
|
49 |
Err.Raise 8, "Sub Get_ProjectList", "Empty record set returned. nProjId="& nProjId
|
|
|
50 |
End If
|
|
|
51 |
End If
|
|
|
52 |
|
|
|
53 |
Response.write "<select name='FRproj_id' onChange=""MM_jumpMenu('parent',this,0)"" class='form_item'>"
|
|
|
54 |
Response.write "<option value=''>Select Project</option>"
|
|
|
55 |
While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
|
|
|
56 |
tempLINK = scriptName &"?FRproj_id="& rsQry.Fields("proj_id") & "&"& objPMod.ComposeURL()
|
|
|
57 |
Response.write "<option value='"& tempLINK &"'" &rsQry.Fields("SELECTED") &">"& (rsQry.Fields("proj_name")) &"</option>"
|
|
|
58 |
rsQry.MoveNext
|
|
|
59 |
WEnd
|
|
|
60 |
Response.write "</select>"
|
|
|
61 |
|
|
|
62 |
OraDatabase.Parameters.Remove "PROJ_ID"
|
|
|
63 |
rsQry.Close
|
|
|
64 |
Set rsQry = Nothing
|
|
|
65 |
|
|
|
66 |
End Sub
|
|
|
67 |
|
|
|
68 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
69 |
Sub Get_ReleaseList ( nProjId, nRtagId )
|
|
|
70 |
Dim rsQry,tempLINK
|
|
|
71 |
|
|
|
72 |
OraDatabase.Parameters.Add "PROJ_ID", nProjId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
73 |
OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
74 |
|
|
|
75 |
Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleasesCombo.sql"), ORADYN_DEFAULT )
|
|
|
76 |
|
|
|
77 |
If NOT ((NOT rsQry.BOF) AND (NOT rsQry.EOF) ) Then
|
|
|
78 |
If (nProjId > 0) Then
|
|
|
79 |
Err.Raise 8, "Sub Get_ReleaseList", "Empty record set returned. nProjId="& nProjId
|
|
|
80 |
End If
|
|
|
81 |
End If
|
|
|
82 |
|
|
|
83 |
Response.write "<select name='FRrtag_id' onChange=""MM_jumpMenu('parent',this,0)"" class='form_item'>"
|
|
|
84 |
Response.write "<option value=''>Select Release</option>"
|
|
|
85 |
While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
|
|
|
86 |
tempLINK = scriptName & "?FRproj_id="& nProjId &"&FRrtag_id="& rsQry.Fields("rtag_id") & "&"& objPMod.ComposeURL()
|
|
|
87 |
Response.write "<option value='"& tempLINK &"'" &rsQry.Fields("SELECTED") &">"& (rsQry.Fields("rtag_name")) &"</option>"
|
|
|
88 |
rsQry.MoveNext
|
|
|
89 |
WEnd
|
|
|
90 |
Response.write "</select>"
|
|
|
91 |
|
|
|
92 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
93 |
OraDatabase.Parameters.Remove "PROJ_ID"
|
|
|
94 |
|
|
|
95 |
rsQry.Close
|
|
|
96 |
Set rsQry = Nothing
|
|
|
97 |
End Sub
|
|
|
98 |
|
|
|
99 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
100 |
Function check_for_daemons(nRtagId, DefVal)
|
|
|
101 |
Dim sqlStr, rsQry
|
|
|
102 |
If nRtagId <> "" Then
|
|
|
103 |
sqlStr = "SELECT RCON_ID from RELEASE_CONFIG rc WHERE rc.rtag_id = :RTAG_ID"
|
|
|
104 |
OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
105 |
|
|
|
106 |
Set rsQry = OraDatabase.DbCreateDynaset( sqlStr, ORADYN_DEFAULT )
|
|
|
107 |
|
|
|
108 |
If rsQry.BOF OR rsQry.EOF Then
|
|
|
109 |
check_for_daemons = False
|
|
|
110 |
Else
|
|
|
111 |
check_for_daemons = True
|
|
|
112 |
End If
|
|
|
113 |
|
|
|
114 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
115 |
|
|
|
116 |
rsQry.Close
|
|
|
117 |
Set rsQry = Nothing
|
|
|
118 |
Else
|
|
|
119 |
check_for_daemons = DefVal
|
|
|
120 |
End If
|
|
|
121 |
|
|
|
122 |
End Function
|
|
|
123 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
124 |
Sub importDaemons( NSrcRtag_id, NDstRtag_id)
|
|
|
125 |
If (NSrcRtag_id <> "") AND (NDstRtag_id <> "") Then
|
|
|
126 |
' All mandatory parameters FOUND
|
|
|
127 |
' COMPLETE THE REQUEST...
|
|
|
128 |
|
|
|
129 |
On Error Resume Next
|
|
|
130 |
objEH.ErrorRedirect = TRUE
|
|
|
131 |
|
|
|
132 |
OraDatabase.Parameters.Add "FROMRTAG_ID", NSrcRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
133 |
OraDatabase.Parameters.Add "TORTAG_ID", NDstRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
134 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
135 |
|
|
|
136 |
|
|
|
137 |
objEH.TryORA ( OraSession )
|
|
|
138 |
|
|
|
139 |
' Remove old Work in Progress Contents
|
|
|
140 |
OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.IMPORT_DAEMONS (:FROMRTAG_ID, :TORTAG_ID, :USER_ID); END;"
|
|
|
141 |
|
|
|
142 |
objEH.CatchORA ( OraSession )
|
|
|
143 |
|
|
|
144 |
OraDatabase.Parameters.Remove "FROMRTAG_ID"
|
|
|
145 |
OraDatabase.Parameters.Remove "TORTAG_ID"
|
|
|
146 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
147 |
|
|
|
148 |
|
|
|
149 |
If objEH.Finally Then
|
|
|
150 |
Response.Redirect("build_status.asp?rtag_id="& NDstRtag_id )
|
|
|
151 |
End If
|
|
|
152 |
|
|
|
153 |
Else
|
|
|
154 |
Response.write "Some mandatory parameters are missing!" & "<br>" 'TODO
|
| 4955 |
dpurdie |
155 |
Response.write QSTR_FullQuery
|
| 4307 |
dpurdie |
156 |
End If
|
|
|
157 |
End Sub
|
|
|
158 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
159 |
%>
|
|
|
160 |
<%
|
|
|
161 |
'Process submition
|
|
|
162 |
If CBool(QStrPar("action")) Then
|
|
|
163 |
Call importDaemons(Request.Form("FromRtag_id"),Request("rtag_id"))
|
|
|
164 |
Call CloseWindow
|
|
|
165 |
Response.Write "Debug. End of Processing"
|
|
|
166 |
Response.End
|
|
|
167 |
End If
|
|
|
168 |
|
|
|
169 |
' Run before render
|
|
|
170 |
hasDaemons = check_for_daemons(Request("rtag_id"), False)
|
|
|
171 |
importHasDaemons = check_for_daemons(parFRrtag_id, True)
|
|
|
172 |
%>
|
|
|
173 |
<html>
|
|
|
174 |
<head>
|
|
|
175 |
<title>Release Manager</title>
|
|
|
176 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
177 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
178 |
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
|
|
|
179 |
<link rel="stylesheet" href="images/navigation.css" type="text/css">
|
|
|
180 |
<script language="JavaScript" src="images/common.js"></script>
|
|
|
181 |
</head>
|
|
|
182 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
|
|
|
183 |
<form name="importrel" method="post" action="<%=scriptName%>">
|
|
|
184 |
<table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
|
|
|
185 |
<tr>
|
|
|
186 |
<td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/i_change_group_off.gif" width="22" height="25" hspace="5"></td>
|
|
|
187 |
<td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">Import Daemon Configuration</td>
|
|
|
188 |
<td background="images/lbox_bg_blue.gif" align="right" width="50%">
|
|
|
189 |
<%If (NOT hasDaemons) AND (importHasDaemons) Then %>
|
|
|
190 |
<input type="submit" name="btn" value="Import" class="form_btn_comp" onClick="MM_validateForm('FRproj_id','Project','R','FRrtag_id','Release','R');return document.MM_returnValue">
|
|
|
191 |
<%End If%>
|
|
|
192 |
<input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
|
|
|
193 |
</td>
|
|
|
194 |
<td background="images/lbox_bg_blue.gif" align="right" width="1%%" nowrap>
|
|
|
195 |
<img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
|
|
|
196 |
</tr>
|
|
|
197 |
<tr>
|
|
|
198 |
<td height="100%" width="1%"> </td>
|
|
|
199 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
|
|
|
200 |
<table width="100%" border="0" cellspacing="1" cellpadding="2">
|
|
|
201 |
<tr>
|
|
|
202 |
<td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
|
|
|
203 |
<td width="1%" nowrap class="form_group" valign="bottom"></td>
|
| 4358 |
dpurdie |
204 |
<td width="100%" class="form_txt">
|
| 4307 |
dpurdie |
205 |
<%If hasDaemons Then %>
|
|
|
206 |
<%=enum_imgWarning%>
|
|
|
207 |
The current release already has build daemons configured. It is not possible to import a daemon
|
|
|
208 |
configuration into this release.
|
|
|
209 |
<%End If%>
|
|
|
210 |
</td>
|
|
|
211 |
</tr>
|
|
|
212 |
<tr>
|
|
|
213 |
<td width="1%"> </td>
|
|
|
214 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Project</td>
|
|
|
215 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
|
|
|
216 |
<%Call Get_ProjectList ( parFRproj_id )%>
|
|
|
217 |
</td>
|
|
|
218 |
</tr>
|
|
|
219 |
<tr>
|
|
|
220 |
<td width="1%"> </td>
|
|
|
221 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Release</td>
|
|
|
222 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
|
|
|
223 |
<%Call Get_ReleaseList ( parFRproj_id, parFRrtag_id )%>
|
|
|
224 |
<%
|
|
|
225 |
If NOT importHasDaemons Then
|
|
|
226 |
Response.Write enum_imgWarning & " No Daemons in this Release to be imported"
|
|
|
227 |
End If
|
|
|
228 |
%>
|
|
|
229 |
|
|
|
230 |
<input type="hidden" name="rtag_id" value="<%=Request("rtag_id")%>">
|
|
|
231 |
<input type="hidden" name="FromRtag_id" value="<%=parFRrtag_id%>">
|
|
|
232 |
<input type="hidden" name="action" value="true">
|
|
|
233 |
</td>
|
|
|
234 |
</tr>
|
|
|
235 |
<tr>
|
|
|
236 |
<td width="1%"> </td>
|
|
|
237 |
<td width="1%" nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
|
|
|
238 |
<td width="100%" class="form_txt">
|
|
|
239 |
<p>Import the build daemon configuration from another release.
|
|
|
240 |
</p>
|
|
|
241 |
</td>
|
|
|
242 |
</tr>
|
|
|
243 |
</table>
|
|
|
244 |
</td>
|
|
|
245 |
</tr>
|
|
|
246 |
<tr>
|
|
|
247 |
<td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
|
|
|
248 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
|
|
|
249 |
</tr>
|
|
|
250 |
</table>
|
|
|
251 |
</form>
|
|
|
252 |
</body>
|
|
|
253 |
</html>
|
|
|
254 |
|
|
|
255 |
|
|
|
256 |
<!-- DESTRUCTOR ------->
|
|
|
257 |
<!--#include file="common/destructor.asp"-->
|