| 119 |
ghuddy |
1 |
<%
|
|
|
2 |
'=====================================================
|
| 129 |
ghuddy |
3 |
' COMMON SUBs Part 1
|
| 119 |
ghuddy |
4 |
'=====================================================
|
|
|
5 |
%>
|
|
|
6 |
<%
|
|
|
7 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
8 |
Sub CloseWindow
|
|
|
9 |
%>
|
|
|
10 |
<SCRIPT language="JavaScript" type="text/javascript">
|
|
|
11 |
<!--
|
|
|
12 |
self.close();
|
|
|
13 |
//-->
|
|
|
14 |
</SCRIPT>
|
|
|
15 |
<%
|
|
|
16 |
End Sub
|
|
|
17 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
18 |
Sub OpenChildWindow ( SStitle, SSurl, SSH, SSW, BBscroll )
|
| 129 |
ghuddy |
19 |
Dim scrlBar
|
|
|
20 |
If BBscroll Then
|
|
|
21 |
scrlBar = "yes"
|
|
|
22 |
Else
|
|
|
23 |
scrlBar = "no"
|
|
|
24 |
End If
|
| 119 |
ghuddy |
25 |
%>
|
| 129 |
ghuddy |
26 |
<script language="JavaScript" type="text/javascript">
|
|
|
27 |
<!--
|
|
|
28 |
window.open('<%=SSurl%>','<%=SStitle%>','scrollbars=<%=scrlBar%>,resizable=yes,width=<%=SSW%>,height=<%=SSH%>')
|
|
|
29 |
//-->
|
|
|
30 |
</script>
|
| 119 |
ghuddy |
31 |
<%
|
|
|
32 |
End Sub
|
|
|
33 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
34 |
Sub OpenInParentWindow ( SSurl )
|
|
|
35 |
%>
|
| 129 |
ghuddy |
36 |
<script language="JavaScript" type="text/javascript">
|
|
|
37 |
<!--
|
|
|
38 |
window.opener.document.location='<%=SSurl%>';
|
|
|
39 |
//-->
|
|
|
40 |
</script>
|
| 119 |
ghuddy |
41 |
<%
|
|
|
42 |
End Sub
|
|
|
43 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
44 |
Sub OpenInWindow ( SSurl )
|
| 129 |
ghuddy |
45 |
Response.Redirect ( SSurl )
|
| 119 |
ghuddy |
46 |
End Sub
|
|
|
47 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
48 |
Function GetQuery ( sQryName )
|
| 129 |
ghuddy |
49 |
GetQuery = ReadFile( QUERIES_PATH &"\"& sQryName )
|
| 119 |
ghuddy |
50 |
End Function
|
|
|
51 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
52 |
Sub RaiseMsg ( SSerrFile, SSerrDesc )
|
| 129 |
ghuddy |
53 |
' Usage: enumERROR, parval1 &"|"& parval2 &"|"& parval3 ...
|
|
|
54 |
Session( enum_RELMGR_ERRDESCRIPTION ) = SSerrDesc
|
|
|
55 |
Response.Redirect ("messages/"& SSerrFile )
|
| 119 |
ghuddy |
56 |
End Sub
|
|
|
57 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
58 |
Sub RaiseMsgInParent ( SSerrFile, SSerrDesc )
|
| 129 |
ghuddy |
59 |
Session( enum_RELMGR_ERRDESCRIPTION ) = SSerrDesc
|
|
|
60 |
Call OpenInParentWindow ("messages/"& SSerrFile )
|
| 119 |
ghuddy |
61 |
End Sub
|
|
|
62 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
63 |
Function ReadFile( SSpath )
|
| 129 |
ghuddy |
64 |
Dim filesys, rfile
|
|
|
65 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
|
|
66 |
Set rfile = filesys.OpenTextFile( SSpath, 1, false)
|
|
|
67 |
ReadFile = rfile.ReadAll
|
|
|
68 |
rfile.close
|
|
|
69 |
Set filesys = nothing
|
| 119 |
ghuddy |
70 |
End Function
|
|
|
71 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
72 |
Function HighlightSubstring ( SSstr, SSsubstr )
|
| 129 |
ghuddy |
73 |
Dim leftSTR, startPos
|
|
|
74 |
startPos = InStr( 1, SSstr, SSsubstr, 1 )
|
| 119 |
ghuddy |
75 |
|
| 129 |
ghuddy |
76 |
If startPos > 0 Then
|
|
|
77 |
leftSTR = Left ( SSstr, startPos - 1 )
|
|
|
78 |
HighlightSubstring = leftSTR &"<SPAN style='background:#ffff99;'>"& Mid( SSstr, startPos, Len(SSsubstr) ) &"</SPAN>"& Right ( SSstr, Len(SSstr) - Len(leftSTR) - Len(SSsubstr) )
|
|
|
79 |
Else
|
|
|
80 |
' Subtring not found
|
|
|
81 |
HighlightSubstring = SSstr
|
|
|
82 |
End If
|
| 119 |
ghuddy |
83 |
|
|
|
84 |
End Function
|
|
|
85 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
86 |
Sub DeleteFile( SSpath )
|
| 129 |
ghuddy |
87 |
Dim filesys
|
|
|
88 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
|
|
89 |
If filesys.FileExists(SSpath) Then
|
|
|
90 |
filesys.DeleteFile SSpath, TRUE
|
|
|
91 |
End If
|
|
|
92 |
Set filesys = nothing
|
| 119 |
ghuddy |
93 |
End Sub
|
|
|
94 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
95 |
Sub DeleteFolder( SSpath )
|
| 129 |
ghuddy |
96 |
Dim filesys
|
|
|
97 |
Set filesys = CreateObject ("Scripting.FileSystemObject")
|
|
|
98 |
If filesys.FolderExists( SSpath ) Then
|
|
|
99 |
'Set oFolder = filesys.GetFolder( SSpath )
|
|
|
100 |
filesys.DeleteFolder SSpath ,TRUE
|
|
|
101 |
End If
|
| 119 |
ghuddy |
102 |
End Sub
|
|
|
103 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
104 |
Sub Create_Folder ( sCreateIn, sFolderName )
|
| 129 |
ghuddy |
105 |
Dim filesys, currfolder, folcoll, subfol
|
|
|
106 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
|
|
107 |
If filesys.FolderExists( sCreateIn ) Then
|
|
|
108 |
Set currfolder = filesys.GetFolder( sCreateIn )
|
|
|
109 |
Set folcoll = currfolder.SubFolders
|
|
|
110 |
If NOT filesys.FolderExists( sCreateIn &"\"& sFolderName ) Then
|
|
|
111 |
folcoll.Add( sFolderName )
|
|
|
112 |
End If
|
|
|
113 |
End If
|
| 119 |
ghuddy |
114 |
End Sub
|
|
|
115 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
116 |
Function Folder_Is_Empty ( sPath )
|
| 129 |
ghuddy |
117 |
Dim filesys, oFolder
|
|
|
118 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
| 119 |
ghuddy |
119 |
|
| 129 |
ghuddy |
120 |
If filesys.FolderExists( sPath ) Then
|
|
|
121 |
Set oFolder = filesys.GetFolder( sPath )
|
|
|
122 |
If ( oFolder.Files.Count + oFolder.SubFolders.Count ) > 0 Then
|
|
|
123 |
Folder_Is_Empty = FALSE
|
|
|
124 |
Else
|
|
|
125 |
Folder_Is_Empty = TRUE
|
|
|
126 |
End If
|
|
|
127 |
Else
|
|
|
128 |
Folder_Is_Empty = TRUE
|
|
|
129 |
End If
|
| 119 |
ghuddy |
130 |
|
|
|
131 |
End Function
|
|
|
132 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
133 |
Sub Destroy_All_Objects
|
| 129 |
ghuddy |
134 |
On Error Resume Next
|
|
|
135 |
set brokenReadyHash = nothing
|
|
|
136 |
set brokenHash = nothing
|
|
|
137 |
set pkgInfoHash = nothing
|
|
|
138 |
set OraDatabase = nothing
|
|
|
139 |
set OraSession = nothing
|
|
|
140 |
set userdetailsHash = nothing
|
| 119 |
ghuddy |
141 |
End Sub
|
|
|
142 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
143 |
Function InStrPipes ( SSstr, SSsubstr )
|
| 129 |
ghuddy |
144 |
If InStr( SSstr, "|"& SSsubstr &"|") > 0 Then
|
|
|
145 |
InStrPipes = true
|
|
|
146 |
Else
|
|
|
147 |
InStrPipes = false
|
|
|
148 |
End If
|
| 119 |
ghuddy |
149 |
End Function
|
|
|
150 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
151 |
Function RemoveFromStrPipes ( SSstr, SSsubstr )
|
| 129 |
ghuddy |
152 |
RemoveFromStrPipes = Replace( SSstr, "|"& SSsubstr &"|", "" )
|
| 119 |
ghuddy |
153 |
End Function
|
|
|
154 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
155 |
Function View_Name_Exists ( SSviewname, NNused_id )
|
| 129 |
ghuddy |
156 |
Dim rsTemp, Query_String
|
|
|
157 |
Query_String = _
|
|
|
158 |
" SELECT view_name"&_
|
|
|
159 |
" FROM views"&_
|
|
|
160 |
" WHERE UPPER(view_name) = UPPER('"& UCase(SSviewname) &"') AND owner_id = "& NNused_id
|
|
|
161 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
162 |
If rsTemp.RecordCount > 0 Then
|
|
|
163 |
View_Name_Exists = TRUE
|
|
|
164 |
Else
|
|
|
165 |
View_Name_Exists = FALSE
|
|
|
166 |
End If
|
|
|
167 |
rsTemp.Close
|
|
|
168 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
169 |
End Function
|
|
|
170 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
171 |
Function User_Name_Exists ( SSusername )
|
| 129 |
ghuddy |
172 |
Dim rsTemp, Query_String
|
|
|
173 |
Query_String = _
|
|
|
174 |
" SELECT user_name"&_
|
|
|
175 |
" FROM users"&_
|
|
|
176 |
" WHERE user_name = '"& SSusername &"'"
|
|
|
177 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
178 |
If rsTemp.RecordCount > 0 Then
|
|
|
179 |
User_Name_Exists = TRUE
|
|
|
180 |
Else
|
|
|
181 |
User_Name_Exists = FALSE
|
|
|
182 |
End If
|
|
|
183 |
rsTemp.Close
|
|
|
184 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
185 |
End Function
|
|
|
186 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
187 |
Function This_View_Owner( NNview_id, NNuser_id )
|
| 129 |
ghuddy |
188 |
Dim rsTemp, Query_String
|
|
|
189 |
Query_String = _
|
|
|
190 |
" SELECT owner_id"&_
|
|
|
191 |
" FROM views"&_
|
|
|
192 |
" WHERE view_id = "& NNview_id
|
|
|
193 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
194 |
If rsTemp.RecordCount > 0 Then
|
|
|
195 |
If CInt(rsTemp.Fields("owner_id")) = CInt(NNuser_id) Then
|
|
|
196 |
This_View_Owner = TRUE
|
|
|
197 |
Else
|
|
|
198 |
This_View_Owner = FALSE
|
|
|
199 |
End If
|
|
|
200 |
Else
|
|
|
201 |
' view not found
|
|
|
202 |
Session("AdditionalParams") = "$ADMINEMAIL$,"& adminEmail
|
|
|
203 |
Response.Redirect("message.asp?msg=400-2")
|
|
|
204 |
End If
|
|
|
205 |
rsTemp.Close
|
|
|
206 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
207 |
End Function
|
|
|
208 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
209 |
Function GetReleaseMode ( NNrtag_id )
|
| 129 |
ghuddy |
210 |
Dim rsTemp, Query_String
|
|
|
211 |
If NNrtag_id = "" Then NNrtag_id = "-1"
|
| 119 |
ghuddy |
212 |
|
| 129 |
ghuddy |
213 |
Query_String = _
|
|
|
214 |
" SELECT official FROM release_tags WHERE rtag_id = "& NNrtag_id
|
| 119 |
ghuddy |
215 |
|
| 129 |
ghuddy |
216 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
217 |
'Response.write "DB"& NNrtag_id
|
|
|
218 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
219 |
GetReleaseMode = rsTemp.Fields("official")
|
| 119 |
ghuddy |
220 |
|
| 129 |
ghuddy |
221 |
End If
|
| 119 |
ghuddy |
222 |
|
| 129 |
ghuddy |
223 |
rsTemp.Close
|
|
|
224 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
225 |
End Function
|
|
|
226 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
227 |
Function Get_Devl_Envorinment
|
| 129 |
ghuddy |
228 |
If Request.Cookies("RELEASEMANAGER_MEMORY")("devl_environment") <> "" Then
|
|
|
229 |
If Request.Cookies("RELEASEMANAGER_MEMORY")("devl_environment") = "clearcase" Then
|
|
|
230 |
Get_Devl_Envorinment = "jats" 'clear case does not have import
|
|
|
231 |
Else
|
|
|
232 |
Get_Devl_Envorinment = Request.Cookies("RELEASEMANAGER_MEMORY")("devl_environment")
|
|
|
233 |
End If
|
|
|
234 |
Else
|
|
|
235 |
Get_Devl_Envorinment = "jats" 'JATS devl environment is set by default
|
|
|
236 |
End If
|
| 119 |
ghuddy |
237 |
End Function
|
|
|
238 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
239 |
Function Get_From_DUAL ( SSclm )
|
| 129 |
ghuddy |
240 |
Dim rsTemp, Query_String, OraSession2, OraDatabase2
|
|
|
241 |
Set OraSession2 = CreateObject("OracleInProcServer.XOraSession")
|
|
|
242 |
Set OraDatabase2 = OraSession2.OpenDatabase( TNS_NAME, DB_AUTHENTICATION, Cint(0))
|
| 119 |
ghuddy |
243 |
|
| 129 |
ghuddy |
244 |
Query_String = _
|
|
|
245 |
" SELECT "& SSclm &" AS result FROM DUAL"
|
|
|
246 |
Set rsTemp = OraDatabase2.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
247 |
|
| 129 |
ghuddy |
248 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
249 |
Get_From_DUAL = (rsTemp.Fields("result"))
|
|
|
250 |
End If
|
| 119 |
ghuddy |
251 |
|
| 129 |
ghuddy |
252 |
rsTemp.Close
|
|
|
253 |
Set rsTemp = nothing
|
|
|
254 |
Set OraDatabase2 = nothing
|
|
|
255 |
Set OraSession2 = nothing
|
| 119 |
ghuddy |
256 |
End Function
|
|
|
257 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
258 |
Function Get_Pkg_Base_View ( NNpv_id, NNrtag_id )
|
| 129 |
ghuddy |
259 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
260 |
|
| 129 |
ghuddy |
261 |
If NNrtag_id = "" Then
|
|
|
262 |
Get_Pkg_Base_View = "N/A"
|
|
|
263 |
Exit Function
|
|
|
264 |
End If
|
| 119 |
ghuddy |
265 |
|
| 129 |
ghuddy |
266 |
Query_String = _
|
|
|
267 |
" SELECT vi.view_name"&_
|
|
|
268 |
" FROM release_content rc,"&_
|
|
|
269 |
" views vi"&_
|
|
|
270 |
" WHERE vi.view_id = rc.base_view_id"&_
|
|
|
271 |
" AND rc.rtag_id = "& NNrtag_id &_
|
|
|
272 |
" AND rc.pv_id = "& NNpv_id
|
| 119 |
ghuddy |
273 |
|
| 129 |
ghuddy |
274 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
275 |
|
| 129 |
ghuddy |
276 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
277 |
Get_Pkg_Base_View = UCase(rsTemp.Fields("view_name"))
|
|
|
278 |
Else
|
|
|
279 |
Get_Pkg_Base_View = "N/A"
|
|
|
280 |
End If
|
| 119 |
ghuddy |
281 |
|
| 129 |
ghuddy |
282 |
rsTemp.Close
|
|
|
283 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
284 |
End Function
|
|
|
285 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
286 |
Function Get_Proj_ID ( SSrtag_id )
|
| 129 |
ghuddy |
287 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
288 |
|
| 129 |
ghuddy |
289 |
Query_String = _
|
|
|
290 |
" SELECT projects.proj_id"&_
|
|
|
291 |
" FROM projects projects, release_tags rel"&_
|
|
|
292 |
" WHERE projects.proj_id = rel.proj_id"&_
|
|
|
293 |
" AND rel.rtag_id = "& SSrtag_id
|
| 119 |
ghuddy |
294 |
|
| 129 |
ghuddy |
295 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
296 |
|
| 129 |
ghuddy |
297 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
298 |
Get_Proj_ID = (rsTemp.Fields("proj_id"))
|
|
|
299 |
End If
|
| 119 |
ghuddy |
300 |
|
| 129 |
ghuddy |
301 |
rsTemp.Close
|
|
|
302 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
303 |
End Function
|
|
|
304 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
305 |
Function Get_Proj_Name ( NNproj_id )
|
| 129 |
ghuddy |
306 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
307 |
|
| 129 |
ghuddy |
308 |
Query_String = _
|
|
|
309 |
" SELECT proj_name "&_
|
|
|
310 |
" FROM projects pr "&_
|
| 119 |
ghuddy |
311 |
" WHERE pr.proj_id = "& NNproj_id
|
|
|
312 |
|
| 129 |
ghuddy |
313 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
314 |
|
| 129 |
ghuddy |
315 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
316 |
Get_Proj_Name = (rsTemp.Fields("proj_name"))
|
|
|
317 |
End If
|
| 119 |
ghuddy |
318 |
|
| 129 |
ghuddy |
319 |
rsTemp.Close
|
|
|
320 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
321 |
End Function
|
|
|
322 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
323 |
Function Get_Base_URL ( NNproj_id )
|
| 129 |
ghuddy |
324 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
325 |
|
| 129 |
ghuddy |
326 |
Query_String = _
|
|
|
327 |
" SELECT base_url "&_
|
|
|
328 |
" FROM projects pr "&_
|
| 119 |
ghuddy |
329 |
" WHERE pr.proj_id = "& NNproj_id
|
|
|
330 |
|
| 129 |
ghuddy |
331 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
332 |
|
| 129 |
ghuddy |
333 |
Get_Base_URL = rsTemp("base_url")
|
| 119 |
ghuddy |
334 |
|
| 129 |
ghuddy |
335 |
rsTemp.Close()
|
|
|
336 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
337 |
End Function
|
|
|
338 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
339 |
Function Get_Categories ( NNrtag_id )
|
| 129 |
ghuddy |
340 |
Get_Categories = _
|
|
|
341 |
" SELECT vi.view_id, vi.view_name"&_
|
|
|
342 |
" FROM release_content rel,"&_
|
|
|
343 |
" views vi"&_
|
|
|
344 |
" WHERE rel.base_view_id = vi.view_id"&_
|
|
|
345 |
" AND rtag_id = "& NNrtag_id &_
|
|
|
346 |
" GROUP BY vi.view_id, vi.view_name "&_
|
|
|
347 |
" ORDER BY vi.view_name ASC "
|
| 119 |
ghuddy |
348 |
End Function
|
|
|
349 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
350 |
Function Get_PV_IDs_In_Release ( NNrtag_id )
|
|
|
351 |
Dim rsTemp, Query_String, tempSTR
|
| 129 |
ghuddy |
352 |
tempSTR = "-1"
|
|
|
353 |
Query_String = _
|
|
|
354 |
"SELECT pv_id FROM release_content WHERE rtag_id = "& NNrtag_id
|
| 119 |
ghuddy |
355 |
|
| 129 |
ghuddy |
356 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
357 |
|
| 129 |
ghuddy |
358 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
359 |
tempSTR = tempSTR &","& rsTemp.Fields("pv_id")
|
|
|
360 |
rsTemp.MoveNext
|
|
|
361 |
WEnd
|
|
|
362 |
Get_PV_IDs_In_Release = tempSTR
|
|
|
363 |
rsTemp.Close
|
|
|
364 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
365 |
End Function
|
|
|
366 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
367 |
Sub Get_Pkg_Info ( SSpv_id, NNrtag )
|
| 129 |
ghuddy |
368 |
Dim rsTemp, Query_String
|
|
|
369 |
OraDatabase.Parameters.Add "PV_ID", SSpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
370 |
OraDatabase.Parameters.Add "RTAG_ID", NNrtag, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
371 |
OraDatabase.Parameters.Add "RETURN_NUMBER", NULL, ORAPARM_OUTPUT, ORATYPE_NUMBER
|
| 119 |
ghuddy |
372 |
|
|
|
373 |
|
| 129 |
ghuddy |
374 |
pkgInfoHash.Item ("can_unofficial") = "false"
|
| 119 |
ghuddy |
375 |
|
| 129 |
ghuddy |
376 |
'/* Get Package Details */
|
|
|
377 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PackageDetails.sql"), cint(0))
|
| 119 |
ghuddy |
378 |
|
| 129 |
ghuddy |
379 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
380 |
pkgInfoHash.Add "pv_id", (rsTemp.Fields("pv_id"))
|
|
|
381 |
pkgInfoHash.Add "pkg_id", (rsTemp.Fields("pkg_id"))
|
|
|
382 |
pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
|
|
|
383 |
pkgInfoHash.Add "pkg_version", (rsTemp.Fields("pkg_version"))
|
|
|
384 |
pkgInfoHash.Add "v_ext", (rsTemp.Fields("v_ext"))
|
|
|
385 |
pkgInfoHash.Add "comments", (rsTemp.Fields("comments"))
|
| 119 |
ghuddy |
386 |
|
| 129 |
ghuddy |
387 |
pkgInfoHash.Add "modified_stamp", (rsTemp.Fields("modified_stamp"))
|
|
|
388 |
pkgInfoHash.Add "modifier", (rsTemp.Fields("modifier"))
|
|
|
389 |
pkgInfoHash.Add "modifier_id", (rsTemp.Fields("modifier_id"))
|
|
|
390 |
pkgInfoHash.Add "modifier_email", (rsTemp.Fields("modifier_email"))
|
| 119 |
ghuddy |
391 |
|
| 129 |
ghuddy |
392 |
pkgInfoHash.Add "created_stamp", (rsTemp.Fields("created_stamp"))
|
|
|
393 |
pkgInfoHash.Add "creator", (rsTemp.Fields("creator"))
|
|
|
394 |
pkgInfoHash.Add "creator_email", (rsTemp.Fields("creator_email"))
|
| 119 |
ghuddy |
395 |
|
| 129 |
ghuddy |
396 |
pkgInfoHash.Add "owner", (rsTemp.Fields("owner"))
|
|
|
397 |
pkgInfoHash.Add "owner_email", (rsTemp.Fields("owner_email"))
|
| 119 |
ghuddy |
398 |
|
| 129 |
ghuddy |
399 |
pkgInfoHash.Add "dlocked", (rsTemp.Fields("dlocked"))
|
|
|
400 |
pkgInfoHash.Add "proj_id", (rsTemp.Fields("proj_id"))
|
|
|
401 |
pkgInfoHash.Add "rtag_id", (rsTemp.Fields("rtag_id"))
|
|
|
402 |
pkgInfoHash.Add "rtag_name", (rsTemp.Fields("rtag_name"))
|
|
|
403 |
pkgInfoHash.Add "pkg_label", (rsTemp.Fields("pkg_label"))
|
|
|
404 |
pkgInfoHash.Add "src_path", (rsTemp.Fields("src_path"))
|
|
|
405 |
pkgInfoHash.Add "pv_description", (rsTemp.Fields("pv_description"))
|
|
|
406 |
pkgInfoHash.Add "last_pv_id", (rsTemp.Fields("last_pv_id"))
|
|
|
407 |
pkgInfoHash.Add "previous_version", (rsTemp.Fields("previous_version"))
|
|
|
408 |
pkgInfoHash.Add "release_notes_info", (rsTemp.Fields("release_notes_info"))
|
| 119 |
ghuddy |
409 |
|
| 129 |
ghuddy |
410 |
pkgInfoHash.Add "is_patch", (rsTemp.Fields("is_patch"))
|
|
|
411 |
pkgInfoHash.Add "is_obsolete", (rsTemp.Fields("is_obsolete"))
|
|
|
412 |
pkgInfoHash.Add "obsolete_comments", (rsTemp.Fields("obsolete_comments"))
|
| 119 |
ghuddy |
413 |
|
| 129 |
ghuddy |
414 |
pkgInfoHash.Add "build_type", (rsTemp.Fields("build_type"))
|
|
|
415 |
pkgInfoHash.Add "change_type", (rsTemp.Fields("change_type"))
|
|
|
416 |
pkgInfoHash.Add "bs_id", (rsTemp.Fields("bs_id"))
|
|
|
417 |
pkgInfoHash.Add "is_deployable", (rsTemp.Fields("is_deployable"))
|
|
|
418 |
pkgInfoHash.Add "sbom_priority", (rsTemp.Fields("sbom_priority"))
|
|
|
419 |
pkgInfoHash.Add "ripple_field", (rsTemp.Fields("ripple_field"))
|
| 119 |
ghuddy |
420 |
|
| 129 |
ghuddy |
421 |
End If
|
| 119 |
ghuddy |
422 |
|
|
|
423 |
|
| 129 |
ghuddy |
424 |
'-- Find if package is editable in this project
|
|
|
425 |
OraDatabase.ExecuteSQL "BEGIN :RETURN_NUMBER := CAN_EDIT_PKG_IN_PROJECT( :PV_ID, :RTAG_ID ); END;"
|
|
|
426 |
pkgInfoHash.Add "can_edit_in_project", CStr( OraDatabase.Parameters("RETURN_NUMBER").Value )
|
| 119 |
ghuddy |
427 |
|
|
|
428 |
|
| 129 |
ghuddy |
429 |
'/* Get Package Release Details */
|
|
|
430 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PackageReleaseDetails.sql"), cint(0))
|
| 119 |
ghuddy |
431 |
|
|
|
432 |
|
|
|
433 |
|
| 129 |
ghuddy |
434 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
435 |
pkgInfoHash.Item ("base_view_id") = (rsTemp.Fields("base_view_id"))
|
|
|
436 |
pkgInfoHash.Add "insert_stamp", (rsTemp.Fields("insert_stamp"))
|
|
|
437 |
pkgInfoHash.Add "insertor", (rsTemp.Fields("insertor"))
|
|
|
438 |
pkgInfoHash.Add "insertor_email", (rsTemp.Fields("insertor_email"))
|
|
|
439 |
pkgInfoHash.Item ("pkg_state") = (rsTemp.Fields("pkg_state"))
|
|
|
440 |
pkgInfoHash.Item ("deprecated_state") = (rsTemp.Fields("deprecated_state"))
|
|
|
441 |
pkgInfoHash.Item ("product_state") = (rsTemp.Fields("product_state"))
|
| 119 |
ghuddy |
442 |
|
| 129 |
ghuddy |
443 |
'AND (rsTemp("used_count") = 0) _
|
| 119 |
ghuddy |
444 |
|
| 129 |
ghuddy |
445 |
If (pkgInfoHash.Item ("dlocked") = "Y") _
|
|
|
446 |
AND (pkgInfoHash.Item ("build_type") = "M") _
|
|
|
447 |
AND (CDate( FormatDateTime(pkgInfoHash.Item ("modified_stamp"), 2) ) = Date) _
|
|
|
448 |
AND (pkgInfoHash.Item("can_edit_in_project") = "1" ) _
|
|
|
449 |
Then
|
| 119 |
ghuddy |
450 |
|
| 129 |
ghuddy |
451 |
pkgInfoHash.Item ("can_unofficial") = "true"
|
|
|
452 |
End If
|
| 119 |
ghuddy |
453 |
|
| 129 |
ghuddy |
454 |
Else
|
| 119 |
ghuddy |
455 |
|
| 129 |
ghuddy |
456 |
If (CDate( FormatDateTime(pkgInfoHash.Item ("modified_stamp"), 2) ) = Date) Then
|
|
|
457 |
' Must be not older then a day
|
|
|
458 |
If (pkgInfoHash.Item ("dlocked") = "A") OR NOT IsNull(pkgInfoHash.Item("is_patch")) Then
|
|
|
459 |
pkgInfoHash.Item ("can_unofficial") = "true"
|
| 119 |
ghuddy |
460 |
|
| 129 |
ghuddy |
461 |
End If
|
| 119 |
ghuddy |
462 |
|
| 129 |
ghuddy |
463 |
End If
|
| 119 |
ghuddy |
464 |
|
| 129 |
ghuddy |
465 |
End If
|
| 119 |
ghuddy |
466 |
|
|
|
467 |
|
| 129 |
ghuddy |
468 |
'/* Get Patch Parent */
|
|
|
469 |
If pkgInfoHash.Item ("is_patch") = "Y" Then
|
|
|
470 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PatchParent.sql"), cint(0))
|
| 119 |
ghuddy |
471 |
|
| 129 |
ghuddy |
472 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
473 |
pkgInfoHash.Add "patch_parent_id", (rsTemp.Fields("pv_id"))
|
|
|
474 |
End If
|
|
|
475 |
End If
|
| 119 |
ghuddy |
476 |
|
| 129 |
ghuddy |
477 |
' DEVI-45275 - Check if version is in the planned table and if so get its planned operation type
|
|
|
478 |
' which denotes whether it is an existing version being added to a release, an existing version
|
|
|
479 |
' being removed from a release, or a new version being prepared for a release.
|
|
|
480 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PlannedPackageVersionDetails.sql"), cint(0))
|
| 119 |
ghuddy |
481 |
|
| 129 |
ghuddy |
482 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
483 |
pkgInfoHash.Add "planned_operation", (rsTemp.Fields("operation"))
|
|
|
484 |
Else
|
|
|
485 |
pkgInfoHash.Add "planned_operation", " "
|
|
|
486 |
End If
|
| 119 |
ghuddy |
487 |
|
| 129 |
ghuddy |
488 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
489 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
490 |
OraDatabase.Parameters.Remove "RETURN_NUMBER"
|
| 119 |
ghuddy |
491 |
|
|
|
492 |
|
| 129 |
ghuddy |
493 |
rsTemp.Close
|
|
|
494 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
495 |
End Sub
|
|
|
496 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
497 |
Sub Get_Pkg_Short_Info( SSparPv_id, SSpkgID, SSpkgName, SSpkgVersion, SSsrc_path, SSpkgDesc, BBdlocked )
|
| 129 |
ghuddy |
498 |
Dim rsTemp, Query_String
|
|
|
499 |
If IsEmpty(SSparPv_id) Then Exit Sub
|
| 119 |
ghuddy |
500 |
|
| 129 |
ghuddy |
501 |
Query_String = _
|
|
|
502 |
" SELECT pkg.pkg_id, pkg.pkg_name, pv.pkg_version, pv.src_path, pv.pv_description, pv.dlocked"&_
|
|
|
503 |
" FROM packages pkg, package_versions pv"&_
|
|
|
504 |
" WHERE pkg.pkg_id = pv.pkg_id AND pv.pv_id ="& SSparPv_id
|
| 119 |
ghuddy |
505 |
|
| 129 |
ghuddy |
506 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
507 |
|
| 129 |
ghuddy |
508 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
509 |
SSpkgID = rsTemp.Fields("pkg_id")
|
|
|
510 |
SSpkgName = rsTemp.Fields("pkg_name")
|
|
|
511 |
SSpkgVersion = rsTemp.Fields("pkg_version")
|
|
|
512 |
SSsrc_path = rsTemp.Fields("src_path")
|
|
|
513 |
SSpkgDesc = rsTemp.Fields("pv_description")
|
|
|
514 |
BBdlocked = rsTemp.Fields("dlocked")
|
|
|
515 |
End If
|
| 119 |
ghuddy |
516 |
|
| 129 |
ghuddy |
517 |
rsTemp.Close
|
|
|
518 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
519 |
End Sub
|
|
|
520 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
521 |
Private Function IsDomainAuthOK( SSusername, SSpassword, SSdomainName )
|
| 129 |
ghuddy |
522 |
Dim objLoginAuth, return, tempSTR
|
|
|
523 |
'Set objWSH = Server.CreateObject("WScript.Shell")
|
|
|
524 |
'On Error Resume Next
|
|
|
525 |
'return = -1
|
|
|
526 |
'return = objWSH.Run("cmd.exe /c perl "& rootPath &"\common\domainauth.pl """&_
|
|
|
527 |
' SSdomainName &""" """& SSusername &""" """& SSpassword &""" "&_
|
|
|
528 |
' "> "& rootPath &"\temp\"& SSusername &".txt", 0, true)
|
| 119 |
ghuddy |
529 |
|
| 129 |
ghuddy |
530 |
Set objLoginAuth = Server.CreateObject("LoginAdmin.ImpersonateUser")
|
| 119 |
ghuddy |
531 |
|
| 129 |
ghuddy |
532 |
return = -1
|
|
|
533 |
return = objLoginAuth.AuthenticateUser ( SSusername, SSpassword, SSdomainName )
|
| 119 |
ghuddy |
534 |
|
| 129 |
ghuddy |
535 |
'Response.write "LOGIN"& SSusername &"-"& SSpassword &"-"& SSdomainName &"-"& return
|
| 119 |
ghuddy |
536 |
|
| 129 |
ghuddy |
537 |
If (return = 0) OR (return = 1385) Then
|
|
|
538 |
' From MSDN System Error Codes
|
|
|
539 |
' 0 - The operation completed successfully.
|
|
|
540 |
' 1326 - Logon failure: unknown user name or bad password.
|
|
|
541 |
' 1385 - Logon failure: the user has not been granted the requested logon type at this computer.
|
|
|
542 |
' 1909 - The referenced account is currently locked out and may not be used to log on.
|
| 119 |
ghuddy |
543 |
|
| 129 |
ghuddy |
544 |
'Login ok
|
|
|
545 |
IsDomainAuthOK = True
|
|
|
546 |
Else
|
|
|
547 |
IsDomainAuthOK = False
|
|
|
548 |
End If
|
| 119 |
ghuddy |
549 |
|
| 129 |
ghuddy |
550 |
Set objLoginAuth = Nothing
|
| 119 |
ghuddy |
551 |
End Function
|
|
|
552 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
553 |
Function ReadUserPreferences ( SSitem )
|
| 129 |
ghuddy |
554 |
'ReadUserPreferences = Request.Cookies("RELEASEMANAGER_USER_PREFERENCES")( SSitem )
|
|
|
555 |
ReadUserPreferences = "0"
|
| 119 |
ghuddy |
556 |
End Function
|
|
|
557 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
558 |
Function Requred_Parameters_String ( SScurrent, SSstr )
|
| 129 |
ghuddy |
559 |
'returns "&par1=val1&&parn=valn&" must use & as it will not be used on parameter name or value
|
|
|
560 |
Dim tempARR, parameter, tempSTR
|
|
|
561 |
tempARR = Split( SSstr, "," )
|
|
|
562 |
tempSTR = SScurrent
|
| 119 |
ghuddy |
563 |
|
| 129 |
ghuddy |
564 |
For Each parameter In tempARR
|
|
|
565 |
tempSTR = tempSTR &"&"& parameter &"="& QStrPar( parameter ) &"&"
|
|
|
566 |
Next
|
| 119 |
ghuddy |
567 |
|
| 129 |
ghuddy |
568 |
Requred_Parameters_String = tempSTR
|
| 119 |
ghuddy |
569 |
End Function
|
|
|
570 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
571 |
Function Quick_Help ( SStipname )
|
| 129 |
ghuddy |
572 |
Quick_Help = "<a href='javascript:;' onMouseOver=""formTips.show('"& SStipname &"')"" onMouseOut=""formTips.hide()""><img src='images/i_help.gif' width='12' height='12' hspace='2' align='absmiddle' border='0' ></a>"
|
| 119 |
ghuddy |
573 |
End Function
|
|
|
574 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
575 |
Function LogError ( SSlog, SSstr )
|
| 129 |
ghuddy |
576 |
'|errstr1||errstr2||errstr3|...
|
|
|
577 |
LogError = SSlog &"|"& SSstr &"|"
|
| 119 |
ghuddy |
578 |
End Function
|
|
|
579 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
580 |
Sub Send_Email ( SSfromName, SSfrom, SSto, SSsubject, SSbody, oAttachments )
|
| 129 |
ghuddy |
581 |
Dim Mail, Keys, Key, canSend
|
| 119 |
ghuddy |
582 |
|
| 129 |
ghuddy |
583 |
canSend = FALSE
|
|
|
584 |
Set Mail = Server.CreateObject("Persits.MailSender")
|
|
|
585 |
Mail.Host = SMTP_HOST
|
| 119 |
ghuddy |
586 |
|
| 129 |
ghuddy |
587 |
Mail.From = SSfrom
|
|
|
588 |
Mail.FromName = SSfromName
|
| 119 |
ghuddy |
589 |
|
| 129 |
ghuddy |
590 |
' Send TO:
|
|
|
591 |
If IsObject( SSto ) Then
|
|
|
592 |
Keys = SSto.Keys
|
|
|
593 |
For Each Key In Keys
|
|
|
594 |
Mail.AddAddress Key, SSto.Item( Key )
|
|
|
595 |
Next
|
| 119 |
ghuddy |
596 |
|
| 129 |
ghuddy |
597 |
If SSto.Count > 0 Then canSend = TRUE
|
|
|
598 |
Else
|
| 119 |
ghuddy |
599 |
|
| 129 |
ghuddy |
600 |
Mail.AddAddress SSto
|
|
|
601 |
If SSto <> "" Then canSend = TRUE
|
|
|
602 |
End If
|
| 119 |
ghuddy |
603 |
|
| 129 |
ghuddy |
604 |
Mail.Subject = SSsubject
|
|
|
605 |
Mail.IsHTML = True
|
|
|
606 |
Mail.Body = SSbody
|
| 119 |
ghuddy |
607 |
|
| 129 |
ghuddy |
608 |
' Add Attachments DDDDDDD Sash, It appears as if AddEmbededImage is premium functionality that costs money, can we just do a normal add attachment?
|
|
|
609 |
'If IsObject( oAttachments ) Then
|
|
|
610 |
' Keys = oAttachments.Keys
|
|
|
611 |
' For Each Key In Keys
|
|
|
612 |
' Mail.AddEmbeddedImage rootPath & Key, oAttachments.Item( Key )
|
|
|
613 |
' Next
|
|
|
614 |
'
|
|
|
615 |
'End If
|
| 119 |
ghuddy |
616 |
|
| 129 |
ghuddy |
617 |
On Error Resume Next
|
|
|
618 |
If canSend Then Mail.Send ' send message
|
| 119 |
ghuddy |
619 |
|
|
|
620 |
End Sub
|
|
|
621 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
622 |
Sub Iterate_UP_the_tree ( NNrtag_id, HHstart_with, HHresult )
|
| 129 |
ghuddy |
623 |
Dim rsTemp, Query_String
|
|
|
624 |
Dim seekPKGs, seekNOTpkgs
|
| 119 |
ghuddy |
625 |
|
| 129 |
ghuddy |
626 |
seekPKGs = Join(HHstart_with.Keys, ",")
|
|
|
627 |
If seekPKGs = "" Then seekPKGs = "-1"
|
|
|
628 |
seekNOTpkgs = "-1"
|
| 119 |
ghuddy |
629 |
|
| 129 |
ghuddy |
630 |
Do While seekPKGs <> "-1"
|
|
|
631 |
Query_String = _
|
|
|
632 |
" SELECT DISTINCT dep.pkg_id"&_
|
|
|
633 |
" FROM package_dependencies dep, release_content rel"&_
|
|
|
634 |
" WHERE rel.pv_id = dep.pv_id"&_
|
|
|
635 |
" AND rel.rtag_id = "& NNrtag_id &_
|
|
|
636 |
" AND dpkg_id IN ( "& seekPKGs &" ) "&_
|
|
|
637 |
" AND pkg_id NOT IN ( "& seekNOTpkgs &" )"
|
|
|
638 |
'" AND dep.dpv_id NOT IN ( SELECT iw.iw_id FROM ignore_warnings iw WHERE iw.rtag_id = "& NNrtag_id &" )"
|
|
|
639 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
640 |
|
| 129 |
ghuddy |
641 |
If rsTemp.RecordCount < 1 Then Exit Do
|
| 119 |
ghuddy |
642 |
|
| 129 |
ghuddy |
643 |
seekPKGs = "-1"
|
|
|
644 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
645 |
If NOT HHresult.Exists(Cstr(rsTemp.Fields("pkg_id"))) Then HHresult.Add Cstr(rsTemp.Fields("pkg_id")), ""
|
|
|
646 |
seekPKGs = seekPKGs &","& rsTemp.Fields("pkg_id")
|
|
|
647 |
rsTemp.MoveNext
|
|
|
648 |
WEnd
|
| 119 |
ghuddy |
649 |
|
| 129 |
ghuddy |
650 |
seekNOTpkgs = seekNOTpkgs &","& seekPKGs
|
|
|
651 |
Loop
|
| 119 |
ghuddy |
652 |
|
|
|
653 |
End Sub
|
|
|
654 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 129 |
ghuddy |
655 |
Sub Iterate_DOWN_the_tree ( NNrtag_id, HHstart_with, HHresult )
|
|
|
656 |
Dim rsTemp, Query_String
|
|
|
657 |
Dim seekPKGs, seekNOTpkgs
|
| 119 |
ghuddy |
658 |
|
| 129 |
ghuddy |
659 |
seekPKGs = Join(HHstart_with.Keys, ",")
|
|
|
660 |
If seekPKGs = "" Then seekPKGs = "-1"
|
|
|
661 |
seekNOTpkgs = "-1"
|
| 119 |
ghuddy |
662 |
|
| 129 |
ghuddy |
663 |
Do While seekPKGs <> "-1"
|
|
|
664 |
Query_String = _
|
|
|
665 |
" SELECT DISTINCT dep.dpkg_id"&_
|
|
|
666 |
" FROM package_dependencies dep, release_content rel"&_
|
|
|
667 |
" WHERE rel.pv_id = dep.pv_id"&_
|
|
|
668 |
" AND rel.rtag_id = "& NNrtag_id &_
|
|
|
669 |
" AND pkg_id IN ( "& seekPKGs &" ) "&_
|
|
|
670 |
" AND dpkg_id NOT IN ( "& seekNOTpkgs &" )"
|
|
|
671 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
672 |
|
| 129 |
ghuddy |
673 |
If rsTemp.RecordCount < 1 Then Exit Do
|
| 119 |
ghuddy |
674 |
|
| 129 |
ghuddy |
675 |
seekPKGs = "-1"
|
|
|
676 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
677 |
If NOT HHresult.Exists(Cstr(rsTemp.Fields("dpkg_id"))) Then HHresult.Add Cstr(rsTemp.Fields("dpkg_id")), ""
|
|
|
678 |
seekPKGs = seekPKGs &","& rsTemp.Fields("dpkg_id")
|
|
|
679 |
rsTemp.MoveNext
|
|
|
680 |
WEnd
|
| 119 |
ghuddy |
681 |
|
| 129 |
ghuddy |
682 |
seekNOTpkgs = seekNOTpkgs &","& seekPKGs
|
|
|
683 |
Loop
|
| 119 |
ghuddy |
684 |
|
|
|
685 |
End Sub
|
|
|
686 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
687 |
Class TempSession
|
| 129 |
ghuddy |
688 |
Function Value ()
|
|
|
689 |
Value = Session("RELEASEMANAGER_temp")
|
|
|
690 |
End Function
|
| 119 |
ghuddy |
691 |
|
| 129 |
ghuddy |
692 |
Sub Add ( SSstr )
|
|
|
693 |
Session("RELEASEMANAGER_temp") = Session("RELEASEMANAGER_temp") & SSstr
|
|
|
694 |
End Sub
|
| 119 |
ghuddy |
695 |
|
| 129 |
ghuddy |
696 |
Sub Clean ()
|
|
|
697 |
Session("RELEASEMANAGER_temp") = NULL
|
|
|
698 |
End Sub
|
| 119 |
ghuddy |
699 |
End Class
|
|
|
700 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
701 |
Sub DisplayInfo ( SSmsg, SSwidth )
|
| 129 |
ghuddy |
702 |
Dim msg
|
|
|
703 |
If SSmsg = "" Then Exit Sub
|
| 119 |
ghuddy |
704 |
|
| 129 |
ghuddy |
705 |
Select Case UCase( SSmsg )
|
|
|
706 |
Case "ISSUES_IMPORTED"
|
|
|
707 |
msg = "Import is complete. <br>Click on Close button if you are finished."
|
|
|
708 |
Case "MAKE_OFFICIAL_WARNING"
|
|
|
709 |
msg = "Note that making a package official will prevent any further change to it."
|
|
|
710 |
Case "APPLY_LABEL_TO_ALL_WARNING"
|
|
|
711 |
msg = "This will overwrite any existing labels on selected packages."
|
|
|
712 |
Case "BLANK_LABEL_WARNING"
|
|
|
713 |
msg = "Some dependencies in the export list above, do not have a label!"
|
|
|
714 |
Case "PERSONAL_VIEW_NOT_SETUP"
|
|
|
715 |
msg = "<span class='err_alert'><b>Your View is not setup!</b></span><span class='sublbox_txt'><br><br>Either set your view using My Account > Views menu<br><br>OR<br><br>switch to Base view (Full view) by clicking on <img src='images/abtn_personal_view.gif' width='25' height='25' border='0'> icon above.</span>"
|
|
|
716 |
Case "EMPTY_RELEASE_CONTENTS"
|
|
|
717 |
msg = "<span class='err_alert'><b>Release content is empty!</b></span><span class='sublbox_txt'><br><br>Use + button to add packages to a release.</span>"
|
|
|
718 |
Case "PKG_NAME_REQUIRED"
|
|
|
719 |
msg = "<span class='err_alert'><b>Package Name required!</b></span><span class='sublbox_txt'><br>You are required to select at least one package name.</span>"
|
|
|
720 |
Case "ADD_PATCH_WARNING"
|
|
|
721 |
msg = "Note that patches cannot be used in your build dependencies."
|
|
|
722 |
Case "NEW_PATCH_AVAILABLE"
|
|
|
723 |
msg = "<b>New Patch is Required</b><br>One or more Build Dependencies have been patched.<br>Please click Add button to create patch for this package."
|
| 119 |
ghuddy |
724 |
|
| 129 |
ghuddy |
725 |
Case "GENERATE_RELEASE_NOTES"
|
|
|
726 |
msg = "<a href='_generate_release_notes.asp?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") &"' class='txt_linked'>Click here</a> to generate full release notes."
|
|
|
727 |
Case "NOT_FOUND_IN_PKG_ARCHIVE_RELEASE_NOTES"
|
|
|
728 |
msg = "<b>This package is not found in dpkg_archive or deploy_archive!</b><br>Release notes are not generated.<br><a href='_generate_release_notes.asp?rfile="& scriptName &"&pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") &"' class='txt_linked'>Click here</a> to try again."
|
|
|
729 |
Case "FAILED_GENERATING_RELEASE_NOTES"
|
|
|
730 |
msg = "<span class='err_alert'><b>Failed generating release notes!</b></span><br>Please contact the <a href='mailto:"& adminEmail&"' class='txt_linked'>Administrator</a>"
|
|
|
731 |
Case "GENERATING_RELEASE_NOTES"
|
|
|
732 |
msg = "<b>Generating release notes...</b><br>It may take a minute. Please try refreshing this page a bit later."
|
|
|
733 |
Case "NO_PREVIOUS_VERSION_RELEASE_NOTES"
|
|
|
734 |
msg = "<b>Previous Version is Unknown</b>!<br>Please specify previous version by clicking on 'Show Details...' above.<br>Release notes are not generated."
|
| 119 |
ghuddy |
735 |
|
| 129 |
ghuddy |
736 |
Case "PACKAGE_FOUND_IN_OTHER_LOCATIONS"
|
|
|
737 |
msg = "This package is also found in other locations."
|
|
|
738 |
Case "DOC_NUMBER_NOTFOUND"
|
|
|
739 |
msg = "<span class='err_alert'>Document number "& Request("doc_num") &" does not correspond to any document!</span>"
|
|
|
740 |
Case "DOC_NUMBER_FOUND"
|
|
|
741 |
msg = "Document found. Click "Import" to link the document."
|
|
|
742 |
Case "UNIT_TEST_NOT_DONE"
|
|
|
743 |
msg = "<b>Unit test is Not Done!</b><br><a href='javascript:;' onClick=""MM_openBrWindow('_wform_reason_for_unit_test_not_done.asp?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") &"','ReasonForNotDone','resizable=yes,width=400,height=250')"" class='txt_linked'>Click here</a> to supply/edit reason."
|
|
|
744 |
Case "PACKAGE_NOT_PART_OF_RELEASE"
|
|
|
745 |
msg = "<b>Package is Not Part of This Release Anymore!</b><br>This package cannot be found in the list on the left-hand side.<br>You can use 'lookup:' on the left-hand side to find the package inside this release. "
|
| 119 |
ghuddy |
746 |
|
| 129 |
ghuddy |
747 |
Case "NOT_FOUND_IN_PKG_ARCHIVE_FILE_GENERATE"
|
|
|
748 |
msg = "<b>This package is not found in dpkg_archive or deploy_archive!</b><br>Files and folders are not captured.<br><a href='_generate_files_and_folders.asp?rfile="& scriptName &"&pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") &"' class='txt_linked' onClick=""ProgressBar.style.visibility='visible';"">Click here</a> to try again."
|
|
|
749 |
Case "GENERATE_FILES_AND_FOLDERS"
|
|
|
750 |
msg = "<b>Files and folders not found.</b><br><a href='_generate_files_and_folders.asp?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") &"' class='txt_linked' onClick=""ProgressBar.style.visibility='visible';"">Click here</a> to try capture them."
|
|
|
751 |
Case "NO_PRODUCT_FILES_CAPTURED"
|
|
|
752 |
msg = "<b>Files and Folders not found for this product!</b><br>Capture of product components can only be done during the build time."
|
| 119 |
ghuddy |
753 |
|
| 129 |
ghuddy |
754 |
Case "MASS REF REFERENCE"
|
|
|
755 |
msg = "<span class='err_alert'><b>New Version can only be created in the Release's associated MASS REF: <a href=""dependencies.asp?pv_id="& pkgInfoHash.Item("pv_id") &"&rtag_id="& AssocMASSREFValue &""">"& pkgInfoHash.Item("pkg_name") &" "& pkgInfoHash.Item("pkg_version") &"</a></b></span>"
|
| 119 |
ghuddy |
756 |
|
| 129 |
ghuddy |
757 |
Case "REPEAT_SCHEDULE_NOT_SELECTED"
|
|
|
758 |
msg = "<span class='err_alert'><b>YOU MUST SELECT A VALUE FOR REPEAT SCHEDULED DOWNTIME</b></span>"
|
| 119 |
ghuddy |
759 |
|
| 129 |
ghuddy |
760 |
Case "PKG_NAME_INVALID"
|
|
|
761 |
msg = "<span class='err_alert'><b>Package Name Invalid!</b></span><span class='sublbox_txt'><br>This package name is invalid. Package names must only consist of alpha-numeric characters, underscores and dashes (A-Z 0-9 _ -), and cannot include spaces or any other symbols.</span>"
|
| 119 |
ghuddy |
762 |
|
| 129 |
ghuddy |
763 |
Case "PKG_NAME_EXISTS"
|
|
|
764 |
msg = "<span class='err_alert'><b>Package Name Already Exists!</b></span><span class='sublbox_txt'><br>This package name already exists, please try again.</span>"
|
| 119 |
ghuddy |
765 |
|
| 129 |
ghuddy |
766 |
End Select
|
| 119 |
ghuddy |
767 |
%>
|
|
|
768 |
<table width="<%=SSwidth%>" border="0" cellspacing="0" cellpadding="1">
|
|
|
769 |
<tr>
|
|
|
770 |
<td background="images/bg_bage_dark.gif">
|
| 129 |
ghuddy |
771 |
<table width="100%" border="0" cellspacing="0" cellpadding="3">
|
| 119 |
ghuddy |
772 |
<tr>
|
|
|
773 |
<td width="1%" valign="top" background="images/bg_help.gif"><img src="images/i_qhelp.gif" width="16" height="16"></td>
|
|
|
774 |
<td width="100%" background="images/bg_help.gif" class="form_txt"><%=msg%></td>
|
|
|
775 |
</tr>
|
|
|
776 |
</table></td>
|
|
|
777 |
</tr>
|
|
|
778 |
</table>
|
|
|
779 |
<br>
|
|
|
780 |
<%
|
|
|
781 |
|
|
|
782 |
End Sub
|
|
|
783 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
784 |
Sub Messenger ( sMessage, nMessageType, sWidth )
|
| 129 |
ghuddy |
785 |
Dim msgTemplate, Img
|
| 119 |
ghuddy |
786 |
|
| 129 |
ghuddy |
787 |
If (sMessage = "") OR IsNull(sMessage) Then Exit Sub
|
| 119 |
ghuddy |
788 |
|
| 129 |
ghuddy |
789 |
Select Case CStr(nMessageType)
|
|
|
790 |
Case "1"
|
|
|
791 |
Img = "s_critical.gif"
|
|
|
792 |
Case "2"
|
|
|
793 |
Img = "s_warning.gif"
|
|
|
794 |
Case "3"
|
|
|
795 |
Img = "s_note.gif"
|
|
|
796 |
Case Else
|
|
|
797 |
Img = nMessageType
|
|
|
798 |
End Select
|
| 119 |
ghuddy |
799 |
|
|
|
800 |
|
| 129 |
ghuddy |
801 |
msgTemplate = ReadFile( APP_ROOT &"\scripts\message_style.html" )
|
|
|
802 |
msgTemplate = Replace( msgTemplate, "%WIDTH%", sWidth )
|
|
|
803 |
msgTemplate = Replace( msgTemplate, "%IMAGE%", Img )
|
|
|
804 |
msgTemplate = Replace( msgTemplate, "%MESSAGE%", sMessage )
|
| 119 |
ghuddy |
805 |
|
| 129 |
ghuddy |
806 |
Response.write msgTemplate
|
| 119 |
ghuddy |
807 |
End Sub
|
|
|
808 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 129 |
ghuddy |
809 |
Function Default_Label ( SSpv_id, SSbuild_type, SSpkg_name, SSpkg_version, SSv_ext )
|
|
|
810 |
Dim rsTemp, Query_String
|
|
|
811 |
' Do not do anything is label already exists
|
|
|
812 |
'If Not IsNull(rsPkgInfo("pkg_label")) OR (rsPkgInfo("pkg_label")<>"")Then
|
|
|
813 |
' Default_Label = rsPkgInfo("pkg_label")
|
|
|
814 |
' Exit Function
|
|
|
815 |
'End If
|
| 119 |
ghuddy |
816 |
|
| 129 |
ghuddy |
817 |
If Request("rtag_id") <> "" Then
|
| 119 |
ghuddy |
818 |
|
| 129 |
ghuddy |
819 |
Set rsTemp = OraDatabase.DbCreateDynaset( "SELECT PROJ_ID FROM RELEASE_TAGS WHERE RTAG_ID = "& Request("rtag_id") &"" , cint(0) )
|
| 119 |
ghuddy |
820 |
|
| 129 |
ghuddy |
821 |
If InStr(1, SSpkg_name, "ERG") = 1 AND rsTemp("proj_id") <> 202 Then
|
|
|
822 |
' For ERG products
|
|
|
823 |
If IsNull(SSv_ext) OR (SSv_ext = "") Then
|
|
|
824 |
' blank extention e.i. MAS
|
|
|
825 |
Default_Label = "MAS_"& UCase(SSpkg_name) &"_R_"& Format_Version( SSpkg_version, NULL )
|
|
|
826 |
Else
|
|
|
827 |
Default_Label = UCase( Replace(SSv_ext, ".", "") ) &"_"& UCase(SSpkg_name) &"_R_"& Format_Version( SSpkg_version, SSv_ext )
|
|
|
828 |
End If
|
|
|
829 |
Else
|
|
|
830 |
' For others
|
|
|
831 |
If SSbuild_type = "A" Then
|
|
|
832 |
Default_Label = UCase(SSpkg_name & "." & SSpv_id & SSv_ext & ".WIP")
|
|
|
833 |
Else
|
|
|
834 |
Default_Label = SSpkg_name &"_"& SSpkg_version
|
|
|
835 |
End If
|
| 119 |
ghuddy |
836 |
|
| 129 |
ghuddy |
837 |
End If
|
| 119 |
ghuddy |
838 |
|
| 129 |
ghuddy |
839 |
rsTemp.Close()
|
|
|
840 |
Set rsTemp = nothing
|
|
|
841 |
Else
|
|
|
842 |
If InStr(1, SSpkg_name, "ERG") = 1 Then
|
|
|
843 |
' For ERG products
|
|
|
844 |
If IsNull(SSv_ext) OR (SSv_ext = "") Then
|
|
|
845 |
' blank extention e.i. MAS
|
|
|
846 |
Default_Label = "MAS_"& UCase(SSpkg_name) &"_R_"& Format_Version( SSpkg_version, NULL )
|
|
|
847 |
Else
|
|
|
848 |
Default_Label = UCase( Replace(SSv_ext, ".", "") ) &"_"& UCase(SSpkg_name) &"_R_"& Format_Version( SSpkg_version, SSv_ext )
|
|
|
849 |
End If
|
|
|
850 |
Else
|
|
|
851 |
' For others
|
|
|
852 |
If SSbuild_type = "A" Then
|
|
|
853 |
Default_Label = UCase(SSpkg_name & "." & SSpv_id & SSv_ext & ".WIP")
|
|
|
854 |
Else
|
|
|
855 |
Default_Label = SSpkg_name &"_"& SSpkg_version
|
|
|
856 |
End If
|
|
|
857 |
End If
|
|
|
858 |
End If
|
| 119 |
ghuddy |
859 |
End Function
|
|
|
860 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
861 |
Function Format_Version ( SSpkg_version, SSv_ext )
|
| 129 |
ghuddy |
862 |
Dim tempArr, tempVersion, patchArr, seg, myVersion
|
|
|
863 |
myVersion = SSpkg_version
|
| 119 |
ghuddy |
864 |
|
| 129 |
ghuddy |
865 |
If NOT IsNull(SSv_ext) Then
|
|
|
866 |
myVersion = Left ( myVersion, Len(myVersion) - Len(SSv_ext) )
|
|
|
867 |
End If
|
| 119 |
ghuddy |
868 |
|
| 129 |
ghuddy |
869 |
tempArr = Split (myVersion, ".")
|
|
|
870 |
For Each seg In tempArr
|
|
|
871 |
If Len(seg) < 2 Then
|
|
|
872 |
' single digit number
|
|
|
873 |
tempVersion = tempVersion &"0"& seg
|
| 119 |
ghuddy |
874 |
|
| 129 |
ghuddy |
875 |
Else
|
|
|
876 |
seg = Replace(seg, "_", "-") ' make sure that there is no _ in segment
|
|
|
877 |
If InStr( seg, "-" ) > 0 Then
|
|
|
878 |
' patch version supplied
|
|
|
879 |
patchArr = Split(seg, "-")
|
|
|
880 |
If Len(patchArr(0)) < 2 Then
|
|
|
881 |
' single digit number
|
|
|
882 |
tempVersion = tempVersion &"0"& patchArr(0) &"_0"& patchArr(1)
|
|
|
883 |
Else
|
|
|
884 |
' double digit number
|
|
|
885 |
tempVersion = tempVersion & patchArr(0) &"_0"& patchArr(1)
|
|
|
886 |
End If
|
| 119 |
ghuddy |
887 |
|
| 129 |
ghuddy |
888 |
Else
|
|
|
889 |
' double digit no patch
|
|
|
890 |
tempVersion = tempVersion & seg
|
|
|
891 |
End If
|
| 119 |
ghuddy |
892 |
|
| 129 |
ghuddy |
893 |
End If
|
| 119 |
ghuddy |
894 |
|
| 129 |
ghuddy |
895 |
Next
|
| 119 |
ghuddy |
896 |
|
| 129 |
ghuddy |
897 |
Format_Version = tempVersion
|
| 119 |
ghuddy |
898 |
End Function
|
|
|
899 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
900 |
Function DefineStateIcon ( NNpkg_state, CCdlocked, sIgnoreWarnings, cIsPatchIgnore, cBuildType, bForEnvironment )
|
|
|
901 |
|
| 129 |
ghuddy |
902 |
If NOT IsNull(sIgnoreWarnings) Then
|
|
|
903 |
'-- Ignore Warning is on
|
|
|
904 |
If IsNull(cIsPatchIgnore) Then
|
|
|
905 |
DefineStateIcon = enum_imgIgnoring
|
|
|
906 |
Else
|
|
|
907 |
DefineStateIcon = enum_imgPatchIgnoring
|
|
|
908 |
End If
|
| 119 |
ghuddy |
909 |
|
| 129 |
ghuddy |
910 |
Else
|
|
|
911 |
Select Case CInt( NNpkg_state )
|
|
|
912 |
Case enumPKG_STATE_OK
|
|
|
913 |
If (CCdlocked = "N") OR (CCdlocked = "R") OR (CCdlocked = "P") Then
|
|
|
914 |
DefineStateIcon = enum_imgBuilding
|
|
|
915 |
Else
|
|
|
916 |
DefineStateIcon = enum_imgBlank
|
|
|
917 |
End If
|
| 119 |
ghuddy |
918 |
|
| 129 |
ghuddy |
919 |
Case enumPKG_STATE_MAJOR
|
|
|
920 |
DefineStateIcon = enum_imgCritical
|
| 119 |
ghuddy |
921 |
|
| 129 |
ghuddy |
922 |
Case enumPKG_STATE_MINOR
|
|
|
923 |
DefineStateIcon = enum_imgWarning
|
| 119 |
ghuddy |
924 |
|
| 129 |
ghuddy |
925 |
Case enumPKG_STATE_MAJOR_READY
|
|
|
926 |
DefineStateIcon = enum_imgCReady
|
| 119 |
ghuddy |
927 |
|
| 129 |
ghuddy |
928 |
Case enumPKG_STATE_MINOR_READY
|
|
|
929 |
DefineStateIcon = enum_imgWReady
|
| 119 |
ghuddy |
930 |
|
| 129 |
ghuddy |
931 |
Case enumPKG_NOT_FOUND
|
|
|
932 |
DefineStateIcon = enum_imgNotFound
|
| 119 |
ghuddy |
933 |
|
| 129 |
ghuddy |
934 |
Case enumPKG_STATE_NEW_PATCH
|
|
|
935 |
DefineStateIcon = enum_imgPatchAvailable
|
| 119 |
ghuddy |
936 |
|
| 129 |
ghuddy |
937 |
Case enumPKG_STATE_DEPRECATED
|
|
|
938 |
DefineStateIcon = enum_imgDeprecated
|
| 119 |
ghuddy |
939 |
|
| 129 |
ghuddy |
940 |
Case enumPKG_STATE_DEPRECATED_DEPENDENT
|
|
|
941 |
DefineStateIcon = enum_imgDeprecatedDependent
|
| 119 |
ghuddy |
942 |
|
| 129 |
ghuddy |
943 |
Case enumPKG_ADVISORY_RIPPLE
|
|
|
944 |
DefineStateIcon = enum_imgAR
|
| 119 |
ghuddy |
945 |
|
| 129 |
ghuddy |
946 |
Case enumPKG_ADVISORY_RIPPLE_DEPENDENT
|
|
|
947 |
DefineStateIcon = enum_imgARD
|
| 119 |
ghuddy |
948 |
|
|
|
949 |
|
| 129 |
ghuddy |
950 |
End Select
|
| 119 |
ghuddy |
951 |
|
| 129 |
ghuddy |
952 |
If (NOT bForEnvironment) AND _
|
|
|
953 |
(cBuildType = "A") AND _
|
|
|
954 |
(CCdlocked <> "Y") AND _
|
|
|
955 |
(DefineStateIcon <> enum_imgBlank) AND _
|
|
|
956 |
(DefineStateIcon <> enum_imgBuilding) AND _
|
|
|
957 |
(DefineStateIcon <> enum_imgNotFound) OR _
|
|
|
958 |
( Request("rtag_id") = "" AND Request("FRrtag_id") = "") _
|
|
|
959 |
Then
|
| 119 |
ghuddy |
960 |
|
| 129 |
ghuddy |
961 |
DefineStateIcon = ""
|
| 119 |
ghuddy |
962 |
|
| 129 |
ghuddy |
963 |
End If
|
| 119 |
ghuddy |
964 |
|
|
|
965 |
|
| 129 |
ghuddy |
966 |
End If
|
| 119 |
ghuddy |
967 |
|
|
|
968 |
|
|
|
969 |
End Function
|
|
|
970 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
971 |
Function DefineStateSmallIcon ( NNpkg_state, CCdlocked )
|
| 129 |
ghuddy |
972 |
Select Case CInt( NNpkg_state )
|
|
|
973 |
Case enumPKG_STATE_OK
|
|
|
974 |
If CCdlocked = "N" Then
|
|
|
975 |
DefineStateSmallIcon = enum_SMALL_imgBuilding
|
|
|
976 |
Else
|
|
|
977 |
DefineStateSmallIcon = enum_SMALL_imgOK
|
|
|
978 |
End If
|
| 119 |
ghuddy |
979 |
|
| 129 |
ghuddy |
980 |
Case enumPKG_STATE_MAJOR
|
|
|
981 |
DefineStateSmallIcon = enum_SMALL_imgCritical
|
| 119 |
ghuddy |
982 |
|
| 129 |
ghuddy |
983 |
Case enumPKG_STATE_MINOR
|
|
|
984 |
DefineStateSmallIcon = enum_SMALL_imgWarning
|
| 119 |
ghuddy |
985 |
|
| 129 |
ghuddy |
986 |
Case enumPKG_STATE_MAJOR_READY
|
|
|
987 |
DefineStateSmallIcon = enum_SMALL_imgCReady
|
| 119 |
ghuddy |
988 |
|
| 129 |
ghuddy |
989 |
Case enumPKG_STATE_MINOR_READY
|
|
|
990 |
DefineStateSmallIcon = enum_SMALL_imgWReady
|
| 119 |
ghuddy |
991 |
|
| 129 |
ghuddy |
992 |
End Select
|
| 119 |
ghuddy |
993 |
End Function
|
|
|
994 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
995 |
Function PatchIcon ( cIsPatch, cIsPatchObsolete )
|
| 129 |
ghuddy |
996 |
If IsNull(cIsPatch) Then
|
|
|
997 |
PatchIcon = "<img src='images/rex_images/ext_blank.gif' width='16' height='16' border='0' align='absmiddle'>"
|
|
|
998 |
Else
|
|
|
999 |
If IsNull(cIsPatchObsolete) Then
|
|
|
1000 |
PatchIcon = "<img src='images/i_patch_small.gif' width='16' height='16' border='0' align='absmiddle' >"
|
|
|
1001 |
Else
|
|
|
1002 |
PatchIcon = "<img src='images/i_patch_small_obsolete.gif' width='16' height='16' border='0' align='absmiddle' title='Patch is obsolete'>"
|
|
|
1003 |
End If
|
|
|
1004 |
End If
|
| 119 |
ghuddy |
1005 |
End Function
|
|
|
1006 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1007 |
' Function that returns true of false if the item exists in the array
|
|
|
1008 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1009 |
Function inArray(item, aItems)
|
| 129 |
ghuddy |
1010 |
Dim element
|
|
|
1011 |
inArray = false
|
|
|
1012 |
for each element in aItems
|
|
|
1013 |
If element = item Then
|
|
|
1014 |
inArray=true
|
|
|
1015 |
End If
|
|
|
1016 |
next
|
| 119 |
ghuddy |
1017 |
End Function
|
|
|
1018 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1019 |
Function ProgressBar ()
|
| 129 |
ghuddy |
1020 |
ProgressBar = "<DIV name='divProgressBar' id='divProgressBar' style='visibility:hidden;'><img src='icons/i_processing.gif' width='79' height='14'></DIV>"
|
| 119 |
ghuddy |
1021 |
End Function
|
|
|
1022 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1023 |
Function GetCurrentParameters( nProjId, nRtagId, nPvId )
|
| 129 |
ghuddy |
1024 |
Dim rsQry,query
|
| 119 |
ghuddy |
1025 |
|
| 129 |
ghuddy |
1026 |
' Set defaults
|
|
|
1027 |
nProjId = -1
|
|
|
1028 |
nRtagId = -1
|
|
|
1029 |
nPvId = -1
|
| 119 |
ghuddy |
1030 |
|
|
|
1031 |
|
| 129 |
ghuddy |
1032 |
' Get parameters from database
|
|
|
1033 |
OraDatabase.Parameters.Add "ProjId", Request("proj_id"), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
1034 |
OraDatabase.Parameters.Add "Rtag_id", Request("rtag_id"), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
1035 |
OraDatabase.Parameters.Add "results", NULL, ORAPARM_OUTPUT, ORATYPE_CURSOR
|
| 119 |
ghuddy |
1036 |
|
| 129 |
ghuddy |
1037 |
OraDatabase.ExecuteSQL " BEGIN PK_APP_UTILS.GET_CURRENT_PARAMETERS ( :ProjId, :Rtag_id, :results ); END;"
|
| 119 |
ghuddy |
1038 |
|
| 129 |
ghuddy |
1039 |
Set rsQry = OraDatabase.Parameters("results").Value
|
| 119 |
ghuddy |
1040 |
|
| 129 |
ghuddy |
1041 |
OraDatabase.Parameters.Remove "ProjId"
|
|
|
1042 |
OraDatabase.Parameters.Remove "Rtag_id"
|
|
|
1043 |
OraDatabase.Parameters.Remove "results"
|
| 119 |
ghuddy |
1044 |
|
|
|
1045 |
|
| 129 |
ghuddy |
1046 |
If rsQry.RecordCount > 0 Then
|
| 119 |
ghuddy |
1047 |
|
| 129 |
ghuddy |
1048 |
nProjId = CDbl(rsQry("PROJ_ID"))
|
|
|
1049 |
nRtagId = CDbl(rsQry("RTAG_ID"))
|
| 119 |
ghuddy |
1050 |
|
| 129 |
ghuddy |
1051 |
End If
|
| 119 |
ghuddy |
1052 |
|
| 129 |
ghuddy |
1053 |
rsQry.Close()
|
|
|
1054 |
Set rsQry = nothing
|
| 119 |
ghuddy |
1055 |
|
|
|
1056 |
|
| 129 |
ghuddy |
1057 |
' Set pv_id parameter
|
|
|
1058 |
If Request("pv_id") <> "" Then nPvId = CDbl(Request("pv_id"))
|
| 119 |
ghuddy |
1059 |
|
|
|
1060 |
|
|
|
1061 |
End Function
|
|
|
1062 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1063 |
Function GetEnvName ( nEnvTab )
|
| 129 |
ghuddy |
1064 |
Select Case CInt( nEnvTab )
|
|
|
1065 |
Case enumENVTAB_WORK_IN_PROGRESS
|
|
|
1066 |
GetEnvName = "Work In Progress"
|
| 119 |
ghuddy |
1067 |
|
| 129 |
ghuddy |
1068 |
Case enumENVTAB_PLANNED
|
|
|
1069 |
GetEnvName = "Pending"
|
| 119 |
ghuddy |
1070 |
|
| 129 |
ghuddy |
1071 |
Case enumENVTAB_RELEASED
|
|
|
1072 |
GetEnvName = "Released"
|
| 119 |
ghuddy |
1073 |
|
| 129 |
ghuddy |
1074 |
End Select
|
| 119 |
ghuddy |
1075 |
|
|
|
1076 |
End Function
|
|
|
1077 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1078 |
Function Title (rtagId)
|
|
|
1079 |
|
| 129 |
ghuddy |
1080 |
If rtagId = "" Then
|
|
|
1081 |
Title = "Release Manager"
|
|
|
1082 |
Else
|
|
|
1083 |
Set rsQry = OraDatabase.DbCreateDynaset( "SELECT RT.RTAG_NAME, P.PROJ_NAME FROM PROJECTS P, RELEASE_TAGS RT WHERE RT.PROJ_ID = P.PROJ_ID AND RT.RTAG_ID="& rtagId, ORADYN_DEFAULT )
|
|
|
1084 |
Title = rsQry("proj_name")&">"&rsQry("rtag_name")
|
|
|
1085 |
rsQry.Close()
|
|
|
1086 |
Set rsQry = Nothing
|
|
|
1087 |
End If
|
| 119 |
ghuddy |
1088 |
|
|
|
1089 |
End Function
|
|
|
1090 |
'-------------------------------------------------------------------------------------
|
|
|
1091 |
Function Check_Package_WIP_Already_Exists(NNrtag_id, NNpv_id)
|
| 129 |
ghuddy |
1092 |
Dim Query_String, rsQry
|
| 119 |
ghuddy |
1093 |
|
| 129 |
ghuddy |
1094 |
Query_String = _
|
|
|
1095 |
" SELECT * "&_
|
|
|
1096 |
" FROM planned pl, package_versions pv "&_
|
|
|
1097 |
" WHERE pl.rtag_id = "& NNrtag_id &_
|
|
|
1098 |
" AND pv.pv_id = pl.pv_id "&_
|
|
|
1099 |
" AND pv.dlocked = 'A' "&_
|
|
|
1100 |
" AND pv.pkg_id = (SELECT pkg_id "&_
|
|
|
1101 |
" FROM package_versions "&_
|
|
|
1102 |
" WHERE pv_id = "& NNpv_id &") "&_
|
|
|
1103 |
" AND pv.v_ext = (SELECT v_ext "&_
|
|
|
1104 |
" FROM package_versions "&_
|
|
|
1105 |
" WHERE pv_id = "& NNpv_id &")"
|
| 119 |
ghuddy |
1106 |
|
|
|
1107 |
|
| 129 |
ghuddy |
1108 |
Set rsQry = OraDatabase.DbCreateDynaset( Query_String , cint(0) )
|
| 119 |
ghuddy |
1109 |
|
| 129 |
ghuddy |
1110 |
Check_Package_WIP_Already_Exists = rsQry.RecordCount
|
| 119 |
ghuddy |
1111 |
|
| 129 |
ghuddy |
1112 |
rsQry.Close()
|
|
|
1113 |
Set rsQry = Nothing
|
| 119 |
ghuddy |
1114 |
End Function
|
|
|
1115 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1116 |
Function ValidateCodeReviewURL ( sCodeReviewURL )
|
|
|
1117 |
Dim isValid
|
|
|
1118 |
Dim sTempBaseURL
|
|
|
1119 |
Dim httpRegEx
|
| 129 |
ghuddy |
1120 |
Set httpRegEx = new RegExp
|
| 119 |
ghuddy |
1121 |
|
| 129 |
ghuddy |
1122 |
httpRegEx.Pattern = "^https?:\/\/"
|
| 119 |
ghuddy |
1123 |
|
| 129 |
ghuddy |
1124 |
' Removes ending slash from project's base URL for ease of comparison.
|
|
|
1125 |
sTempBaseURL = Left(baseURL, Len(baseURL)-1)
|
|
|
1126 |
' Removes the project's base URL from the URL specified (if it's present).
|
|
|
1127 |
codeReviewURL = Replace(sCodeReviewURL, sTempBaseURL, "")
|
|
|
1128 |
' Removes the slash from the beginning of the resulting URL (if it's present).
|
|
|
1129 |
If InStr(codeReviewURL, "/") = 1 Then
|
|
|
1130 |
codeReviewURL = Replace(codeReviewURL, "/", "", 1, 1)
|
|
|
1131 |
End If
|
| 119 |
ghuddy |
1132 |
|
| 129 |
ghuddy |
1133 |
' If the URL doesn't contain the http:// prefix, assume that it's correct.
|
|
|
1134 |
If NOT httpRegEx.Test(codeReviewURL) AND Len(codeReviewURL) > 0 Then
|
|
|
1135 |
isValid = True
|
|
|
1136 |
Else
|
|
|
1137 |
' If the URL still contains the http:// prefix and is longer than the base
|
|
|
1138 |
' URL, assume that it is an invalid URL because of a differing base URL.
|
|
|
1139 |
If Len(sCodeReviewURL) > Len(baseURL) Then
|
|
|
1140 |
Response.Write("<script type='text/javascript'>alert('Incorrect Base URL\n\nMust start with project\'s base url (" & baseURL &") if full URL specified.')</script>")
|
|
|
1141 |
Else
|
|
|
1142 |
' If the URL still contains the http:// prefix and is shorter than the base
|
|
|
1143 |
' URL, assume that it is incomplete.
|
|
|
1144 |
Response.Write("<script type='text/javascript'>alert('Incomplete Code Review URL')</script>")
|
|
|
1145 |
End If
|
|
|
1146 |
' Otherwise, the URL matches the base URL exactly, which is also invalid.
|
|
|
1147 |
codeReviewURL = sCodeReviewURL
|
|
|
1148 |
isValid = False
|
|
|
1149 |
End If
|
|
|
1150 |
ValidateCodeReviewURL = isValid
|
| 119 |
ghuddy |
1151 |
End Function
|
|
|
1152 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
1153 |
Function Is_Page_Editable ( cDlocked )
|
| 129 |
ghuddy |
1154 |
' Editable if ( (unlocked OR rejected)
|
|
|
1155 |
' OR ( NOT released/locked AND EditReleaseNotesInPending allowed)
|
|
|
1156 |
' OR (released/locked AND EditNonCriticalInfoForLockedPackage allowed)
|
|
|
1157 |
' )
|
|
|
1158 |
' AND user logged in
|
|
|
1159 |
If (((cDlocked = "N") OR (cDlocked = "R")) OR ((cDlocked <> "Y") AND (objAccessControl.IsActive("EditReleaseNotesInPending"))) OR ((cDlocked = "Y") AND (objAccessControl.IsActive("EditNonCriticalInfoForLockedPackage")))) AND objAccessControl.UserLogedIn Then
|
|
|
1160 |
Is_Page_Editable = TRUE
|
|
|
1161 |
Else
|
|
|
1162 |
Is_Page_Editable = FALSE
|
|
|
1163 |
End If
|
| 119 |
ghuddy |
1164 |
End Function
|
|
|
1165 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
1166 |
Function Is_Section_Editable ( )
|
| 129 |
ghuddy |
1167 |
If scriptName = "fixed_issues.asp" AND objAccessControl.UserLogedIn Then
|
|
|
1168 |
Is_Section_Editable = TRUE
|
|
|
1169 |
Else
|
|
|
1170 |
Is_Section_Editable = FALSE
|
|
|
1171 |
End If
|
| 119 |
ghuddy |
1172 |
End Function
|
|
|
1173 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
1174 |
Function Is_Critical_Section_Editable ( cDlocked )
|
| 129 |
ghuddy |
1175 |
' Editable if ( (unlocked OR rejected)
|
|
|
1176 |
' OR ( NOT released/locked AND EditReleaseNotesInPending allowed)
|
|
|
1177 |
' OR (released/locked AND EditCriticalInfoForLockedPackage allowed)
|
|
|
1178 |
' )
|
|
|
1179 |
' AND user logged in
|
|
|
1180 |
If (((cDlocked = "N") OR (cDlocked = "R")) OR ((cDlocked <> "Y") AND (objAccessControl.IsActive("EditReleaseNotesInPending"))) OR ((cDlocked = "Y") AND (objAccessControl.IsActive("EditCriticalInfoForLockedPackage")))) AND objAccessControl.UserLogedIn Then
|
|
|
1181 |
Is_Critical_Section_Editable = TRUE
|
|
|
1182 |
Else
|
|
|
1183 |
Is_Critical_Section_Editable = FALSE
|
|
|
1184 |
End If
|
| 119 |
ghuddy |
1185 |
End Function
|
|
|
1186 |
|
|
|
1187 |
'---------------------------------------------------------------
|
|
|
1188 |
' Function: Codestriker_Command
|
|
|
1189 |
'
|
|
|
1190 |
' Purpose: Forms a codestriker differencing command for use when
|
|
|
1191 |
' preparing codestriker reviews. This will be used mainly
|
|
|
1192 |
' on release notes pages.
|
|
|
1193 |
'
|
|
|
1194 |
' Arguments: old_label : The previous or older label
|
|
|
1195 |
' new_label : The current or newer label
|
|
|
1196 |
'
|
|
|
1197 |
Function Codestriker_Command (oldLabel, new_label)
|
|
|
1198 |
|
| 129 |
ghuddy |
1199 |
If ( IsNull(new_label) ) Then
|
|
|
1200 |
Codestriker_Command = "Label not defined"
|
|
|
1201 |
ElseIf (IsNull(oldLabel) OR oldLabel = "" ) Then
|
|
|
1202 |
Codestriker_Command = "jats CCdiff -new=" & new_label
|
|
|
1203 |
Else
|
|
|
1204 |
Codestriker_Command = "jats CCdiff -old=" & oldLabel & " -new=" & new_label
|
|
|
1205 |
End If
|
| 119 |
ghuddy |
1206 |
End Function
|
|
|
1207 |
|
|
|
1208 |
'---------------------------------------------------------------
|
|
|
1209 |
' Function: BeyondCompare_Command
|
|
|
1210 |
'
|
|
|
1211 |
' Purpose: Forms a beyond compare differencing command for use
|
|
|
1212 |
' in visual inspection of code baseline differences.
|
|
|
1213 |
' This will be used mainly on release notes pages.
|
|
|
1214 |
'
|
|
|
1215 |
' Arguments: old_label : The previous or older label
|
|
|
1216 |
' new_label : The current or newer label
|
|
|
1217 |
'
|
|
|
1218 |
Function BeyondCompare_Command (oldLabel, new_label)
|
|
|
1219 |
|
| 129 |
ghuddy |
1220 |
If ( IsNull(new_label) ) Then
|
|
|
1221 |
BeyondCompare_Command = "Label not defined"
|
|
|
1222 |
ElseIf (IsNull(oldLabel) OR oldLabel = "" ) Then
|
|
|
1223 |
BeyondCompare_Command = "No prior label to compare with"
|
|
|
1224 |
Else
|
|
|
1225 |
BeyondCompare_Command = "jats CCbc2 -old=" & oldLabel & " -new=" & new_label
|
|
|
1226 |
End If
|
| 119 |
ghuddy |
1227 |
End Function
|
|
|
1228 |
|
|
|
1229 |
'---------------------------------------------------------------
|
|
|
1230 |
' Function: getLastNonRippleVersionPVID
|
|
|
1231 |
'
|
|
|
1232 |
' Purpose: returns the last non-ripple version of the package
|
|
|
1233 |
'
|
|
|
1234 |
' Arguments: this_pv_id : string
|
|
|
1235 |
'
|
|
|
1236 |
' Notes: In the past, users used to manually perform ripple builds.
|
|
|
1237 |
' This function does not detect those as ripples. It could be
|
|
|
1238 |
' made to do so but it would not be reliable. For example, it
|
|
|
1239 |
' could check to see if the word "ripple" appears in the
|
|
|
1240 |
' comments field of the record set of the SWL query. That
|
|
|
1241 |
' might catch some of those records, but assumes the user
|
|
|
1242 |
' wrote the wor ripple into the comments (reason for version).
|
|
|
1243 |
'
|
|
|
1244 |
Function getLastNonRippleVersionPVID( this_pv_id )
|
| 129 |
ghuddy |
1245 |
Dim queryResult
|
|
|
1246 |
Dim queryString
|
|
|
1247 |
Dim finalPVID
|
|
|
1248 |
Dim lastPVID
|
| 119 |
ghuddy |
1249 |
|
| 129 |
ghuddy |
1250 |
' default return value in case we never get into the loop
|
|
|
1251 |
finalPVID = this_pv_id
|
| 119 |
ghuddy |
1252 |
|
| 129 |
ghuddy |
1253 |
' Get record for this PVID
|
|
|
1254 |
queryString = "SELECT * FROM package_versions WHERE pv_id = " & this_pv_id
|
| 119 |
ghuddy |
1255 |
|
| 129 |
ghuddy |
1256 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
| 119 |
ghuddy |
1257 |
|
| 129 |
ghuddy |
1258 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
| 119 |
ghuddy |
1259 |
|
| 129 |
ghuddy |
1260 |
' If this version is a ripple built version, begin the process of finding its ancestral non-ripple built version
|
|
|
1261 |
If (queryResult("build_type") = "Y") Then
|
| 119 |
ghuddy |
1262 |
|
| 129 |
ghuddy |
1263 |
lastPVID = queryResult("last_pv_id")
|
| 119 |
ghuddy |
1264 |
|
| 129 |
ghuddy |
1265 |
' We know we have some ripple built versions now, so arm the finalPVID for loop control
|
|
|
1266 |
finalPVID = ""
|
| 119 |
ghuddy |
1267 |
|
| 129 |
ghuddy |
1268 |
' Work back through the version history until we hit a record that is not a ripple build version
|
|
|
1269 |
Do While ((NOT queryResult.BOF) AND (NOT queryResult.EOF) AND (NOT IsNull(lastPVID)) AND (finalPVID = ""))
|
| 119 |
ghuddy |
1270 |
|
| 129 |
ghuddy |
1271 |
queryString = "SELECT * FROM package_versions WHERE pv_id = " & lastPVID
|
| 119 |
ghuddy |
1272 |
|
| 129 |
ghuddy |
1273 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
| 119 |
ghuddy |
1274 |
|
| 129 |
ghuddy |
1275 |
' if the package version is a ripple built one, go round the loop again, else trigger a loop exit
|
|
|
1276 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF) AND ( queryResult("build_type") = "Y")) Then
|
|
|
1277 |
lastPVID = queryResult("last_pv_id")
|
|
|
1278 |
Else
|
|
|
1279 |
finalPVID = lastPVID
|
|
|
1280 |
End If
|
|
|
1281 |
Loop
|
|
|
1282 |
End If
|
|
|
1283 |
End If
|
| 119 |
ghuddy |
1284 |
|
| 129 |
ghuddy |
1285 |
queryResult.Close()
|
|
|
1286 |
Set queryResult = nothing
|
| 119 |
ghuddy |
1287 |
|
| 129 |
ghuddy |
1288 |
getLastNonRippleVersionPVID = finalPVID
|
| 119 |
ghuddy |
1289 |
End Function
|
|
|
1290 |
|
|
|
1291 |
'---------------------------------------------------------------
|
|
|
1292 |
' Function: getPreviousVersionPVID
|
|
|
1293 |
'
|
|
|
1294 |
' Purpose: returns the immediate predecssor version of the given
|
|
|
1295 |
' package version
|
|
|
1296 |
'
|
|
|
1297 |
' Arguments: this_pv_id : string
|
|
|
1298 |
'
|
|
|
1299 |
' Notes:
|
|
|
1300 |
'
|
|
|
1301 |
Function getPreviousVersionPVID( this_pv_id )
|
| 129 |
ghuddy |
1302 |
Dim queryResult
|
|
|
1303 |
Dim queryString
|
| 119 |
ghuddy |
1304 |
|
| 129 |
ghuddy |
1305 |
getPreviousVersionPVID = ""
|
| 119 |
ghuddy |
1306 |
|
| 129 |
ghuddy |
1307 |
queryString = "SELECT * FROM package_versions WHERE pv_id = " & this_pv_id
|
| 119 |
ghuddy |
1308 |
|
| 129 |
ghuddy |
1309 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
| 119 |
ghuddy |
1310 |
|
| 129 |
ghuddy |
1311 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1312 |
getPreviousVersionPVID = queryResult("last_pv_id")
|
|
|
1313 |
End If
|
| 119 |
ghuddy |
1314 |
|
| 129 |
ghuddy |
1315 |
queryResult.Close()
|
|
|
1316 |
Set queryResult = nothing
|
| 119 |
ghuddy |
1317 |
|
|
|
1318 |
End Function
|
|
|
1319 |
|
|
|
1320 |
'---------------------------------------------------------------
|
| 129 |
ghuddy |
1321 |
' Function: getLastSignificantPVID
|
|
|
1322 |
'
|
|
|
1323 |
' Purpose: Returns the last significant (man-made) version (PV_ID) that
|
|
|
1324 |
' is a predecessor to the specified pv_id
|
|
|
1325 |
'
|
|
|
1326 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1327 |
' last_pv_id : Uniquely identifies the predecssor of this package version
|
|
|
1328 |
' Notes:
|
|
|
1329 |
'
|
|
|
1330 |
Function getLastSignificantPVID (pv_id, last_pv_id)
|
|
|
1331 |
|
|
|
1332 |
getLastSignificantPVID = ""
|
|
|
1333 |
|
|
|
1334 |
If( (NOT IsNull(last_pv_id)) AND (last_pv_id <> pv_id) ) Then
|
|
|
1335 |
|
|
|
1336 |
' Get the pv_id for the current version, and if necessary, work back through any ripple versions as necessary
|
|
|
1337 |
' to get a non-ripple version ancestor
|
|
|
1338 |
pv_id = getLastNonRippleVersionPVID( pv_id )
|
|
|
1339 |
If (pv_id <> "") Then
|
|
|
1340 |
' get the pv_id of the previous version to the non-ripple version ancestor we just found.
|
|
|
1341 |
' It does not matter if we get a ripple version here. It is good enough to serve the purpose of version diff'ing
|
|
|
1342 |
pv_id = getPreviousVersionPVID( pv_id )
|
|
|
1343 |
If (pv_id <> "") Then
|
|
|
1344 |
getLastSignificantPVID = pv_id
|
|
|
1345 |
End If
|
|
|
1346 |
End If
|
|
|
1347 |
|
|
|
1348 |
End If
|
|
|
1349 |
|
|
|
1350 |
End Function
|
|
|
1351 |
'---------------------------------------------------------------
|
|
|
1352 |
' Function: get_Pkg_Label
|
|
|
1353 |
'
|
|
|
1354 |
' Purpose: Returns the package label for the specified pv_id
|
|
|
1355 |
'
|
|
|
1356 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1357 |
'
|
|
|
1358 |
Function get_Pkg_Label (pv_id)
|
|
|
1359 |
Dim queryResult
|
|
|
1360 |
Dim queryString
|
|
|
1361 |
|
|
|
1362 |
get_Pkg_Label = ""
|
|
|
1363 |
|
|
|
1364 |
' Get the package label from the package versions table
|
|
|
1365 |
queryString = "SELECT pkg_label FROM package_versions WHERE pv_id = " & pv_id
|
|
|
1366 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
|
|
1367 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1368 |
get_Pkg_Label = queryResult("pkg_label")
|
|
|
1369 |
End If
|
|
|
1370 |
queryResult.Close()
|
|
|
1371 |
Set queryResult = nothing
|
|
|
1372 |
End Function
|
|
|
1373 |
'---------------------------------------------------------------
|
|
|
1374 |
' Function: get_Src_Path
|
|
|
1375 |
'
|
|
|
1376 |
' Purpose: Returns the source path for the specified pv_id
|
|
|
1377 |
'
|
|
|
1378 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1379 |
'
|
|
|
1380 |
Function get_Src_Path (pv_id)
|
|
|
1381 |
Dim queryResult
|
|
|
1382 |
Dim queryString
|
|
|
1383 |
|
|
|
1384 |
get_Src_Path = ""
|
|
|
1385 |
|
|
|
1386 |
' Get the source path from package versions table
|
|
|
1387 |
queryString = "SELECT src_path FROM package_versions WHERE pv_id = " & pv_id
|
|
|
1388 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
|
|
1389 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1390 |
get_Src_Path = queryResult("src_path")
|
|
|
1391 |
End If
|
|
|
1392 |
queryResult.Close()
|
|
|
1393 |
Set queryResult = nothing
|
|
|
1394 |
End Function
|
|
|
1395 |
|
|
|
1396 |
'---------------------------------------------------------------
|
| 119 |
ghuddy |
1397 |
' Function: getOldLabel
|
|
|
1398 |
'
|
|
|
1399 |
' Purpose: Returns the previous label; if none then returns empty string
|
|
|
1400 |
'
|
|
|
1401 |
' Since this operation is designed to fulfil the generation of
|
|
|
1402 |
' diff commands, there is no point in considering ripple
|
|
|
1403 |
' versions, since the only differences we find there are in
|
|
|
1404 |
' the build.pl files (for example). So, this function uses
|
|
|
1405 |
' some underlying methods that ignore ripple built versions
|
|
|
1406 |
' therefore concentrating on versions that someone has manually
|
|
|
1407 |
' gone and labelled, presumably because they changed some
|
|
|
1408 |
' source file other than build.pl.
|
|
|
1409 |
'
|
|
|
1410 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1411 |
' last_pv_id : Uniquely identifies the predecssor of this package version
|
|
|
1412 |
' Notes:
|
|
|
1413 |
'
|
|
|
1414 |
Function getOldLabel (pv_id, last_pv_id)
|
| 129 |
ghuddy |
1415 |
Dim lastSignificantPVID
|
| 119 |
ghuddy |
1416 |
|
| 129 |
ghuddy |
1417 |
getOldLabel = ""
|
| 119 |
ghuddy |
1418 |
|
| 129 |
ghuddy |
1419 |
lastSignificantPVID = getLastSignificantPVID(pv_id, last_pv_id)
|
|
|
1420 |
If (lastSignificantPVID <> "") Then
|
|
|
1421 |
getOldLabel = get_Pkg_Label(lastSignificantPVID)
|
|
|
1422 |
End If
|
|
|
1423 |
End Function
|
|
|
1424 |
'---------------------------------------------------------------
|
|
|
1425 |
' Function: getOldSrcPath
|
|
|
1426 |
'
|
|
|
1427 |
' Purpose: Returns the previous src path; if none then returns empty string
|
|
|
1428 |
'
|
|
|
1429 |
' Since this operation is designed to fulfil the generation of
|
|
|
1430 |
' diff commands, there is no point in considering ripple
|
|
|
1431 |
' versions, since the only differences we find there are in
|
|
|
1432 |
' the build.pl files (for example). So, this function uses
|
|
|
1433 |
' some underlying methods that ignore ripple built versions
|
|
|
1434 |
' therefore concentrating on versions that someone has manually
|
|
|
1435 |
' gone and labelled, presumably because they changed some
|
|
|
1436 |
' source file other than build.pl.
|
|
|
1437 |
'
|
|
|
1438 |
' NOTE: With SubVersion, the src_path column in the package_versions
|
|
|
1439 |
' table will be used to hold the Subversion tag. This function
|
|
|
1440 |
' will therefore be used mostly when a package version is
|
|
|
1441 |
' controlled under subversion.
|
|
|
1442 |
'
|
|
|
1443 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1444 |
' last_pv_id : Uniquely identifies the predecssor of this package version
|
|
|
1445 |
' Notes:
|
|
|
1446 |
'
|
|
|
1447 |
Function getOldSrcPath (pv_id, last_pv_id)
|
|
|
1448 |
Dim lastSignificantPVID
|
| 119 |
ghuddy |
1449 |
|
| 129 |
ghuddy |
1450 |
getOldSrcPath = ""
|
| 119 |
ghuddy |
1451 |
|
| 129 |
ghuddy |
1452 |
lastSignificantPVID = getLastSignificantPVID(pv_id, last_pv_id)
|
|
|
1453 |
If (lastSignificantPVID <> "") Then
|
|
|
1454 |
getOldSrcPath = get_Src_Path(lastSignificantPVID)
|
|
|
1455 |
End If
|
|
|
1456 |
End Function
|
|
|
1457 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1458 |
Sub vcs_info_from_vcs_tag( nVcs_tag, ByRef objDetails )
|
|
|
1459 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
1460 |
|
| 129 |
ghuddy |
1461 |
Query_String = " SELECT * FROM vcs_type WHERE tag = '"& nVcs_tag &"'"
|
|
|
1462 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1463 |
If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
|
|
|
1464 |
objDetails.Item("vcs_type_id") = rsTemp("vcs_type_id")
|
|
|
1465 |
objDetails.Item("vcs_name") = rsTemp("name")
|
|
|
1466 |
objDetails.Item("vcs_tag") = rsTemp("tag")
|
|
|
1467 |
Else
|
|
|
1468 |
Call RaiseErr(enum_MSG_ERROR, "Database does not contain a record of the VCS tag : " & nVcs_tag )
|
|
|
1469 |
End If
|
|
|
1470 |
rsTemp.Close()
|
|
|
1471 |
set rsTemp = nothing
|
|
|
1472 |
End Sub
|
|
|
1473 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1474 |
Sub vcs_info_from_vcs_type_id( nVcs_type_id, ByRef objDetails )
|
|
|
1475 |
Dim rsTemp, Query_String
|
|
|
1476 |
|
|
|
1477 |
If NOT IsNull(nVcs_type_id) Then
|
|
|
1478 |
Query_String = " SELECT * FROM vcs_type WHERE vcs_type_id = "& nVcs_type_id
|
|
|
1479 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1480 |
If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
|
|
|
1481 |
objDetails.Item("vcs_type_id") = rsTemp("vcs_type_id")
|
|
|
1482 |
objDetails.Item("vcs_name") = rsTemp("name")
|
|
|
1483 |
objDetails.Item("vcs_tag") = rsTemp("tag")
|
|
|
1484 |
Else
|
|
|
1485 |
Call RaiseErr(enum_MSG_ERROR, "Database does not contain a record of the VCS type ID : " & nVcs_type_id )
|
|
|
1486 |
End If
|
|
|
1487 |
rsTemp.Close()
|
|
|
1488 |
set rsTemp = nothing
|
|
|
1489 |
Else
|
|
|
1490 |
' default to returning ClearCase info, assuming it exists in the data
|
|
|
1491 |
Call vcs_info_from_vcs_tag( enum_VCS_CLEARCASE_TAG, objDetails )
|
|
|
1492 |
End If
|
|
|
1493 |
End Sub
|
|
|
1494 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1495 |
Sub get_vcs_info_for_package( nPkgLabel, nBuildType, nVcsTypeId, ByRef objDetails )
|
|
|
1496 |
' lots of patch versions exist with N/A as their pkg_label and null as vcs_type_id. These are all uncontrolled
|
|
|
1497 |
' packages published directly into dpkg_archive with no controlled source under clearcase, so we want to treat
|
|
|
1498 |
' them as uncontrolled if possible.
|
|
|
1499 |
If ((nPkgLabel = "N/A") OR IsNull(nPkgLabel)) AND nBuildType = "M" AND IsNull(nVcsTypeId) Then
|
|
|
1500 |
Call vcs_info_from_vcs_tag( enum_VCS_UNCONTROLLED_TAG, objDetails )
|
|
|
1501 |
Else
|
|
|
1502 |
' Otherwise, try and decode the VCS from the package's vcs_type_id entry from the package version table
|
|
|
1503 |
' NOTE: A null vcs_type_id entry will default to ClearCase. That is all we have been using up til now so
|
|
|
1504 |
' it should be safe.
|
|
|
1505 |
Call vcs_info_from_vcs_type_id( nVcsTypeId, objDetails )
|
|
|
1506 |
End If
|
|
|
1507 |
End Sub
|
|
|
1508 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1509 |
Sub get_vcs_info_for_pv_id( nPv_id, ByRef objDetails )
|
|
|
1510 |
Dim rsTemp, Query_String
|
|
|
1511 |
|
|
|
1512 |
Query_String = _
|
|
|
1513 |
" SELECT pv.pkg_label, pv.build_type, pv.vcs_type_id "&_
|
|
|
1514 |
" FROM PACKAGE_VERSIONS pv"&_
|
|
|
1515 |
" WHERE pv.pv_id = "& nPv_id
|
|
|
1516 |
|
|
|
1517 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1518 |
If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
|
|
|
1519 |
Call get_vcs_info_for_package( rsTemp("pkg_label"), rsTemp("build_type"), rsTemp("vcs_type_id"), objDetails )
|
|
|
1520 |
Else
|
|
|
1521 |
Call RaiseMsg(enum_MSG_ERROR, "PV_ID (" & nPv_id & ") Not Found")
|
|
|
1522 |
End If
|
|
|
1523 |
rsTemp.Close()
|
|
|
1524 |
set rsTemp = nothing
|
|
|
1525 |
End Sub
|
|
|
1526 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1527 |
Function get_vcs_tag( nPv_id )
|
|
|
1528 |
Dim tempVcsInfoCollector
|
|
|
1529 |
Set tempVcsInfoCollector = CreateObject("Scripting.Dictionary")
|
|
|
1530 |
|
|
|
1531 |
Call get_vcs_info_for_pv_id( nPv_id, tempVcsInfoCollector )
|
|
|
1532 |
get_vcs_tag = tempVcsInfoCollector.Item("vcs_tag")
|
|
|
1533 |
|
|
|
1534 |
Set tempVcsInfoCollector = nothing
|
| 119 |
ghuddy |
1535 |
End Function
|
| 129 |
ghuddy |
1536 |
'----------------------------------------------------------------------------------------------------------------------
|
| 119 |
ghuddy |
1537 |
|
|
|
1538 |
%>
|