| 119 |
ghuddy |
1 |
<%
|
|
|
2 |
'=====================================================
|
| 129 |
ghuddy |
3 |
' COMMON SUBs Part 1
|
| 119 |
ghuddy |
4 |
'=====================================================
|
| 5098 |
dpurdie |
5 |
Const haveCommonSubs = 1
|
| 119 |
ghuddy |
6 |
%>
|
|
|
7 |
<%
|
|
|
8 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
9 |
Sub CloseWindow
|
|
|
10 |
%>
|
|
|
11 |
<SCRIPT language="JavaScript" type="text/javascript">
|
|
|
12 |
<!--
|
|
|
13 |
self.close();
|
|
|
14 |
//-->
|
|
|
15 |
</SCRIPT>
|
|
|
16 |
<%
|
|
|
17 |
End Sub
|
|
|
18 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
19 |
Sub OpenChildWindow ( SStitle, SSurl, SSH, SSW, BBscroll )
|
| 129 |
ghuddy |
20 |
Dim scrlBar
|
|
|
21 |
If BBscroll Then
|
|
|
22 |
scrlBar = "yes"
|
|
|
23 |
Else
|
|
|
24 |
scrlBar = "no"
|
|
|
25 |
End If
|
| 119 |
ghuddy |
26 |
%>
|
| 129 |
ghuddy |
27 |
<script language="JavaScript" type="text/javascript">
|
|
|
28 |
<!--
|
|
|
29 |
window.open('<%=SSurl%>','<%=SStitle%>','scrollbars=<%=scrlBar%>,resizable=yes,width=<%=SSW%>,height=<%=SSH%>')
|
|
|
30 |
//-->
|
|
|
31 |
</script>
|
| 119 |
ghuddy |
32 |
<%
|
|
|
33 |
End Sub
|
|
|
34 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
35 |
Sub OpenInParentWindow ( SSurl )
|
|
|
36 |
%>
|
| 129 |
ghuddy |
37 |
<script language="JavaScript" type="text/javascript">
|
|
|
38 |
<!--
|
|
|
39 |
window.opener.document.location='<%=SSurl%>';
|
|
|
40 |
//-->
|
|
|
41 |
</script>
|
| 119 |
ghuddy |
42 |
<%
|
|
|
43 |
End Sub
|
|
|
44 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
45 |
Sub OpenInWindow ( SSurl )
|
| 129 |
ghuddy |
46 |
Response.Redirect ( SSurl )
|
| 119 |
ghuddy |
47 |
End Sub
|
|
|
48 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
49 |
Function GetQuery ( sQryName )
|
| 129 |
ghuddy |
50 |
GetQuery = ReadFile( QUERIES_PATH &"\"& sQryName )
|
| 119 |
ghuddy |
51 |
End Function
|
|
|
52 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
53 |
Sub RaiseMsg ( SSerrFile, SSerrDesc )
|
| 129 |
ghuddy |
54 |
' Usage: enumERROR, parval1 &"|"& parval2 &"|"& parval3 ...
|
|
|
55 |
Session( enum_RELMGR_ERRDESCRIPTION ) = SSerrDesc
|
|
|
56 |
Response.Redirect ("messages/"& SSerrFile )
|
| 119 |
ghuddy |
57 |
End Sub
|
|
|
58 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
59 |
Sub RaiseMsgInParent ( SSerrFile, SSerrDesc )
|
| 129 |
ghuddy |
60 |
Session( enum_RELMGR_ERRDESCRIPTION ) = SSerrDesc
|
|
|
61 |
Call OpenInParentWindow ("messages/"& SSerrFile )
|
| 119 |
ghuddy |
62 |
End Sub
|
|
|
63 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
64 |
Function ReadFile( SSpath )
|
| 129 |
ghuddy |
65 |
Dim filesys, rfile
|
|
|
66 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
|
|
67 |
Set rfile = filesys.OpenTextFile( SSpath, 1, false)
|
|
|
68 |
ReadFile = rfile.ReadAll
|
|
|
69 |
rfile.close
|
|
|
70 |
Set filesys = nothing
|
| 119 |
ghuddy |
71 |
End Function
|
|
|
72 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
73 |
Function HighlightSubstring ( SSstr, SSsubstr )
|
| 129 |
ghuddy |
74 |
Dim leftSTR, startPos
|
|
|
75 |
startPos = InStr( 1, SSstr, SSsubstr, 1 )
|
| 119 |
ghuddy |
76 |
|
| 129 |
ghuddy |
77 |
If startPos > 0 Then
|
|
|
78 |
leftSTR = Left ( SSstr, startPos - 1 )
|
|
|
79 |
HighlightSubstring = leftSTR &"<SPAN style='background:#ffff99;'>"& Mid( SSstr, startPos, Len(SSsubstr) ) &"</SPAN>"& Right ( SSstr, Len(SSstr) - Len(leftSTR) - Len(SSsubstr) )
|
|
|
80 |
Else
|
|
|
81 |
' Subtring not found
|
|
|
82 |
HighlightSubstring = SSstr
|
|
|
83 |
End If
|
| 119 |
ghuddy |
84 |
|
|
|
85 |
End Function
|
|
|
86 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
87 |
Sub DeleteFile( SSpath )
|
| 129 |
ghuddy |
88 |
Dim filesys
|
|
|
89 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
|
|
90 |
If filesys.FileExists(SSpath) Then
|
|
|
91 |
filesys.DeleteFile SSpath, TRUE
|
|
|
92 |
End If
|
|
|
93 |
Set filesys = nothing
|
| 119 |
ghuddy |
94 |
End Sub
|
|
|
95 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
96 |
Sub DeleteFolder( SSpath )
|
| 129 |
ghuddy |
97 |
Dim filesys
|
|
|
98 |
Set filesys = CreateObject ("Scripting.FileSystemObject")
|
|
|
99 |
If filesys.FolderExists( SSpath ) Then
|
|
|
100 |
'Set oFolder = filesys.GetFolder( SSpath )
|
|
|
101 |
filesys.DeleteFolder SSpath ,TRUE
|
|
|
102 |
End If
|
| 119 |
ghuddy |
103 |
End Sub
|
|
|
104 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
105 |
Sub Create_Folder ( sCreateIn, sFolderName )
|
| 129 |
ghuddy |
106 |
Dim filesys, currfolder, folcoll, subfol
|
|
|
107 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
|
|
108 |
If filesys.FolderExists( sCreateIn ) Then
|
|
|
109 |
Set currfolder = filesys.GetFolder( sCreateIn )
|
|
|
110 |
Set folcoll = currfolder.SubFolders
|
|
|
111 |
If NOT filesys.FolderExists( sCreateIn &"\"& sFolderName ) Then
|
|
|
112 |
folcoll.Add( sFolderName )
|
|
|
113 |
End If
|
|
|
114 |
End If
|
| 119 |
ghuddy |
115 |
End Sub
|
|
|
116 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
117 |
Function Folder_Is_Empty ( sPath )
|
| 129 |
ghuddy |
118 |
Dim filesys, oFolder
|
|
|
119 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
| 119 |
ghuddy |
120 |
|
| 129 |
ghuddy |
121 |
If filesys.FolderExists( sPath ) Then
|
|
|
122 |
Set oFolder = filesys.GetFolder( sPath )
|
|
|
123 |
If ( oFolder.Files.Count + oFolder.SubFolders.Count ) > 0 Then
|
|
|
124 |
Folder_Is_Empty = FALSE
|
|
|
125 |
Else
|
|
|
126 |
Folder_Is_Empty = TRUE
|
|
|
127 |
End If
|
|
|
128 |
Else
|
|
|
129 |
Folder_Is_Empty = TRUE
|
|
|
130 |
End If
|
| 119 |
ghuddy |
131 |
|
|
|
132 |
End Function
|
|
|
133 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
134 |
Sub Destroy_All_Objects
|
| 129 |
ghuddy |
135 |
On Error Resume Next
|
|
|
136 |
set brokenReadyHash = nothing
|
|
|
137 |
set brokenHash = nothing
|
|
|
138 |
set pkgInfoHash = nothing
|
|
|
139 |
set OraDatabase = nothing
|
|
|
140 |
set OraSession = 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 )
|
| 5207 |
dpurdie |
210 |
GetReleaseInfo NNrtag_id
|
|
|
211 |
GetReleaseMode = releaseInfoHash("official")
|
|
|
212 |
End Function
|
|
|
213 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5251 |
dpurdie |
214 |
' Get basic Release Info on global releaseInfoHash
|
| 5207 |
dpurdie |
215 |
' List of fields may be extended as required (could use *)
|
|
|
216 |
Sub GetReleaseInfo ( NNrtag_id )
|
|
|
217 |
Dim rsTemp, Query_String, item
|
| 129 |
ghuddy |
218 |
If NNrtag_id = "" Then NNrtag_id = "-1"
|
| 119 |
ghuddy |
219 |
|
| 5207 |
dpurdie |
220 |
Set releaseInfoHash = CreateObject("Scripting.Dictionary")
|
| 119 |
ghuddy |
221 |
|
| 5251 |
dpurdie |
222 |
Query_String = " SELECT rt.RTAG_ID ,rt.lxr, rt.official," &_
|
|
|
223 |
" NVL(lx.lxrserver, 'N') as lxrserver" &_
|
|
|
224 |
" FROM Release_tags rt,"&_
|
|
|
225 |
" lxr_state lx"&_
|
|
|
226 |
" WHERE rt.RTAG_ID = lx.RTAG_ID(+)"&_
|
|
|
227 |
" AND rt.RTAG_ID = " & NNrtag_id
|
|
|
228 |
|
| 129 |
ghuddy |
229 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
230 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
| 5207 |
dpurdie |
231 |
For Each item In rsTemp.Fields
|
| 5251 |
dpurdie |
232 |
'Response.Write("<br><pre> item:" & Lcase(item.name) & ":" & item & "</pre>")
|
| 5207 |
dpurdie |
233 |
releaseInfoHash.Add Lcase(item.name), item.value
|
|
|
234 |
Next
|
| 129 |
ghuddy |
235 |
End If
|
| 119 |
ghuddy |
236 |
|
| 129 |
ghuddy |
237 |
rsTemp.Close
|
|
|
238 |
Set rsTemp = nothing
|
| 5207 |
dpurdie |
239 |
End Sub
|
|
|
240 |
|
| 119 |
ghuddy |
241 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5020 |
dpurdie |
242 |
Function Get_Devl_Environment
|
|
|
243 |
If Request.Cookies(COOKIE_RELEASEMANAGER_MEMORY)("devl_environment") <> "" Then
|
|
|
244 |
If Request.Cookies(COOKIE_RELEASEMANAGER_MEMORY)("devl_environment") = "clearcase" Then
|
|
|
245 |
Get_Devl_Environment = "jats" 'clear case does not have import
|
| 129 |
ghuddy |
246 |
Else
|
| 5020 |
dpurdie |
247 |
Get_Devl_Environment = Request.Cookies(COOKIE_RELEASEMANAGER_MEMORY)("devl_environment")
|
| 129 |
ghuddy |
248 |
End If
|
|
|
249 |
Else
|
| 5020 |
dpurdie |
250 |
Get_Devl_Environment = "jats" 'JATS devl enviroment is set by default
|
| 129 |
ghuddy |
251 |
End If
|
| 119 |
ghuddy |
252 |
End Function
|
|
|
253 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
254 |
Function Get_From_DUAL ( SSclm )
|
| 129 |
ghuddy |
255 |
Dim rsTemp, Query_String, OraSession2, OraDatabase2
|
|
|
256 |
Set OraSession2 = CreateObject("OracleInProcServer.XOraSession")
|
|
|
257 |
Set OraDatabase2 = OraSession2.OpenDatabase( TNS_NAME, DB_AUTHENTICATION, Cint(0))
|
| 119 |
ghuddy |
258 |
|
| 129 |
ghuddy |
259 |
Query_String = _
|
|
|
260 |
" SELECT "& SSclm &" AS result FROM DUAL"
|
|
|
261 |
Set rsTemp = OraDatabase2.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
262 |
|
| 129 |
ghuddy |
263 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
264 |
Get_From_DUAL = (rsTemp.Fields("result"))
|
|
|
265 |
End If
|
| 119 |
ghuddy |
266 |
|
| 129 |
ghuddy |
267 |
rsTemp.Close
|
|
|
268 |
Set rsTemp = nothing
|
|
|
269 |
Set OraDatabase2 = nothing
|
|
|
270 |
Set OraSession2 = nothing
|
| 119 |
ghuddy |
271 |
End Function
|
|
|
272 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
273 |
Function Get_Pkg_Base_View ( NNpv_id, NNrtag_id )
|
| 129 |
ghuddy |
274 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
275 |
|
| 129 |
ghuddy |
276 |
If NNrtag_id = "" Then
|
|
|
277 |
Get_Pkg_Base_View = "N/A"
|
|
|
278 |
Exit Function
|
|
|
279 |
End If
|
| 119 |
ghuddy |
280 |
|
| 129 |
ghuddy |
281 |
Query_String = _
|
|
|
282 |
" SELECT vi.view_name"&_
|
|
|
283 |
" FROM release_content rc,"&_
|
|
|
284 |
" views vi"&_
|
|
|
285 |
" WHERE vi.view_id = rc.base_view_id"&_
|
|
|
286 |
" AND rc.rtag_id = "& NNrtag_id &_
|
|
|
287 |
" AND rc.pv_id = "& NNpv_id
|
| 119 |
ghuddy |
288 |
|
| 129 |
ghuddy |
289 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
290 |
|
| 129 |
ghuddy |
291 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
292 |
Get_Pkg_Base_View = UCase(rsTemp.Fields("view_name"))
|
|
|
293 |
Else
|
|
|
294 |
Get_Pkg_Base_View = "N/A"
|
|
|
295 |
End If
|
| 119 |
ghuddy |
296 |
|
| 129 |
ghuddy |
297 |
rsTemp.Close
|
|
|
298 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
299 |
End Function
|
|
|
300 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
301 |
Function Get_Proj_ID ( SSrtag_id )
|
| 129 |
ghuddy |
302 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
303 |
|
| 129 |
ghuddy |
304 |
Query_String = _
|
|
|
305 |
" SELECT projects.proj_id"&_
|
|
|
306 |
" FROM projects projects, release_tags rel"&_
|
|
|
307 |
" WHERE projects.proj_id = rel.proj_id"&_
|
|
|
308 |
" AND rel.rtag_id = "& SSrtag_id
|
| 119 |
ghuddy |
309 |
|
| 129 |
ghuddy |
310 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
311 |
|
| 129 |
ghuddy |
312 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
313 |
Get_Proj_ID = (rsTemp.Fields("proj_id"))
|
|
|
314 |
End If
|
| 119 |
ghuddy |
315 |
|
| 129 |
ghuddy |
316 |
rsTemp.Close
|
|
|
317 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
318 |
End Function
|
|
|
319 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
320 |
Function Get_Proj_Name ( NNproj_id )
|
| 129 |
ghuddy |
321 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
322 |
|
| 159 |
ghuddy |
323 |
Get_Proj_Name = ""
|
|
|
324 |
|
| 129 |
ghuddy |
325 |
Query_String = _
|
|
|
326 |
" SELECT proj_name "&_
|
|
|
327 |
" FROM projects pr "&_
|
| 119 |
ghuddy |
328 |
" WHERE pr.proj_id = "& NNproj_id
|
|
|
329 |
|
| 129 |
ghuddy |
330 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
331 |
|
| 129 |
ghuddy |
332 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
333 |
Get_Proj_Name = (rsTemp.Fields("proj_name"))
|
|
|
334 |
End If
|
| 119 |
ghuddy |
335 |
|
| 129 |
ghuddy |
336 |
rsTemp.Close
|
|
|
337 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
338 |
End Function
|
|
|
339 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 159 |
ghuddy |
340 |
Function Get_Release_Name ( NNrtag_id )
|
|
|
341 |
Dim rsTemp, Query_String
|
|
|
342 |
|
|
|
343 |
Get_Release_Name = ""
|
|
|
344 |
|
|
|
345 |
Query_String = _
|
|
|
346 |
" SELECT rtag_name "&_
|
|
|
347 |
" FROM release_tags rt "&_
|
|
|
348 |
" WHERE rt.rtag_id = "& NNrtag_id
|
|
|
349 |
|
|
|
350 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
351 |
|
|
|
352 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
353 |
Get_Release_Name = (rsTemp.Fields("rtag_name"))
|
|
|
354 |
End If
|
|
|
355 |
|
|
|
356 |
rsTemp.Close
|
|
|
357 |
Set rsTemp = nothing
|
|
|
358 |
End Function
|
|
|
359 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 119 |
ghuddy |
360 |
Function Get_Base_URL ( NNproj_id )
|
| 129 |
ghuddy |
361 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
362 |
|
| 129 |
ghuddy |
363 |
Query_String = _
|
|
|
364 |
" SELECT base_url "&_
|
|
|
365 |
" FROM projects pr "&_
|
| 119 |
ghuddy |
366 |
" WHERE pr.proj_id = "& NNproj_id
|
|
|
367 |
|
| 129 |
ghuddy |
368 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
369 |
|
| 129 |
ghuddy |
370 |
Get_Base_URL = rsTemp("base_url")
|
| 119 |
ghuddy |
371 |
|
| 129 |
ghuddy |
372 |
rsTemp.Close()
|
|
|
373 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
374 |
End Function
|
|
|
375 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
376 |
Function Get_Categories ( NNrtag_id )
|
| 129 |
ghuddy |
377 |
Get_Categories = _
|
|
|
378 |
" SELECT vi.view_id, vi.view_name"&_
|
|
|
379 |
" FROM release_content rel,"&_
|
|
|
380 |
" views vi"&_
|
|
|
381 |
" WHERE rel.base_view_id = vi.view_id"&_
|
|
|
382 |
" AND rtag_id = "& NNrtag_id &_
|
|
|
383 |
" GROUP BY vi.view_id, vi.view_name "&_
|
|
|
384 |
" ORDER BY vi.view_name ASC "
|
| 119 |
ghuddy |
385 |
End Function
|
|
|
386 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
387 |
Function Get_PV_IDs_In_Release ( NNrtag_id )
|
|
|
388 |
Dim rsTemp, Query_String, tempSTR
|
| 129 |
ghuddy |
389 |
tempSTR = "-1"
|
|
|
390 |
Query_String = _
|
|
|
391 |
"SELECT pv_id FROM release_content WHERE rtag_id = "& NNrtag_id
|
| 119 |
ghuddy |
392 |
|
| 129 |
ghuddy |
393 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
394 |
|
| 129 |
ghuddy |
395 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
396 |
tempSTR = tempSTR &","& rsTemp.Fields("pv_id")
|
|
|
397 |
rsTemp.MoveNext
|
|
|
398 |
WEnd
|
|
|
399 |
Get_PV_IDs_In_Release = tempSTR
|
|
|
400 |
rsTemp.Close
|
|
|
401 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
402 |
End Function
|
|
|
403 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
404 |
Sub Get_Pkg_Info ( SSpv_id, NNrtag )
|
| 4687 |
dpurdie |
405 |
Dim rsTemp, Query_String, isaRelease
|
|
|
406 |
isaRelease = NOT ((NNrtag = "") or (IsNull(NNrtag)))
|
|
|
407 |
|
|
|
408 |
OraDatabase.Parameters.Add "PV_ID", SSpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
409 |
OraDatabase.Parameters.Add "RTAG_ID", NNrtag, ORAPARM_INPUT, ORATYPE_NUMBER
|
| 183 |
brianf |
410 |
OraDatabase.Parameters.Add "RETURN_NUMBER", NULL, ORAPARM_OUTPUT, ORATYPE_NUMBER
|
| 119 |
ghuddy |
411 |
|
| 4767 |
dpurdie |
412 |
'-- can_unofficial
|
|
|
413 |
' Limits the ability to unrelease a package version
|
| 129 |
ghuddy |
414 |
pkgInfoHash.Item ("can_unofficial") = "false"
|
| 119 |
ghuddy |
415 |
|
| 4767 |
dpurdie |
416 |
'-- can_edit_in_project
|
|
|
417 |
' Property of the release, the user and the package
|
|
|
418 |
' Limits the ability to add a package to a release
|
|
|
419 |
'
|
|
|
420 |
pkgInfoHash.Item ("can_edit_in_project") = "0"
|
|
|
421 |
|
| 4687 |
dpurdie |
422 |
'-- Get Package Details
|
| 129 |
ghuddy |
423 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PackageDetails.sql"), cint(0))
|
| 119 |
ghuddy |
424 |
|
| 129 |
ghuddy |
425 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
426 |
pkgInfoHash.Add "pv_id", (rsTemp.Fields("pv_id"))
|
|
|
427 |
pkgInfoHash.Add "pkg_id", (rsTemp.Fields("pkg_id"))
|
|
|
428 |
pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
|
|
|
429 |
pkgInfoHash.Add "pkg_version", (rsTemp.Fields("pkg_version"))
|
|
|
430 |
pkgInfoHash.Add "v_ext", (rsTemp.Fields("v_ext"))
|
|
|
431 |
pkgInfoHash.Add "comments", (rsTemp.Fields("comments"))
|
| 119 |
ghuddy |
432 |
|
| 129 |
ghuddy |
433 |
pkgInfoHash.Add "modified_stamp", (rsTemp.Fields("modified_stamp"))
|
|
|
434 |
pkgInfoHash.Add "modifier", (rsTemp.Fields("modifier"))
|
|
|
435 |
pkgInfoHash.Add "modifier_id", (rsTemp.Fields("modifier_id"))
|
|
|
436 |
pkgInfoHash.Add "modifier_email", (rsTemp.Fields("modifier_email"))
|
| 119 |
ghuddy |
437 |
|
| 129 |
ghuddy |
438 |
pkgInfoHash.Add "created_stamp", (rsTemp.Fields("created_stamp"))
|
|
|
439 |
pkgInfoHash.Add "creator", (rsTemp.Fields("creator"))
|
|
|
440 |
pkgInfoHash.Add "creator_email", (rsTemp.Fields("creator_email"))
|
| 119 |
ghuddy |
441 |
|
| 129 |
ghuddy |
442 |
pkgInfoHash.Add "owner", (rsTemp.Fields("owner"))
|
|
|
443 |
pkgInfoHash.Add "owner_email", (rsTemp.Fields("owner_email"))
|
| 119 |
ghuddy |
444 |
|
| 129 |
ghuddy |
445 |
pkgInfoHash.Add "dlocked", (rsTemp.Fields("dlocked"))
|
| 4687 |
dpurdie |
446 |
|
| 129 |
ghuddy |
447 |
pkgInfoHash.Add "pkg_label", (rsTemp.Fields("pkg_label"))
|
|
|
448 |
pkgInfoHash.Add "src_path", (rsTemp.Fields("src_path"))
|
|
|
449 |
pkgInfoHash.Add "pv_description", (rsTemp.Fields("pv_description"))
|
|
|
450 |
pkgInfoHash.Add "last_pv_id", (rsTemp.Fields("last_pv_id"))
|
|
|
451 |
pkgInfoHash.Add "previous_version", (rsTemp.Fields("previous_version"))
|
|
|
452 |
pkgInfoHash.Add "release_notes_info", (rsTemp.Fields("release_notes_info"))
|
| 119 |
ghuddy |
453 |
|
| 129 |
ghuddy |
454 |
pkgInfoHash.Add "is_patch", (rsTemp.Fields("is_patch"))
|
|
|
455 |
pkgInfoHash.Add "is_obsolete", (rsTemp.Fields("is_obsolete"))
|
|
|
456 |
pkgInfoHash.Add "obsolete_comments", (rsTemp.Fields("obsolete_comments"))
|
| 119 |
ghuddy |
457 |
|
| 129 |
ghuddy |
458 |
pkgInfoHash.Add "build_type", (rsTemp.Fields("build_type"))
|
|
|
459 |
pkgInfoHash.Add "change_type", (rsTemp.Fields("change_type"))
|
|
|
460 |
pkgInfoHash.Add "bs_id", (rsTemp.Fields("bs_id"))
|
|
|
461 |
pkgInfoHash.Add "is_deployable", (rsTemp.Fields("is_deployable"))
|
|
|
462 |
pkgInfoHash.Add "sbom_priority", (rsTemp.Fields("sbom_priority"))
|
|
|
463 |
pkgInfoHash.Add "ripple_field", (rsTemp.Fields("ripple_field"))
|
|
|
464 |
End If
|
| 119 |
ghuddy |
465 |
|
| 4687 |
dpurdie |
466 |
If isaRelease Then
|
|
|
467 |
'-- Find if package is editable in this project
|
| 4767 |
dpurdie |
468 |
' Not editable if
|
|
|
469 |
' Imported via a Reference Package
|
| 5080 |
dpurdie |
470 |
' Imported via an SDK
|
| 4767 |
dpurdie |
471 |
' Release is not in Open or Restricted Mode
|
|
|
472 |
' Project extenstion is project specific - and not within the allowed project
|
|
|
473 |
'
|
| 4687 |
dpurdie |
474 |
OraDatabase.ExecuteSQL "BEGIN :RETURN_NUMBER := CAN_EDIT_PKG_IN_PROJECT( :PV_ID, :RTAG_ID ); END;"
|
| 4767 |
dpurdie |
475 |
pkgInfoHash.Item ("can_edit_in_project") = CStr( OraDatabase.Parameters("RETURN_NUMBER").Value )
|
| 119 |
ghuddy |
476 |
|
| 4687 |
dpurdie |
477 |
'-- Get Package Release Details
|
|
|
478 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PackageReleaseDetails.sql"), cint(0))
|
| 119 |
ghuddy |
479 |
|
| 4687 |
dpurdie |
480 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
481 |
pkgInfoHash.Add "insert_stamp", (rsTemp.Fields("insert_stamp"))
|
|
|
482 |
pkgInfoHash.Add "insertor", (rsTemp.Fields("insertor"))
|
|
|
483 |
pkgInfoHash.Add "insertor_email", (rsTemp.Fields("insertor_email"))
|
|
|
484 |
pkgInfoHash.Add "used_count", (rsTemp.Fields("used_count"))
|
| 119 |
ghuddy |
485 |
|
| 4687 |
dpurdie |
486 |
pkgInfoHash.Item ("base_view_id") = (rsTemp.Fields("base_view_id"))
|
|
|
487 |
pkgInfoHash.Item ("pkg_state") = (rsTemp.Fields("pkg_state"))
|
|
|
488 |
pkgInfoHash.Item ("deprecated_state") = (rsTemp.Fields("deprecated_state"))
|
|
|
489 |
pkgInfoHash.Item ("product_state") = (rsTemp.Fields("product_state"))
|
| 119 |
ghuddy |
490 |
|
| 4687 |
dpurdie |
491 |
pkgInfoHash.Add "proj_id", (rsTemp.Fields("proj_id"))
|
|
|
492 |
pkgInfoHash.Add "rtag_id", (rsTemp.Fields("rtag_id"))
|
|
|
493 |
pkgInfoHash.Add "rtag_name", (rsTemp.Fields("rtag_name"))
|
|
|
494 |
pkgInfoHash.Add "product_state_used", (rsTemp.Fields("product_state_used"))
|
| 5080 |
dpurdie |
495 |
pkgInfoHash.Add "sdktag_id", (rsTemp.Fields("sdktag_id"))
|
|
|
496 |
pkgInfoHash.Add "is_sdkpkg", (NOT IsNull(rsTemp.Fields("sdktag_id")))
|
| 5098 |
dpurdie |
497 |
pkgInfoHash.Add "is_pegged", (rsTemp.Fields("pegged") <> 0)
|
| 5080 |
dpurdie |
498 |
|
| 4764 |
dpurdie |
499 |
Else
|
| 4767 |
dpurdie |
500 |
' -- Package Version is not a member of the specified release
|
|
|
501 |
' Get Basic Release and Project Details
|
|
|
502 |
Query_String = " select pj.PROJ_ID, rt.RTAG_ID,rt.rtag_name " &_
|
|
|
503 |
" from projects pj, release_tags rt" &_
|
|
|
504 |
" where rt.rtag_id=:RTAG_ID" &_
|
|
|
505 |
" and rt.PROJ_ID = pj.PROJ_ID"
|
|
|
506 |
|
|
|
507 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
508 |
|
|
|
509 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
510 |
pkgInfoHash.Add "proj_id", (rsTemp.Fields("proj_id"))
|
|
|
511 |
pkgInfoHash.Add "rtag_id", (rsTemp.Fields("rtag_id"))
|
|
|
512 |
pkgInfoHash.Add "rtag_name", (rsTemp.Fields("rtag_name"))
|
|
|
513 |
End If
|
| 4764 |
dpurdie |
514 |
|
| 4767 |
dpurdie |
515 |
' -- Determine if package is a member of this release
|
|
|
516 |
' Mark as Not in Release
|
|
|
517 |
Query_String = "select pv_id from work_in_progress where rtag_id=:RTAG_ID and pv_id=:PV_ID" &_
|
|
|
518 |
" union" &_
|
|
|
519 |
" select pv_id from planned where rtag_id=:RTAG_ID and pv_id=:PV_ID" &_
|
|
|
520 |
" union" &_
|
|
|
521 |
" select pv_id from RELEASE_CONTENT where rtag_id=:RTAG_ID and pv_id=:PV_ID"
|
|
|
522 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
523 |
If rsTemp.RecordCount < 1 Then
|
|
|
524 |
pkgInfoHash.Item ("notInRelease") = true
|
|
|
525 |
End If
|
| 4764 |
dpurdie |
526 |
|
| 4687 |
dpurdie |
527 |
End If
|
| 119 |
ghuddy |
528 |
|
| 4767 |
dpurdie |
529 |
If (pkgInfoHash.Item ("dlocked") = "Y") _
|
| 129 |
ghuddy |
530 |
AND (pkgInfoHash.Item ("build_type") = "M") _
|
|
|
531 |
AND (CDate( FormatDateTime(pkgInfoHash.Item ("modified_stamp"), 2) ) = Date) _
|
|
|
532 |
AND (pkgInfoHash.Item("can_edit_in_project") = "1" ) _
|
|
|
533 |
Then
|
|
|
534 |
pkgInfoHash.Item ("can_unofficial") = "true"
|
|
|
535 |
End If
|
| 119 |
ghuddy |
536 |
|
| 129 |
ghuddy |
537 |
Else
|
| 119 |
ghuddy |
538 |
|
| 129 |
ghuddy |
539 |
If (CDate( FormatDateTime(pkgInfoHash.Item ("modified_stamp"), 2) ) = Date) Then
|
|
|
540 |
' Must be not older then a day
|
|
|
541 |
If (pkgInfoHash.Item ("dlocked") = "A") OR NOT IsNull(pkgInfoHash.Item("is_patch")) Then
|
|
|
542 |
pkgInfoHash.Item ("can_unofficial") = "true"
|
|
|
543 |
End If
|
|
|
544 |
End If
|
| 119 |
ghuddy |
545 |
|
| 129 |
ghuddy |
546 |
End If
|
| 119 |
ghuddy |
547 |
|
| 4687 |
dpurdie |
548 |
'-- Get Patch Parent
|
| 129 |
ghuddy |
549 |
If pkgInfoHash.Item ("is_patch") = "Y" Then
|
|
|
550 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PatchParent.sql"), cint(0))
|
| 119 |
ghuddy |
551 |
|
| 129 |
ghuddy |
552 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
553 |
pkgInfoHash.Add "patch_parent_id", (rsTemp.Fields("pv_id"))
|
|
|
554 |
End If
|
|
|
555 |
End If
|
| 119 |
ghuddy |
556 |
|
| 129 |
ghuddy |
557 |
' DEVI-45275 - Check if version is in the planned table and if so get its planned operation type
|
|
|
558 |
' which denotes whether it is an existing version being added to a release, an existing version
|
|
|
559 |
' being removed from a release, or a new version being prepared for a release.
|
|
|
560 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PlannedPackageVersionDetails.sql"), cint(0))
|
| 119 |
ghuddy |
561 |
|
| 129 |
ghuddy |
562 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
563 |
pkgInfoHash.Add "planned_operation", (rsTemp.Fields("operation"))
|
|
|
564 |
Else
|
|
|
565 |
pkgInfoHash.Add "planned_operation", " "
|
|
|
566 |
End If
|
| 119 |
ghuddy |
567 |
|
| 129 |
ghuddy |
568 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
569 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
570 |
OraDatabase.Parameters.Remove "RETURN_NUMBER"
|
| 119 |
ghuddy |
571 |
|
|
|
572 |
|
| 1376 |
dpurdie |
573 |
On Error Resume Next
|
| 183 |
brianf |
574 |
' check if package is released
|
| 185 |
brianf |
575 |
If (NNrtag = "") or (IsNull(NNrtag)) Then
|
| 183 |
brianf |
576 |
pkgInfoHash.Add "is_released", False
|
|
|
577 |
Else
|
|
|
578 |
Set rsTemp = OraDatabase.DbCreateDynaset( "SELECT rc.pv_id FROM release_content rc WHERE rc.rtag_id = " & NNrtag & " AND rc.pv_id = " & SSpv_id, cint(0))
|
|
|
579 |
pkgInfoHash.Add "is_released", rsTemp.RecordCount <> 0
|
|
|
580 |
End If
|
|
|
581 |
|
|
|
582 |
pkgInfoHash.Add "is_excluded", False
|
|
|
583 |
pkgInfoHash.Add "has_build_failure", False
|
| 4687 |
dpurdie |
584 |
|
| 183 |
brianf |
585 |
' check if package is excluded from build
|
| 185 |
brianf |
586 |
If Not ((NNrtag = "") or (IsNull(NNrtag))) Then
|
| 183 |
brianf |
587 |
Set rsTemp = OraDatabase.DbCreateDynaset( "SELECT dnr.pv_id,dnr.root_file FROM do_not_ripple dnr WHERE dnr.rtag_id = " & NNrtag & " AND dnr.pv_id = " & SSpv_id, cint(0))
|
|
|
588 |
If rsTemp.RecordCount <> 0 Then
|
|
|
589 |
pkgInfoHash("is_excluded") = True
|
|
|
590 |
pkgInfoHash("has_build_failure") = Not IsNull(rsTemp("root_file"))
|
|
|
591 |
End If
|
|
|
592 |
End If
|
|
|
593 |
|
| 129 |
ghuddy |
594 |
rsTemp.Close
|
|
|
595 |
Set rsTemp = nothing
|
| 183 |
brianf |
596 |
|
| 119 |
ghuddy |
597 |
End Sub
|
|
|
598 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 4703 |
dpurdie |
599 |
' Get Package Info - when we don't have a package
|
|
|
600 |
Sub Get_NoPkg_Info(NNrtag)
|
|
|
601 |
Dim rsTemp, Query_String
|
|
|
602 |
OraDatabase.Parameters.Add "RTAG_ID", NNrtag, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
603 |
|
|
|
604 |
pkgInfoHash.Item ("can_unofficial") = "false"
|
|
|
605 |
pkgInfoHash.Item ("noPackage") = true
|
|
|
606 |
|
|
|
607 |
'/* Get Basic Details */
|
|
|
608 |
Query_String = " select pj.PROJ_ID, rt.RTAG_ID,rt.rtag_name " &_
|
|
|
609 |
" from projects pj, release_tags rt" &_
|
|
|
610 |
" where rt.rtag_id=:RTAG_ID" &_
|
|
|
611 |
" and rt.PROJ_ID = pj.PROJ_ID"
|
|
|
612 |
|
|
|
613 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
614 |
|
|
|
615 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
616 |
pkgInfoHash.Add "proj_id", (rsTemp.Fields("proj_id"))
|
|
|
617 |
pkgInfoHash.Add "rtag_id", (rsTemp.Fields("rtag_id"))
|
|
|
618 |
pkgInfoHash.Add "rtag_name", (rsTemp.Fields("rtag_name"))
|
|
|
619 |
End If
|
|
|
620 |
|
|
|
621 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
622 |
End Sub
|
|
|
623 |
|
|
|
624 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 119 |
ghuddy |
625 |
Sub Get_Pkg_Short_Info( SSparPv_id, SSpkgID, SSpkgName, SSpkgVersion, SSsrc_path, SSpkgDesc, BBdlocked )
|
| 129 |
ghuddy |
626 |
Dim rsTemp, Query_String
|
|
|
627 |
If IsEmpty(SSparPv_id) Then Exit Sub
|
| 119 |
ghuddy |
628 |
|
| 129 |
ghuddy |
629 |
Query_String = _
|
|
|
630 |
" SELECT pkg.pkg_id, pkg.pkg_name, pv.pkg_version, pv.src_path, pv.pv_description, pv.dlocked"&_
|
|
|
631 |
" FROM packages pkg, package_versions pv"&_
|
|
|
632 |
" WHERE pkg.pkg_id = pv.pkg_id AND pv.pv_id ="& SSparPv_id
|
| 119 |
ghuddy |
633 |
|
| 129 |
ghuddy |
634 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
635 |
|
| 129 |
ghuddy |
636 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
637 |
SSpkgID = rsTemp.Fields("pkg_id")
|
|
|
638 |
SSpkgName = rsTemp.Fields("pkg_name")
|
|
|
639 |
SSpkgVersion = rsTemp.Fields("pkg_version")
|
|
|
640 |
SSsrc_path = rsTemp.Fields("src_path")
|
|
|
641 |
SSpkgDesc = rsTemp.Fields("pv_description")
|
|
|
642 |
BBdlocked = rsTemp.Fields("dlocked")
|
|
|
643 |
End If
|
| 119 |
ghuddy |
644 |
|
| 129 |
ghuddy |
645 |
rsTemp.Close
|
|
|
646 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
647 |
End Sub
|
|
|
648 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
649 |
Private Function IsDomainAuthOK( SSusername, SSpassword, SSdomainName )
|
| 129 |
ghuddy |
650 |
Dim objLoginAuth, return, tempSTR
|
|
|
651 |
'Set objWSH = Server.CreateObject("WScript.Shell")
|
|
|
652 |
'On Error Resume Next
|
|
|
653 |
'return = -1
|
|
|
654 |
'return = objWSH.Run("cmd.exe /c perl "& rootPath &"\common\domainauth.pl """&_
|
|
|
655 |
' SSdomainName &""" """& SSusername &""" """& SSpassword &""" "&_
|
|
|
656 |
' "> "& rootPath &"\temp\"& SSusername &".txt", 0, true)
|
| 119 |
ghuddy |
657 |
|
| 129 |
ghuddy |
658 |
Set objLoginAuth = Server.CreateObject("LoginAdmin.ImpersonateUser")
|
| 119 |
ghuddy |
659 |
|
| 129 |
ghuddy |
660 |
return = -1
|
|
|
661 |
return = objLoginAuth.AuthenticateUser ( SSusername, SSpassword, SSdomainName )
|
| 119 |
ghuddy |
662 |
|
| 129 |
ghuddy |
663 |
'Response.write "LOGIN"& SSusername &"-"& SSpassword &"-"& SSdomainName &"-"& return
|
| 119 |
ghuddy |
664 |
|
| 129 |
ghuddy |
665 |
If (return = 0) OR (return = 1385) Then
|
|
|
666 |
' From MSDN System Error Codes
|
|
|
667 |
' 0 - The operation completed successfully.
|
|
|
668 |
' 1326 - Logon failure: unknown user name or bad password.
|
|
|
669 |
' 1385 - Logon failure: the user has not been granted the requested logon type at this computer.
|
|
|
670 |
' 1909 - The referenced account is currently locked out and may not be used to log on.
|
| 119 |
ghuddy |
671 |
|
| 129 |
ghuddy |
672 |
'Login ok
|
|
|
673 |
IsDomainAuthOK = True
|
|
|
674 |
Else
|
|
|
675 |
IsDomainAuthOK = False
|
|
|
676 |
End If
|
| 119 |
ghuddy |
677 |
|
| 129 |
ghuddy |
678 |
Set objLoginAuth = Nothing
|
| 119 |
ghuddy |
679 |
End Function
|
|
|
680 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
681 |
Function ReadUserPreferences ( SSitem )
|
| 129 |
ghuddy |
682 |
'ReadUserPreferences = Request.Cookies("RELEASEMANAGER_USER_PREFERENCES")( SSitem )
|
|
|
683 |
ReadUserPreferences = "0"
|
| 119 |
ghuddy |
684 |
End Function
|
|
|
685 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
686 |
Function Requred_Parameters_String ( SScurrent, SSstr )
|
| 129 |
ghuddy |
687 |
'returns "&par1=val1&&parn=valn&" must use & as it will not be used on parameter name or value
|
|
|
688 |
Dim tempARR, parameter, tempSTR
|
|
|
689 |
tempARR = Split( SSstr, "," )
|
|
|
690 |
tempSTR = SScurrent
|
| 119 |
ghuddy |
691 |
|
| 129 |
ghuddy |
692 |
For Each parameter In tempARR
|
|
|
693 |
tempSTR = tempSTR &"&"& parameter &"="& QStrPar( parameter ) &"&"
|
|
|
694 |
Next
|
| 119 |
ghuddy |
695 |
|
| 129 |
ghuddy |
696 |
Requred_Parameters_String = tempSTR
|
| 119 |
ghuddy |
697 |
End Function
|
|
|
698 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
699 |
Function Quick_Help ( SStipname )
|
| 129 |
ghuddy |
700 |
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 |
701 |
End Function
|
|
|
702 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
703 |
Function LogError ( SSlog, SSstr )
|
| 129 |
ghuddy |
704 |
'|errstr1||errstr2||errstr3|...
|
|
|
705 |
LogError = SSlog &"|"& SSstr &"|"
|
| 119 |
ghuddy |
706 |
End Function
|
|
|
707 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5168 |
dpurdie |
708 |
' Send an email
|
|
|
709 |
' Args: SSfromName - Text Name of sender
|
|
|
710 |
' SSfrom - email address of sender
|
|
|
711 |
' SSto - email address of receipient. May be comma sep list or a soem type of object
|
|
|
712 |
' SSsubject - email subject
|
|
|
713 |
' SSbody - Body of the email. Email is sent as html.
|
|
|
714 |
' oAttachments - email attachments. May be empty, a file or a HashRef of files
|
|
|
715 |
'
|
| 119 |
ghuddy |
716 |
Sub Send_Email ( SSfromName, SSfrom, SSto, SSsubject, SSbody, oAttachments )
|
| 129 |
ghuddy |
717 |
Dim Mail, Keys, Key, canSend
|
| 4028 |
dpurdie |
718 |
'Response.write "<pre>Send_Email:SSfromName:" & SSfromName
|
|
|
719 |
'Response.write "<br>Send_Email:SSfrom:" & SSfrom
|
|
|
720 |
'Response.write "<br>Send_Email:SSto:" & SSto
|
|
|
721 |
'Response.write "<br>Send_Email:SSsubject:" & SSsubject
|
|
|
722 |
'Response.write "<br>Send_Email:SSbody:" & SSbody
|
| 119 |
ghuddy |
723 |
|
| 129 |
ghuddy |
724 |
canSend = FALSE
|
|
|
725 |
Set Mail = Server.CreateObject("Persits.MailSender")
|
| 3959 |
dpurdie |
726 |
Mail.Host = MAIL_SERVER
|
| 129 |
ghuddy |
727 |
Mail.From = SSfrom
|
|
|
728 |
Mail.FromName = SSfromName
|
| 119 |
ghuddy |
729 |
|
| 129 |
ghuddy |
730 |
' Send TO:
|
| 4028 |
dpurdie |
731 |
' Handle a Dictionary of names
|
|
|
732 |
If IsObject(SSto) AND (TypeName(SSto) <> "IOraField") Then
|
| 129 |
ghuddy |
733 |
Keys = SSto.Keys
|
|
|
734 |
For Each Key In Keys
|
|
|
735 |
Mail.AddAddress Key, SSto.Item( Key )
|
|
|
736 |
Next
|
| 119 |
ghuddy |
737 |
|
| 129 |
ghuddy |
738 |
If SSto.Count > 0 Then canSend = TRUE
|
|
|
739 |
Else
|
| 119 |
ghuddy |
740 |
|
| 129 |
ghuddy |
741 |
Mail.AddAddress SSto
|
|
|
742 |
If SSto <> "" Then canSend = TRUE
|
|
|
743 |
End If
|
| 119 |
ghuddy |
744 |
|
| 129 |
ghuddy |
745 |
Mail.Subject = SSsubject
|
|
|
746 |
Mail.IsHTML = True
|
|
|
747 |
Mail.Body = SSbody
|
| 119 |
ghuddy |
748 |
|
| 4028 |
dpurdie |
749 |
If NOT IsEmpty(oAttachments) AND NOT IsNull(oAttachments) Then
|
|
|
750 |
' Add Attachments DDDDDDD Sash,
|
|
|
751 |
' It appears as if AddEmbededImage is premium functionality that costs money, can we just do a normal add attachment?
|
|
|
752 |
If IsObject( oAttachments ) Then
|
|
|
753 |
Keys = oAttachments.Keys
|
|
|
754 |
For Each Key In Keys
|
|
|
755 |
' Mail.AddEmbeddedImage rootPath & Key, oAttachments.Item( Key )
|
|
|
756 |
Mail.AddAttachment oAttachments.Item( Key )
|
|
|
757 |
Next
|
|
|
758 |
Else
|
|
|
759 |
Mail.AddAttachment oAttachments
|
|
|
760 |
End If
|
|
|
761 |
End If
|
| 119 |
ghuddy |
762 |
|
| 129 |
ghuddy |
763 |
On Error Resume Next
|
|
|
764 |
If canSend Then Mail.Send ' send message
|
| 119 |
ghuddy |
765 |
|
|
|
766 |
End Sub
|
| 5168 |
dpurdie |
767 |
|
|
|
768 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
769 |
' Record and Report a Release Manager event
|
|
|
770 |
' Record in the machines Event Log
|
|
|
771 |
' Report via email
|
|
|
772 |
' Used to report error conditions that need to be bought to the attention of some sys admin
|
|
|
773 |
' Args: eventType - one of enumEVENT_* ( ie:enumEVENT_ERROR)
|
|
|
774 |
' SSlocation - Indication of location/operation
|
|
|
775 |
' SSvalues - Values. Will be added into the message
|
|
|
776 |
' SSerror_message - Error message
|
|
|
777 |
'
|
|
|
778 |
Sub Report_Event ( eventType, SSlocation, SSvalues, SSerror_message )
|
|
|
779 |
On Error Resume Next
|
|
|
780 |
Dim WshNetwork, SSmsg
|
|
|
781 |
Set WshNetwork = Server.CreateObject("WScript.Network")
|
|
|
782 |
|
|
|
783 |
' Compose Message
|
|
|
784 |
SSmsg = _
|
|
|
785 |
"-- User Info --"& VBNewLine &_
|
|
|
786 |
"Logged In: " & objAccessControl.UserLogedIn & VBNewLine &_
|
|
|
787 |
"Domain: " & objAccessControl.Domain & VBNewLine &_
|
|
|
788 |
"UserName: " & objAccessControl.UserName & VBNewLine &_
|
|
|
789 |
"FullName: " & objAccessControl.FullName & VBNewLine &_
|
|
|
790 |
"UserEmail: " & objAccessControl.UserEmail & VBNewLine &_
|
|
|
791 |
"UserId: " & objAccessControl.UserId & VBNewLine &_
|
|
|
792 |
VBNewLine &_
|
|
|
793 |
"-- Script Info --"& VBNewLine &_
|
|
|
794 |
"Host Name: "& Request.ServerVariables("SERVER_NAME") & ":" & Request.ServerVariables("SERVER_PORT") & VBNewLine &_
|
|
|
795 |
"Script Name: "& Request.ServerVariables("SCRIPT_NAME") & VBNewLine &_
|
|
|
796 |
VBNewLine &_
|
|
|
797 |
"-- Error Location --"& VBNewLine &_
|
|
|
798 |
SSlocation & VBNewLine &_
|
|
|
799 |
VBNewLine &_
|
|
|
800 |
"-- Values --"& VBNewLine &_
|
|
|
801 |
SSvalues & VBNewLine &_
|
|
|
802 |
VBNewLine &_
|
|
|
803 |
"-- Error Message --"& VBNewLine &_
|
|
|
804 |
SSerror_message & VBNewLine
|
|
|
805 |
|
|
|
806 |
'-- Raise this message at these places...
|
|
|
807 |
'-- Create an event in the system event log
|
|
|
808 |
'-- Send out an email
|
|
|
809 |
Call Send_Event( eventType, SSmsg )
|
|
|
810 |
Call Send_Email ( "Release Manager Notification", _
|
|
|
811 |
adminEmail, _
|
|
|
812 |
FAULT_EMAIL_LIST, _
|
|
|
813 |
"Release Manager Error", _
|
|
|
814 |
Replace(SSmsg,VBNewLine, "<br>"), _
|
|
|
815 |
null )
|
|
|
816 |
|
|
|
817 |
'----------------------------------------
|
|
|
818 |
Set WshNetwork = Nothing
|
|
|
819 |
End Sub
|
|
|
820 |
|
| 119 |
ghuddy |
821 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5168 |
dpurdie |
822 |
' Record Event in OS log
|
|
|
823 |
' Create an event in the system event log
|
|
|
824 |
'
|
|
|
825 |
' Args: eventType - one of enumEVENT_* ( ie:enumEVENT_ERROR)
|
|
|
826 |
' SSmsg - Message Body
|
|
|
827 |
Sub Send_Event( eventType, SSmsg )
|
|
|
828 |
On Error Resume Next
|
|
|
829 |
Dim WshShell
|
|
|
830 |
Set WshShell = Server.CreateObject("WScript.Shell")
|
|
|
831 |
WshShell.LogEvent eventType, SSmsg
|
|
|
832 |
Set WshShell = Nothing
|
|
|
833 |
End Sub
|
|
|
834 |
|
|
|
835 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 119 |
ghuddy |
836 |
Sub Iterate_UP_the_tree ( NNrtag_id, HHstart_with, HHresult )
|
| 129 |
ghuddy |
837 |
Dim rsTemp, Query_String
|
|
|
838 |
Dim seekPKGs, seekNOTpkgs
|
| 119 |
ghuddy |
839 |
|
| 129 |
ghuddy |
840 |
seekPKGs = Join(HHstart_with.Keys, ",")
|
|
|
841 |
If seekPKGs = "" Then seekPKGs = "-1"
|
|
|
842 |
seekNOTpkgs = "-1"
|
| 119 |
ghuddy |
843 |
|
| 129 |
ghuddy |
844 |
Do While seekPKGs <> "-1"
|
|
|
845 |
Query_String = _
|
|
|
846 |
" SELECT DISTINCT dep.pkg_id"&_
|
|
|
847 |
" FROM package_dependencies dep, release_content rel"&_
|
|
|
848 |
" WHERE rel.pv_id = dep.pv_id"&_
|
|
|
849 |
" AND rel.rtag_id = "& NNrtag_id &_
|
|
|
850 |
" AND dpkg_id IN ( "& seekPKGs &" ) "&_
|
|
|
851 |
" AND pkg_id NOT IN ( "& seekNOTpkgs &" )"
|
|
|
852 |
'" AND dep.dpv_id NOT IN ( SELECT iw.iw_id FROM ignore_warnings iw WHERE iw.rtag_id = "& NNrtag_id &" )"
|
|
|
853 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
854 |
|
| 129 |
ghuddy |
855 |
If rsTemp.RecordCount < 1 Then Exit Do
|
| 119 |
ghuddy |
856 |
|
| 129 |
ghuddy |
857 |
seekPKGs = "-1"
|
|
|
858 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
859 |
If NOT HHresult.Exists(Cstr(rsTemp.Fields("pkg_id"))) Then HHresult.Add Cstr(rsTemp.Fields("pkg_id")), ""
|
|
|
860 |
seekPKGs = seekPKGs &","& rsTemp.Fields("pkg_id")
|
|
|
861 |
rsTemp.MoveNext
|
|
|
862 |
WEnd
|
| 119 |
ghuddy |
863 |
|
| 129 |
ghuddy |
864 |
seekNOTpkgs = seekNOTpkgs &","& seekPKGs
|
|
|
865 |
Loop
|
| 119 |
ghuddy |
866 |
|
|
|
867 |
End Sub
|
|
|
868 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 129 |
ghuddy |
869 |
Sub Iterate_DOWN_the_tree ( NNrtag_id, HHstart_with, HHresult )
|
|
|
870 |
Dim rsTemp, Query_String
|
|
|
871 |
Dim seekPKGs, seekNOTpkgs
|
| 119 |
ghuddy |
872 |
|
| 129 |
ghuddy |
873 |
seekPKGs = Join(HHstart_with.Keys, ",")
|
|
|
874 |
If seekPKGs = "" Then seekPKGs = "-1"
|
|
|
875 |
seekNOTpkgs = "-1"
|
| 119 |
ghuddy |
876 |
|
| 129 |
ghuddy |
877 |
Do While seekPKGs <> "-1"
|
|
|
878 |
Query_String = _
|
|
|
879 |
" SELECT DISTINCT dep.dpkg_id"&_
|
|
|
880 |
" FROM package_dependencies dep, release_content rel"&_
|
|
|
881 |
" WHERE rel.pv_id = dep.pv_id"&_
|
|
|
882 |
" AND rel.rtag_id = "& NNrtag_id &_
|
|
|
883 |
" AND pkg_id IN ( "& seekPKGs &" ) "&_
|
|
|
884 |
" AND dpkg_id NOT IN ( "& seekNOTpkgs &" )"
|
|
|
885 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
886 |
|
| 129 |
ghuddy |
887 |
If rsTemp.RecordCount < 1 Then Exit Do
|
| 119 |
ghuddy |
888 |
|
| 129 |
ghuddy |
889 |
seekPKGs = "-1"
|
|
|
890 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
891 |
If NOT HHresult.Exists(Cstr(rsTemp.Fields("dpkg_id"))) Then HHresult.Add Cstr(rsTemp.Fields("dpkg_id")), ""
|
|
|
892 |
seekPKGs = seekPKGs &","& rsTemp.Fields("dpkg_id")
|
|
|
893 |
rsTemp.MoveNext
|
|
|
894 |
WEnd
|
| 119 |
ghuddy |
895 |
|
| 129 |
ghuddy |
896 |
seekNOTpkgs = seekNOTpkgs &","& seekPKGs
|
|
|
897 |
Loop
|
| 119 |
ghuddy |
898 |
|
|
|
899 |
End Sub
|
|
|
900 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
901 |
Class TempSession
|
| 129 |
ghuddy |
902 |
Function Value ()
|
|
|
903 |
Value = Session("RELEASEMANAGER_temp")
|
|
|
904 |
End Function
|
| 119 |
ghuddy |
905 |
|
| 129 |
ghuddy |
906 |
Sub Add ( SSstr )
|
|
|
907 |
Session("RELEASEMANAGER_temp") = Session("RELEASEMANAGER_temp") & SSstr
|
|
|
908 |
End Sub
|
| 119 |
ghuddy |
909 |
|
| 129 |
ghuddy |
910 |
Sub Clean ()
|
|
|
911 |
Session("RELEASEMANAGER_temp") = NULL
|
|
|
912 |
End Sub
|
| 119 |
ghuddy |
913 |
End Class
|
|
|
914 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
915 |
Sub DisplayInfo ( SSmsg, SSwidth )
|
| 129 |
ghuddy |
916 |
Dim msg
|
|
|
917 |
If SSmsg = "" Then Exit Sub
|
| 119 |
ghuddy |
918 |
|
| 129 |
ghuddy |
919 |
Select Case UCase( SSmsg )
|
|
|
920 |
Case "ISSUES_IMPORTED"
|
|
|
921 |
msg = "Import is complete. <br>Click on Close button if you are finished."
|
|
|
922 |
Case "MAKE_OFFICIAL_WARNING"
|
|
|
923 |
msg = "Note that making a package official will prevent any further change to it."
|
|
|
924 |
Case "APPLY_LABEL_TO_ALL_WARNING"
|
|
|
925 |
msg = "This will overwrite any existing labels on selected packages."
|
|
|
926 |
Case "BLANK_LABEL_WARNING"
|
|
|
927 |
msg = "Some dependencies in the export list above, do not have a label!"
|
|
|
928 |
Case "PERSONAL_VIEW_NOT_SETUP"
|
|
|
929 |
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>"
|
|
|
930 |
Case "EMPTY_RELEASE_CONTENTS"
|
|
|
931 |
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>"
|
|
|
932 |
Case "PKG_NAME_REQUIRED"
|
|
|
933 |
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>"
|
|
|
934 |
Case "ADD_PATCH_WARNING"
|
|
|
935 |
msg = "Note that patches cannot be used in your build dependencies."
|
|
|
936 |
Case "NEW_PATCH_AVAILABLE"
|
|
|
937 |
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 |
938 |
|
| 129 |
ghuddy |
939 |
Case "NOT_FOUND_IN_PKG_ARCHIVE_RELEASE_NOTES"
|
| 5142 |
dpurdie |
940 |
msg = "<b>Regenerating release notes...</b><br>It may take a minute. Please try refreshing this page a bit later."
|
| 129 |
ghuddy |
941 |
Case "FAILED_GENERATING_RELEASE_NOTES"
|
|
|
942 |
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>"
|
|
|
943 |
Case "GENERATING_RELEASE_NOTES"
|
|
|
944 |
msg = "<b>Generating release notes...</b><br>It may take a minute. Please try refreshing this page a bit later."
|
|
|
945 |
Case "NO_PREVIOUS_VERSION_RELEASE_NOTES"
|
|
|
946 |
msg = "<b>Previous Version is Unknown</b>!<br>Please specify previous version by clicking on 'Show Details...' above.<br>Release notes are not generated."
|
| 4705 |
dpurdie |
947 |
Case "RELEASE_NOTES_PLACEHOLDER_PACKAGE"
|
|
|
948 |
msg = "<b>Place Holing Package</b>!<br>This package is manually built, does not have a build standard and does not exist in dpkg_archive. It is used as a placeholder.<br>Release notes are not generated."
|
| 119 |
ghuddy |
949 |
|
| 129 |
ghuddy |
950 |
Case "PACKAGE_FOUND_IN_OTHER_LOCATIONS"
|
|
|
951 |
msg = "This package is also found in other locations."
|
|
|
952 |
Case "DOC_NUMBER_NOTFOUND"
|
|
|
953 |
msg = "<span class='err_alert'>Document number "& Request("doc_num") &" does not correspond to any document!</span>"
|
|
|
954 |
Case "DOC_NUMBER_FOUND"
|
|
|
955 |
msg = "Document found. Click "Import" to link the document."
|
|
|
956 |
Case "UNIT_TEST_NOT_DONE"
|
|
|
957 |
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."
|
|
|
958 |
Case "PACKAGE_NOT_PART_OF_RELEASE"
|
|
|
959 |
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 |
960 |
|
| 129 |
ghuddy |
961 |
Case "NOT_FOUND_IN_PKG_ARCHIVE_FILE_GENERATE"
|
| 5172 |
dpurdie |
962 |
msg = "<b>This package is not found in dpkg_archive!</b><br>Files and folders are not captured."
|
| 129 |
ghuddy |
963 |
Case "NO_PRODUCT_FILES_CAPTURED"
|
|
|
964 |
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 |
965 |
|
| 129 |
ghuddy |
966 |
Case "MASS REF REFERENCE"
|
|
|
967 |
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 |
968 |
|
| 129 |
ghuddy |
969 |
Case "REPEAT_SCHEDULE_NOT_SELECTED"
|
|
|
970 |
msg = "<span class='err_alert'><b>YOU MUST SELECT A VALUE FOR REPEAT SCHEDULED DOWNTIME</b></span>"
|
| 119 |
ghuddy |
971 |
|
| 129 |
ghuddy |
972 |
Case "PKG_NAME_INVALID"
|
|
|
973 |
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 |
974 |
|
| 129 |
ghuddy |
975 |
Case "PKG_NAME_EXISTS"
|
|
|
976 |
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 |
977 |
|
| 129 |
ghuddy |
978 |
End Select
|
| 119 |
ghuddy |
979 |
%>
|
|
|
980 |
<table width="<%=SSwidth%>" border="0" cellspacing="0" cellpadding="1">
|
|
|
981 |
<tr>
|
|
|
982 |
<td background="images/bg_bage_dark.gif">
|
| 129 |
ghuddy |
983 |
<table width="100%" border="0" cellspacing="0" cellpadding="3">
|
| 119 |
ghuddy |
984 |
<tr>
|
|
|
985 |
<td width="1%" valign="top" background="images/bg_help.gif"><img src="images/i_qhelp.gif" width="16" height="16"></td>
|
|
|
986 |
<td width="100%" background="images/bg_help.gif" class="form_txt"><%=msg%></td>
|
|
|
987 |
</tr>
|
|
|
988 |
</table></td>
|
|
|
989 |
</tr>
|
|
|
990 |
</table>
|
|
|
991 |
<br>
|
|
|
992 |
<%
|
|
|
993 |
|
|
|
994 |
End Sub
|
|
|
995 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
996 |
Sub Messenger ( sMessage, nMessageType, sWidth )
|
| 129 |
ghuddy |
997 |
Dim msgTemplate, Img
|
| 119 |
ghuddy |
998 |
|
| 129 |
ghuddy |
999 |
If (sMessage = "") OR IsNull(sMessage) Then Exit Sub
|
| 119 |
ghuddy |
1000 |
|
| 129 |
ghuddy |
1001 |
Select Case CStr(nMessageType)
|
|
|
1002 |
Case "1"
|
|
|
1003 |
Img = "s_critical.gif"
|
|
|
1004 |
Case "2"
|
|
|
1005 |
Img = "s_warning.gif"
|
|
|
1006 |
Case "3"
|
|
|
1007 |
Img = "s_note.gif"
|
|
|
1008 |
Case Else
|
|
|
1009 |
Img = nMessageType
|
|
|
1010 |
End Select
|
| 119 |
ghuddy |
1011 |
|
|
|
1012 |
|
| 129 |
ghuddy |
1013 |
msgTemplate = ReadFile( APP_ROOT &"\scripts\message_style.html" )
|
|
|
1014 |
msgTemplate = Replace( msgTemplate, "%WIDTH%", sWidth )
|
|
|
1015 |
msgTemplate = Replace( msgTemplate, "%IMAGE%", Img )
|
|
|
1016 |
msgTemplate = Replace( msgTemplate, "%MESSAGE%", sMessage )
|
| 119 |
ghuddy |
1017 |
|
| 129 |
ghuddy |
1018 |
Response.write msgTemplate
|
| 119 |
ghuddy |
1019 |
End Sub
|
|
|
1020 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 4203 |
dpurdie |
1021 |
Function Default_Label ( SSpv_id, SSbuild_type, SSchange_type, SSpkg_name, SSpkg_version, SSv_ext )
|
| 3959 |
dpurdie |
1022 |
If SSbuild_type = "A" Then
|
| 4203 |
dpurdie |
1023 |
If SSchange_type = "F" Then
|
|
|
1024 |
Default_Label = SSpkg_name & "_" & SSpkg_version & ".WIP"
|
|
|
1025 |
else
|
|
|
1026 |
Default_Label = UCase(SSpkg_name & "." & SSpv_id & SSv_ext) & ".WIP"
|
|
|
1027 |
End If
|
| 3959 |
dpurdie |
1028 |
Else
|
| 4203 |
dpurdie |
1029 |
Default_Label = SSpkg_name & "_" & SSpkg_version
|
| 3959 |
dpurdie |
1030 |
End If
|
| 119 |
ghuddy |
1031 |
End Function
|
|
|
1032 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1033 |
Function Format_Version ( SSpkg_version, SSv_ext )
|
| 129 |
ghuddy |
1034 |
Dim tempArr, tempVersion, patchArr, seg, myVersion
|
|
|
1035 |
myVersion = SSpkg_version
|
| 119 |
ghuddy |
1036 |
|
| 129 |
ghuddy |
1037 |
If NOT IsNull(SSv_ext) Then
|
|
|
1038 |
myVersion = Left ( myVersion, Len(myVersion) - Len(SSv_ext) )
|
|
|
1039 |
End If
|
| 119 |
ghuddy |
1040 |
|
| 129 |
ghuddy |
1041 |
tempArr = Split (myVersion, ".")
|
|
|
1042 |
For Each seg In tempArr
|
|
|
1043 |
If Len(seg) < 2 Then
|
|
|
1044 |
' single digit number
|
|
|
1045 |
tempVersion = tempVersion &"0"& seg
|
| 119 |
ghuddy |
1046 |
|
| 129 |
ghuddy |
1047 |
Else
|
|
|
1048 |
seg = Replace(seg, "_", "-") ' make sure that there is no _ in segment
|
|
|
1049 |
If InStr( seg, "-" ) > 0 Then
|
|
|
1050 |
' patch version supplied
|
|
|
1051 |
patchArr = Split(seg, "-")
|
|
|
1052 |
If Len(patchArr(0)) < 2 Then
|
|
|
1053 |
' single digit number
|
|
|
1054 |
tempVersion = tempVersion &"0"& patchArr(0) &"_0"& patchArr(1)
|
|
|
1055 |
Else
|
|
|
1056 |
' double digit number
|
|
|
1057 |
tempVersion = tempVersion & patchArr(0) &"_0"& patchArr(1)
|
|
|
1058 |
End If
|
| 119 |
ghuddy |
1059 |
|
| 129 |
ghuddy |
1060 |
Else
|
|
|
1061 |
' double digit no patch
|
|
|
1062 |
tempVersion = tempVersion & seg
|
|
|
1063 |
End If
|
| 119 |
ghuddy |
1064 |
|
| 129 |
ghuddy |
1065 |
End If
|
| 119 |
ghuddy |
1066 |
|
| 129 |
ghuddy |
1067 |
Next
|
| 119 |
ghuddy |
1068 |
|
| 129 |
ghuddy |
1069 |
Format_Version = tempVersion
|
| 119 |
ghuddy |
1070 |
End Function
|
|
|
1071 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1072 |
Function DefineStateIcon ( NNpkg_state, CCdlocked, sIgnoreWarnings, cIsPatchIgnore, cBuildType, bForEnvironment )
|
| 5175 |
dpurdie |
1073 |
|
|
|
1074 |
If IsNull(NNpkg_state) Then
|
|
|
1075 |
DefineStateIcon = ""
|
|
|
1076 |
Exit Function
|
|
|
1077 |
End If
|
| 119 |
ghuddy |
1078 |
|
| 129 |
ghuddy |
1079 |
If NOT IsNull(sIgnoreWarnings) Then
|
|
|
1080 |
'-- Ignore Warning is on
|
|
|
1081 |
If IsNull(cIsPatchIgnore) Then
|
|
|
1082 |
DefineStateIcon = enum_imgIgnoring
|
|
|
1083 |
Else
|
|
|
1084 |
DefineStateIcon = enum_imgPatchIgnoring
|
|
|
1085 |
End If
|
| 119 |
ghuddy |
1086 |
|
| 129 |
ghuddy |
1087 |
Else
|
|
|
1088 |
Select Case CInt( NNpkg_state )
|
|
|
1089 |
Case enumPKG_STATE_OK
|
| 183 |
brianf |
1090 |
If (CCdlocked = "N") OR (CCdlocked = "R") Then
|
| 129 |
ghuddy |
1091 |
DefineStateIcon = enum_imgBuilding
|
| 183 |
brianf |
1092 |
ElseIf (CCdlocked = "P") Then
|
|
|
1093 |
DefineStateIcon = enum_imgPending
|
| 129 |
ghuddy |
1094 |
Else
|
|
|
1095 |
DefineStateIcon = enum_imgBlank
|
|
|
1096 |
End If
|
| 119 |
ghuddy |
1097 |
|
| 129 |
ghuddy |
1098 |
Case enumPKG_STATE_MAJOR
|
|
|
1099 |
DefineStateIcon = enum_imgCritical
|
| 119 |
ghuddy |
1100 |
|
| 129 |
ghuddy |
1101 |
Case enumPKG_STATE_MINOR
|
|
|
1102 |
DefineStateIcon = enum_imgWarning
|
| 119 |
ghuddy |
1103 |
|
| 129 |
ghuddy |
1104 |
Case enumPKG_STATE_MAJOR_READY
|
|
|
1105 |
DefineStateIcon = enum_imgCReady
|
| 119 |
ghuddy |
1106 |
|
| 129 |
ghuddy |
1107 |
Case enumPKG_STATE_MINOR_READY
|
|
|
1108 |
DefineStateIcon = enum_imgWReady
|
| 119 |
ghuddy |
1109 |
|
| 129 |
ghuddy |
1110 |
Case enumPKG_NOT_FOUND
|
|
|
1111 |
DefineStateIcon = enum_imgNotFound
|
| 119 |
ghuddy |
1112 |
|
| 129 |
ghuddy |
1113 |
Case enumPKG_STATE_NEW_PATCH
|
|
|
1114 |
DefineStateIcon = enum_imgPatchAvailable
|
| 119 |
ghuddy |
1115 |
|
| 129 |
ghuddy |
1116 |
Case enumPKG_STATE_DEPRECATED
|
|
|
1117 |
DefineStateIcon = enum_imgDeprecated
|
| 119 |
ghuddy |
1118 |
|
| 129 |
ghuddy |
1119 |
Case enumPKG_STATE_DEPRECATED_DEPENDENT
|
|
|
1120 |
DefineStateIcon = enum_imgDeprecatedDependent
|
| 119 |
ghuddy |
1121 |
|
| 129 |
ghuddy |
1122 |
Case enumPKG_ADVISORY_RIPPLE
|
|
|
1123 |
DefineStateIcon = enum_imgAR
|
| 119 |
ghuddy |
1124 |
|
| 129 |
ghuddy |
1125 |
Case enumPKG_ADVISORY_RIPPLE_DEPENDENT
|
|
|
1126 |
DefineStateIcon = enum_imgARD
|
| 119 |
ghuddy |
1127 |
|
| 131 |
ghuddy |
1128 |
Case enumPKG_PEGGED_VERSION
|
|
|
1129 |
DefineStateIcon = enum_imgGreenPin
|
| 5080 |
dpurdie |
1130 |
|
|
|
1131 |
Case enumPKG_SDK_IMPORT
|
|
|
1132 |
DefineStateIcon = enum_imgSdkImport
|
|
|
1133 |
|
|
|
1134 |
Case enumPKG_SDK_DEPENDENCY
|
|
|
1135 |
DefineStateIcon = enum_imgSdkDep
|
|
|
1136 |
|
| 129 |
ghuddy |
1137 |
End Select
|
| 119 |
ghuddy |
1138 |
|
| 129 |
ghuddy |
1139 |
If (NOT bForEnvironment) AND _
|
|
|
1140 |
(cBuildType = "A") AND _
|
|
|
1141 |
(CCdlocked <> "Y") AND _
|
|
|
1142 |
(DefineStateIcon <> enum_imgBlank) AND _
|
|
|
1143 |
(DefineStateIcon <> enum_imgBuilding) AND _
|
|
|
1144 |
(DefineStateIcon <> enum_imgNotFound) OR _
|
|
|
1145 |
( Request("rtag_id") = "" AND Request("FRrtag_id") = "") _
|
|
|
1146 |
Then
|
| 119 |
ghuddy |
1147 |
|
| 129 |
ghuddy |
1148 |
DefineStateIcon = ""
|
| 119 |
ghuddy |
1149 |
|
| 129 |
ghuddy |
1150 |
End If
|
| 4390 |
dpurdie |
1151 |
End If
|
|
|
1152 |
End Function
|
|
|
1153 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1154 |
Function DefineStateIconSimple ( NNpkg_state, CCdlocked)
|
| 119 |
ghuddy |
1155 |
|
| 4390 |
dpurdie |
1156 |
DefineStateIconSimple = ""
|
|
|
1157 |
Select Case CInt( NNpkg_state )
|
|
|
1158 |
Case enumPKG_STATE_OK
|
|
|
1159 |
If (CCdlocked = "R") OR (CCdlocked = "A") Then
|
|
|
1160 |
DefineStateIconSimple = enum_imgBuilding
|
|
|
1161 |
ElseIf (CCdlocked = "P") Then
|
|
|
1162 |
DefineStateIconSimple = enum_imgPending
|
|
|
1163 |
ElseIf (CCdlocked = "Y") Then
|
|
|
1164 |
DefineStateIconSimple = enum_imgReleasedLocked
|
|
|
1165 |
ElseIf (CCdlocked = "N") Then
|
|
|
1166 |
DefineStateIconSimple = enum_imgReleasedUnlocked
|
|
|
1167 |
Else
|
|
|
1168 |
DefineStateIconSimple = enum_imgBlank
|
|
|
1169 |
End If
|
| 119 |
ghuddy |
1170 |
|
| 4390 |
dpurdie |
1171 |
Case enumPKG_STATE_MAJOR
|
|
|
1172 |
DefineStateIconSimple = enum_imgCritical
|
| 119 |
ghuddy |
1173 |
|
| 4390 |
dpurdie |
1174 |
Case enumPKG_STATE_MINOR
|
|
|
1175 |
DefineStateIconSimple = enum_imgWarning
|
| 119 |
ghuddy |
1176 |
|
| 4390 |
dpurdie |
1177 |
Case enumPKG_STATE_MAJOR_READY
|
|
|
1178 |
DefineStateIconSimple = enum_imgCReady
|
|
|
1179 |
|
|
|
1180 |
Case enumPKG_STATE_MINOR_READY
|
|
|
1181 |
DefineStateIconSimple = enum_imgWReady
|
|
|
1182 |
|
|
|
1183 |
Case enumPKG_NOT_FOUND
|
|
|
1184 |
DefineStateIconSimple = enum_imgNotFound
|
|
|
1185 |
|
|
|
1186 |
Case enumPKG_STATE_NEW_PATCH
|
|
|
1187 |
DefineStateIconSimple = enum_imgPatchAvailable
|
|
|
1188 |
|
|
|
1189 |
Case enumPKG_STATE_DEPRECATED
|
|
|
1190 |
DefineStateIconSimple = enum_imgDeprecated
|
|
|
1191 |
|
|
|
1192 |
Case enumPKG_STATE_DEPRECATED_DEPENDENT
|
|
|
1193 |
DefineStateIconSimple = enum_imgDeprecatedDependent
|
|
|
1194 |
|
|
|
1195 |
Case enumPKG_ADVISORY_RIPPLE
|
|
|
1196 |
DefineStateIconSimple = enum_imgAR
|
|
|
1197 |
|
|
|
1198 |
Case enumPKG_ADVISORY_RIPPLE_DEPENDENT
|
|
|
1199 |
DefineStateIconSimple = enum_imgARD
|
|
|
1200 |
|
|
|
1201 |
Case enumPKG_PEGGED_VERSION
|
|
|
1202 |
DefineStateIconSimple = enum_imgGreenPin
|
| 5080 |
dpurdie |
1203 |
|
|
|
1204 |
Case enumPKG_SDK_IMPORT
|
| 5085 |
dpurdie |
1205 |
DefineStateIconSimple = enum_imgSdkImport
|
| 5080 |
dpurdie |
1206 |
|
|
|
1207 |
Case enumPKG_SDK_DEPENDENCY
|
| 5085 |
dpurdie |
1208 |
DefineStateIconSimple = enum_imgSdkDep
|
| 5080 |
dpurdie |
1209 |
|
| 4390 |
dpurdie |
1210 |
End Select
|
| 119 |
ghuddy |
1211 |
End Function
|
|
|
1212 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1213 |
Function DefineStateSmallIcon ( NNpkg_state, CCdlocked )
|
| 129 |
ghuddy |
1214 |
Select Case CInt( NNpkg_state )
|
|
|
1215 |
Case enumPKG_STATE_OK
|
|
|
1216 |
If CCdlocked = "N" Then
|
|
|
1217 |
DefineStateSmallIcon = enum_SMALL_imgBuilding
|
|
|
1218 |
Else
|
|
|
1219 |
DefineStateSmallIcon = enum_SMALL_imgOK
|
|
|
1220 |
End If
|
| 119 |
ghuddy |
1221 |
|
| 129 |
ghuddy |
1222 |
Case enumPKG_STATE_MAJOR
|
|
|
1223 |
DefineStateSmallIcon = enum_SMALL_imgCritical
|
| 119 |
ghuddy |
1224 |
|
| 129 |
ghuddy |
1225 |
Case enumPKG_STATE_MINOR
|
|
|
1226 |
DefineStateSmallIcon = enum_SMALL_imgWarning
|
| 119 |
ghuddy |
1227 |
|
| 129 |
ghuddy |
1228 |
Case enumPKG_STATE_MAJOR_READY
|
|
|
1229 |
DefineStateSmallIcon = enum_SMALL_imgCReady
|
| 119 |
ghuddy |
1230 |
|
| 129 |
ghuddy |
1231 |
Case enumPKG_STATE_MINOR_READY
|
|
|
1232 |
DefineStateSmallIcon = enum_SMALL_imgWReady
|
| 119 |
ghuddy |
1233 |
|
| 129 |
ghuddy |
1234 |
End Select
|
| 119 |
ghuddy |
1235 |
End Function
|
|
|
1236 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1237 |
Function PatchIcon ( cIsPatch, cIsPatchObsolete )
|
| 129 |
ghuddy |
1238 |
If IsNull(cIsPatch) Then
|
|
|
1239 |
PatchIcon = "<img src='images/rex_images/ext_blank.gif' width='16' height='16' border='0' align='absmiddle'>"
|
|
|
1240 |
Else
|
|
|
1241 |
If IsNull(cIsPatchObsolete) Then
|
|
|
1242 |
PatchIcon = "<img src='images/i_patch_small.gif' width='16' height='16' border='0' align='absmiddle' >"
|
|
|
1243 |
Else
|
|
|
1244 |
PatchIcon = "<img src='images/i_patch_small_obsolete.gif' width='16' height='16' border='0' align='absmiddle' title='Patch is obsolete'>"
|
|
|
1245 |
End If
|
|
|
1246 |
End If
|
| 119 |
ghuddy |
1247 |
End Function
|
|
|
1248 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1249 |
' Function that returns true of false if the item exists in the array
|
|
|
1250 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1251 |
Function inArray(item, aItems)
|
| 129 |
ghuddy |
1252 |
Dim element
|
|
|
1253 |
inArray = false
|
|
|
1254 |
for each element in aItems
|
|
|
1255 |
If element = item Then
|
|
|
1256 |
inArray=true
|
|
|
1257 |
End If
|
|
|
1258 |
next
|
| 119 |
ghuddy |
1259 |
End Function
|
|
|
1260 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1261 |
Function ProgressBar ()
|
| 129 |
ghuddy |
1262 |
ProgressBar = "<DIV name='divProgressBar' id='divProgressBar' style='visibility:hidden;'><img src='icons/i_processing.gif' width='79' height='14'></DIV>"
|
| 119 |
ghuddy |
1263 |
End Function
|
|
|
1264 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5268 |
dpurdie |
1265 |
' Function: GetCurrentParameters
|
|
|
1266 |
' Description: Setup some very basic data that is common to (almost) pages
|
|
|
1267 |
' Uses Request("proj_id"), Request("rtag_id") and Request("pv_id")
|
|
|
1268 |
'
|
|
|
1269 |
' Given an rtag_id it will determine the enclosing project
|
|
|
1270 |
'
|
|
|
1271 |
' Returns: nProjId proj_id of rtag_ig
|
|
|
1272 |
' nRtagId rtag_id
|
|
|
1273 |
' nPvid pv_id
|
|
|
1274 |
'
|
|
|
1275 |
'
|
|
|
1276 |
'
|
| 119 |
ghuddy |
1277 |
Function GetCurrentParameters( nProjId, nRtagId, nPvId )
|
| 129 |
ghuddy |
1278 |
Dim rsQry,query
|
| 119 |
ghuddy |
1279 |
|
| 129 |
ghuddy |
1280 |
' Set defaults
|
|
|
1281 |
nProjId = -1
|
|
|
1282 |
nRtagId = -1
|
| 5177 |
dpurdie |
1283 |
nPvId = -1
|
| 119 |
ghuddy |
1284 |
|
| 129 |
ghuddy |
1285 |
' Get parameters from database
|
| 5102 |
dpurdie |
1286 |
OraDatabase.Parameters.Add "ProjId", Request("proj_id"), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
| 129 |
ghuddy |
1287 |
OraDatabase.Parameters.Add "Rtag_id", Request("rtag_id"), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
1288 |
OraDatabase.Parameters.Add "results", NULL, ORAPARM_OUTPUT, ORATYPE_CURSOR
|
| 119 |
ghuddy |
1289 |
|
| 129 |
ghuddy |
1290 |
OraDatabase.ExecuteSQL " BEGIN PK_APP_UTILS.GET_CURRENT_PARAMETERS ( :ProjId, :Rtag_id, :results ); END;"
|
| 119 |
ghuddy |
1291 |
|
| 129 |
ghuddy |
1292 |
Set rsQry = OraDatabase.Parameters("results").Value
|
| 119 |
ghuddy |
1293 |
|
| 129 |
ghuddy |
1294 |
OraDatabase.Parameters.Remove "ProjId"
|
|
|
1295 |
OraDatabase.Parameters.Remove "Rtag_id"
|
|
|
1296 |
OraDatabase.Parameters.Remove "results"
|
| 119 |
ghuddy |
1297 |
|
|
|
1298 |
|
| 129 |
ghuddy |
1299 |
If rsQry.RecordCount > 0 Then
|
|
|
1300 |
nProjId = CDbl(rsQry("PROJ_ID"))
|
|
|
1301 |
nRtagId = CDbl(rsQry("RTAG_ID"))
|
|
|
1302 |
End If
|
| 119 |
ghuddy |
1303 |
|
| 129 |
ghuddy |
1304 |
rsQry.Close()
|
|
|
1305 |
Set rsQry = nothing
|
| 119 |
ghuddy |
1306 |
|
| 129 |
ghuddy |
1307 |
' Set pv_id parameter
|
|
|
1308 |
If Request("pv_id") <> "" Then nPvId = CDbl(Request("pv_id"))
|
| 119 |
ghuddy |
1309 |
|
|
|
1310 |
End Function
|
|
|
1311 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1312 |
Function GetEnvName ( nEnvTab )
|
| 129 |
ghuddy |
1313 |
Select Case CInt( nEnvTab )
|
|
|
1314 |
Case enumENVTAB_WORK_IN_PROGRESS
|
|
|
1315 |
GetEnvName = "Work In Progress"
|
| 119 |
ghuddy |
1316 |
|
| 129 |
ghuddy |
1317 |
Case enumENVTAB_PLANNED
|
|
|
1318 |
GetEnvName = "Pending"
|
| 119 |
ghuddy |
1319 |
|
| 129 |
ghuddy |
1320 |
Case enumENVTAB_RELEASED
|
|
|
1321 |
GetEnvName = "Released"
|
| 119 |
ghuddy |
1322 |
|
| 129 |
ghuddy |
1323 |
End Select
|
| 119 |
ghuddy |
1324 |
|
|
|
1325 |
End Function
|
|
|
1326 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1327 |
Function Title (rtagId)
|
|
|
1328 |
|
| 129 |
ghuddy |
1329 |
If rtagId = "" Then
|
|
|
1330 |
Title = "Release Manager"
|
|
|
1331 |
Else
|
|
|
1332 |
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 )
|
|
|
1333 |
Title = rsQry("proj_name")&">"&rsQry("rtag_name")
|
|
|
1334 |
rsQry.Close()
|
|
|
1335 |
Set rsQry = Nothing
|
|
|
1336 |
End If
|
| 119 |
ghuddy |
1337 |
|
|
|
1338 |
End Function
|
|
|
1339 |
'-------------------------------------------------------------------------------------
|
|
|
1340 |
Function Check_Package_WIP_Already_Exists(NNrtag_id, NNpv_id)
|
| 129 |
ghuddy |
1341 |
Dim Query_String, rsQry
|
| 119 |
ghuddy |
1342 |
|
| 129 |
ghuddy |
1343 |
Query_String = _
|
|
|
1344 |
" SELECT * "&_
|
|
|
1345 |
" FROM planned pl, package_versions pv "&_
|
|
|
1346 |
" WHERE pl.rtag_id = "& NNrtag_id &_
|
|
|
1347 |
" AND pv.pv_id = pl.pv_id "&_
|
|
|
1348 |
" AND pv.dlocked = 'A' "&_
|
|
|
1349 |
" AND pv.pkg_id = (SELECT pkg_id "&_
|
|
|
1350 |
" FROM package_versions "&_
|
|
|
1351 |
" WHERE pv_id = "& NNpv_id &") "&_
|
|
|
1352 |
" AND pv.v_ext = (SELECT v_ext "&_
|
|
|
1353 |
" FROM package_versions "&_
|
|
|
1354 |
" WHERE pv_id = "& NNpv_id &")"
|
| 119 |
ghuddy |
1355 |
|
|
|
1356 |
|
| 129 |
ghuddy |
1357 |
Set rsQry = OraDatabase.DbCreateDynaset( Query_String , cint(0) )
|
| 119 |
ghuddy |
1358 |
|
| 129 |
ghuddy |
1359 |
Check_Package_WIP_Already_Exists = rsQry.RecordCount
|
| 119 |
ghuddy |
1360 |
|
| 129 |
ghuddy |
1361 |
rsQry.Close()
|
|
|
1362 |
Set rsQry = Nothing
|
| 119 |
ghuddy |
1363 |
End Function
|
|
|
1364 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1365 |
Function ValidateCodeReviewURL ( sCodeReviewURL )
|
|
|
1366 |
Dim isValid
|
|
|
1367 |
Dim sTempBaseURL
|
|
|
1368 |
Dim httpRegEx
|
| 129 |
ghuddy |
1369 |
Set httpRegEx = new RegExp
|
| 119 |
ghuddy |
1370 |
|
| 129 |
ghuddy |
1371 |
httpRegEx.Pattern = "^https?:\/\/"
|
| 119 |
ghuddy |
1372 |
|
| 129 |
ghuddy |
1373 |
' Removes ending slash from project's base URL for ease of comparison.
|
|
|
1374 |
sTempBaseURL = Left(baseURL, Len(baseURL)-1)
|
|
|
1375 |
' Removes the project's base URL from the URL specified (if it's present).
|
|
|
1376 |
codeReviewURL = Replace(sCodeReviewURL, sTempBaseURL, "")
|
|
|
1377 |
' Removes the slash from the beginning of the resulting URL (if it's present).
|
|
|
1378 |
If InStr(codeReviewURL, "/") = 1 Then
|
|
|
1379 |
codeReviewURL = Replace(codeReviewURL, "/", "", 1, 1)
|
|
|
1380 |
End If
|
| 119 |
ghuddy |
1381 |
|
| 129 |
ghuddy |
1382 |
' If the URL doesn't contain the http:// prefix, assume that it's correct.
|
|
|
1383 |
If NOT httpRegEx.Test(codeReviewURL) AND Len(codeReviewURL) > 0 Then
|
|
|
1384 |
isValid = True
|
|
|
1385 |
Else
|
|
|
1386 |
' If the URL still contains the http:// prefix and is longer than the base
|
|
|
1387 |
' URL, assume that it is an invalid URL because of a differing base URL.
|
|
|
1388 |
If Len(sCodeReviewURL) > Len(baseURL) Then
|
|
|
1389 |
Response.Write("<script type='text/javascript'>alert('Incorrect Base URL\n\nMust start with project\'s base url (" & baseURL &") if full URL specified.')</script>")
|
|
|
1390 |
Else
|
|
|
1391 |
' If the URL still contains the http:// prefix and is shorter than the base
|
|
|
1392 |
' URL, assume that it is incomplete.
|
|
|
1393 |
Response.Write("<script type='text/javascript'>alert('Incomplete Code Review URL')</script>")
|
|
|
1394 |
End If
|
|
|
1395 |
' Otherwise, the URL matches the base URL exactly, which is also invalid.
|
|
|
1396 |
codeReviewURL = sCodeReviewURL
|
|
|
1397 |
isValid = False
|
|
|
1398 |
End If
|
|
|
1399 |
ValidateCodeReviewURL = isValid
|
| 119 |
ghuddy |
1400 |
End Function
|
|
|
1401 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
1402 |
Function Is_Page_Editable ( cDlocked )
|
| 129 |
ghuddy |
1403 |
' Editable if ( (unlocked OR rejected)
|
|
|
1404 |
' OR ( NOT released/locked AND EditReleaseNotesInPending allowed)
|
|
|
1405 |
' OR (released/locked AND EditNonCriticalInfoForLockedPackage allowed)
|
|
|
1406 |
' )
|
|
|
1407 |
' AND user logged in
|
| 5061 |
dpurdie |
1408 |
If (((cDlocked = "N") OR (cDlocked = "R")) OR ((cDlocked <> "Y") AND (canActionControlInProject("EditReleaseNotesInPending"))) OR ((cDlocked = "Y") AND (canActionControlInProject("EditNonCriticalInfoForLockedPackage")))) AND objAccessControl.UserLogedIn Then
|
| 129 |
ghuddy |
1409 |
Is_Page_Editable = TRUE
|
|
|
1410 |
Else
|
|
|
1411 |
Is_Page_Editable = FALSE
|
|
|
1412 |
End If
|
| 119 |
ghuddy |
1413 |
End Function
|
|
|
1414 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
1415 |
Function Is_Section_Editable ( )
|
| 129 |
ghuddy |
1416 |
If scriptName = "fixed_issues.asp" AND objAccessControl.UserLogedIn Then
|
|
|
1417 |
Is_Section_Editable = TRUE
|
|
|
1418 |
Else
|
|
|
1419 |
Is_Section_Editable = FALSE
|
|
|
1420 |
End If
|
| 119 |
ghuddy |
1421 |
End Function
|
|
|
1422 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
1423 |
Function Is_Critical_Section_Editable ( cDlocked )
|
| 129 |
ghuddy |
1424 |
' Editable if ( (unlocked OR rejected)
|
|
|
1425 |
' OR ( NOT released/locked AND EditReleaseNotesInPending allowed)
|
|
|
1426 |
' OR (released/locked AND EditCriticalInfoForLockedPackage allowed)
|
|
|
1427 |
' )
|
|
|
1428 |
' AND user logged in
|
| 5061 |
dpurdie |
1429 |
If (((cDlocked = "N") OR (cDlocked = "R")) OR ((cDlocked <> "Y") AND (canActionControlInProject("EditReleaseNotesInPending"))) OR ((cDlocked = "Y") AND (canActionControlInProject("EditCriticalInfoForLockedPackage")))) AND objAccessControl.UserLogedIn Then
|
| 129 |
ghuddy |
1430 |
Is_Critical_Section_Editable = TRUE
|
|
|
1431 |
Else
|
|
|
1432 |
Is_Critical_Section_Editable = FALSE
|
|
|
1433 |
End If
|
| 119 |
ghuddy |
1434 |
End Function
|
|
|
1435 |
|
|
|
1436 |
'---------------------------------------------------------------
|
|
|
1437 |
' Function: Codestriker_Command
|
|
|
1438 |
'
|
|
|
1439 |
' Purpose: Forms a codestriker differencing command for use when
|
|
|
1440 |
' preparing codestriker reviews. This will be used mainly
|
|
|
1441 |
' on release notes pages.
|
|
|
1442 |
'
|
|
|
1443 |
' Arguments: old_label : The previous or older label
|
|
|
1444 |
' new_label : The current or newer label
|
|
|
1445 |
'
|
|
|
1446 |
Function Codestriker_Command (oldLabel, new_label)
|
|
|
1447 |
|
| 129 |
ghuddy |
1448 |
If ( IsNull(new_label) ) Then
|
|
|
1449 |
Codestriker_Command = "Label not defined"
|
|
|
1450 |
ElseIf (IsNull(oldLabel) OR oldLabel = "" ) Then
|
|
|
1451 |
Codestriker_Command = "jats CCdiff -new=" & new_label
|
|
|
1452 |
Else
|
|
|
1453 |
Codestriker_Command = "jats CCdiff -old=" & oldLabel & " -new=" & new_label
|
|
|
1454 |
End If
|
| 119 |
ghuddy |
1455 |
End Function
|
|
|
1456 |
|
|
|
1457 |
'---------------------------------------------------------------
|
|
|
1458 |
' Function: getLastNonRippleVersionPVID
|
|
|
1459 |
'
|
|
|
1460 |
' Purpose: returns the last non-ripple version of the package
|
|
|
1461 |
'
|
|
|
1462 |
' Arguments: this_pv_id : string
|
|
|
1463 |
'
|
|
|
1464 |
' Notes: In the past, users used to manually perform ripple builds.
|
|
|
1465 |
' This function does not detect those as ripples. It could be
|
|
|
1466 |
' made to do so but it would not be reliable. For example, it
|
|
|
1467 |
' could check to see if the word "ripple" appears in the
|
|
|
1468 |
' comments field of the record set of the SWL query. That
|
|
|
1469 |
' might catch some of those records, but assumes the user
|
|
|
1470 |
' wrote the wor ripple into the comments (reason for version).
|
|
|
1471 |
'
|
|
|
1472 |
Function getLastNonRippleVersionPVID( this_pv_id )
|
| 129 |
ghuddy |
1473 |
Dim queryResult
|
|
|
1474 |
Dim queryString
|
|
|
1475 |
Dim finalPVID
|
|
|
1476 |
Dim lastPVID
|
| 119 |
ghuddy |
1477 |
|
| 129 |
ghuddy |
1478 |
' default return value in case we never get into the loop
|
|
|
1479 |
finalPVID = this_pv_id
|
| 119 |
ghuddy |
1480 |
|
| 129 |
ghuddy |
1481 |
' Get record for this PVID
|
| 157 |
ghuddy |
1482 |
queryString = "SELECT build_type, last_pv_id FROM package_versions WHERE pv_id = " & this_pv_id
|
| 119 |
ghuddy |
1483 |
|
| 129 |
ghuddy |
1484 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
| 119 |
ghuddy |
1485 |
|
| 129 |
ghuddy |
1486 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
| 119 |
ghuddy |
1487 |
|
| 129 |
ghuddy |
1488 |
' If this version is a ripple built version, begin the process of finding its ancestral non-ripple built version
|
|
|
1489 |
If (queryResult("build_type") = "Y") Then
|
| 119 |
ghuddy |
1490 |
|
| 129 |
ghuddy |
1491 |
lastPVID = queryResult("last_pv_id")
|
| 119 |
ghuddy |
1492 |
|
| 129 |
ghuddy |
1493 |
' We know we have some ripple built versions now, so arm the finalPVID for loop control
|
|
|
1494 |
finalPVID = ""
|
| 119 |
ghuddy |
1495 |
|
| 129 |
ghuddy |
1496 |
' Work back through the version history until we hit a record that is not a ripple build version
|
|
|
1497 |
Do While ((NOT queryResult.BOF) AND (NOT queryResult.EOF) AND (NOT IsNull(lastPVID)) AND (finalPVID = ""))
|
| 119 |
ghuddy |
1498 |
|
| 157 |
ghuddy |
1499 |
queryString = "SELECT build_type, last_pv_id FROM package_versions WHERE pv_id = " & lastPVID
|
| 119 |
ghuddy |
1500 |
|
| 129 |
ghuddy |
1501 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
| 119 |
ghuddy |
1502 |
|
| 129 |
ghuddy |
1503 |
' if the package version is a ripple built one, go round the loop again, else trigger a loop exit
|
|
|
1504 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF) AND ( queryResult("build_type") = "Y")) Then
|
|
|
1505 |
lastPVID = queryResult("last_pv_id")
|
|
|
1506 |
Else
|
|
|
1507 |
finalPVID = lastPVID
|
|
|
1508 |
End If
|
|
|
1509 |
Loop
|
|
|
1510 |
End If
|
|
|
1511 |
End If
|
| 119 |
ghuddy |
1512 |
|
| 129 |
ghuddy |
1513 |
queryResult.Close()
|
|
|
1514 |
Set queryResult = nothing
|
| 119 |
ghuddy |
1515 |
|
| 129 |
ghuddy |
1516 |
getLastNonRippleVersionPVID = finalPVID
|
| 119 |
ghuddy |
1517 |
End Function
|
|
|
1518 |
|
| 159 |
ghuddy |
1519 |
Function getLastNonRippleVersionPVIDLimitedByDate( this_pv_id, limitDate )
|
|
|
1520 |
Dim queryResult
|
|
|
1521 |
Dim queryString
|
|
|
1522 |
Dim finalPVID
|
|
|
1523 |
Dim lastPVID
|
|
|
1524 |
|
|
|
1525 |
' default return value in case we never get into the loop
|
|
|
1526 |
finalPVID = this_pv_id
|
|
|
1527 |
|
|
|
1528 |
' Get record for this PVID
|
|
|
1529 |
queryString = "SELECT build_type, last_pv_id FROM package_versions WHERE pv_id = " & this_pv_id
|
|
|
1530 |
|
|
|
1531 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
|
|
1532 |
|
|
|
1533 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1534 |
|
|
|
1535 |
' If this version is a ripple built version, begin the process of finding its ancestral non-ripple built version
|
|
|
1536 |
If (queryResult("build_type") = "Y") Then
|
|
|
1537 |
|
|
|
1538 |
lastPVID = queryResult("last_pv_id")
|
|
|
1539 |
|
|
|
1540 |
' We know we have some ripple built versions now, so arm the finalPVID for loop control
|
|
|
1541 |
finalPVID = ""
|
|
|
1542 |
|
|
|
1543 |
' Work back through the version history until we hit a record that is not a ripple build version
|
|
|
1544 |
Do While ((NOT queryResult.BOF) AND (NOT queryResult.EOF) AND (NOT IsNull(lastPVID)) AND (finalPVID = ""))
|
|
|
1545 |
|
|
|
1546 |
queryString = "SELECT build_type, last_pv_id FROM package_versions "&_
|
|
|
1547 |
" WHERE pv_id = " & lastPVID &_
|
|
|
1548 |
" AND MODIFIED_STAMP >= TO_DATE('" & limitDate & "','DD/MM/YYYY')"
|
|
|
1549 |
|
|
|
1550 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
|
|
1551 |
|
|
|
1552 |
' if the package version is a ripple built one, go round the loop again, else trigger a loop exit
|
|
|
1553 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF) AND ( queryResult("build_type") = "Y")) Then
|
|
|
1554 |
lastPVID = queryResult("last_pv_id")
|
|
|
1555 |
Else
|
|
|
1556 |
finalPVID = lastPVID
|
|
|
1557 |
End If
|
|
|
1558 |
Loop
|
|
|
1559 |
End If
|
|
|
1560 |
End If
|
|
|
1561 |
|
|
|
1562 |
queryResult.Close()
|
|
|
1563 |
Set queryResult = nothing
|
|
|
1564 |
|
|
|
1565 |
getLastNonRippleVersionPVIDLimitedByDate = finalPVID
|
|
|
1566 |
End Function
|
|
|
1567 |
|
|
|
1568 |
|
| 119 |
ghuddy |
1569 |
'---------------------------------------------------------------
|
|
|
1570 |
' Function: getPreviousVersionPVID
|
|
|
1571 |
'
|
|
|
1572 |
' Purpose: returns the immediate predecssor version of the given
|
|
|
1573 |
' package version
|
|
|
1574 |
'
|
|
|
1575 |
' Arguments: this_pv_id : string
|
|
|
1576 |
'
|
|
|
1577 |
' Notes:
|
|
|
1578 |
'
|
|
|
1579 |
Function getPreviousVersionPVID( this_pv_id )
|
| 129 |
ghuddy |
1580 |
Dim queryResult
|
|
|
1581 |
Dim queryString
|
| 119 |
ghuddy |
1582 |
|
| 129 |
ghuddy |
1583 |
getPreviousVersionPVID = ""
|
| 119 |
ghuddy |
1584 |
|
| 157 |
ghuddy |
1585 |
queryString = "SELECT last_pv_id FROM package_versions WHERE pv_id = " & this_pv_id
|
| 119 |
ghuddy |
1586 |
|
| 129 |
ghuddy |
1587 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
| 119 |
ghuddy |
1588 |
|
| 129 |
ghuddy |
1589 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1590 |
getPreviousVersionPVID = queryResult("last_pv_id")
|
|
|
1591 |
End If
|
| 119 |
ghuddy |
1592 |
|
| 129 |
ghuddy |
1593 |
queryResult.Close()
|
|
|
1594 |
Set queryResult = nothing
|
| 119 |
ghuddy |
1595 |
|
|
|
1596 |
End Function
|
|
|
1597 |
|
|
|
1598 |
'---------------------------------------------------------------
|
| 129 |
ghuddy |
1599 |
' Function: getLastSignificantPVID
|
|
|
1600 |
'
|
|
|
1601 |
' Purpose: Returns the last significant (man-made) version (PV_ID) that
|
|
|
1602 |
' is a predecessor to the specified pv_id
|
|
|
1603 |
'
|
|
|
1604 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1605 |
' last_pv_id : Uniquely identifies the predecssor of this package version
|
|
|
1606 |
' Notes:
|
|
|
1607 |
'
|
|
|
1608 |
Function getLastSignificantPVID (pv_id, last_pv_id)
|
|
|
1609 |
|
|
|
1610 |
getLastSignificantPVID = ""
|
|
|
1611 |
|
|
|
1612 |
If( (NOT IsNull(last_pv_id)) AND (last_pv_id <> pv_id) ) Then
|
|
|
1613 |
|
|
|
1614 |
' Get the pv_id for the current version, and if necessary, work back through any ripple versions as necessary
|
|
|
1615 |
' to get a non-ripple version ancestor
|
|
|
1616 |
pv_id = getLastNonRippleVersionPVID( pv_id )
|
|
|
1617 |
If (pv_id <> "") Then
|
|
|
1618 |
' get the pv_id of the previous version to the non-ripple version ancestor we just found.
|
|
|
1619 |
' It does not matter if we get a ripple version here. It is good enough to serve the purpose of version diff'ing
|
|
|
1620 |
pv_id = getPreviousVersionPVID( pv_id )
|
|
|
1621 |
If (pv_id <> "") Then
|
|
|
1622 |
getLastSignificantPVID = pv_id
|
|
|
1623 |
End If
|
|
|
1624 |
End If
|
|
|
1625 |
|
|
|
1626 |
End If
|
|
|
1627 |
|
|
|
1628 |
End Function
|
|
|
1629 |
'---------------------------------------------------------------
|
|
|
1630 |
' Function: get_Pkg_Label
|
|
|
1631 |
'
|
|
|
1632 |
' Purpose: Returns the package label for the specified pv_id
|
|
|
1633 |
'
|
|
|
1634 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1635 |
'
|
|
|
1636 |
Function get_Pkg_Label (pv_id)
|
|
|
1637 |
Dim queryResult
|
|
|
1638 |
Dim queryString
|
|
|
1639 |
|
|
|
1640 |
get_Pkg_Label = ""
|
|
|
1641 |
|
|
|
1642 |
' Get the package label from the package versions table
|
|
|
1643 |
queryString = "SELECT pkg_label FROM package_versions WHERE pv_id = " & pv_id
|
|
|
1644 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
|
|
1645 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1646 |
get_Pkg_Label = queryResult("pkg_label")
|
|
|
1647 |
End If
|
|
|
1648 |
queryResult.Close()
|
|
|
1649 |
Set queryResult = nothing
|
|
|
1650 |
End Function
|
|
|
1651 |
'---------------------------------------------------------------
|
|
|
1652 |
' Function: get_Src_Path
|
|
|
1653 |
'
|
|
|
1654 |
' Purpose: Returns the source path for the specified pv_id
|
|
|
1655 |
'
|
|
|
1656 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1657 |
'
|
|
|
1658 |
Function get_Src_Path (pv_id)
|
|
|
1659 |
Dim queryResult
|
|
|
1660 |
Dim queryString
|
|
|
1661 |
|
|
|
1662 |
get_Src_Path = ""
|
|
|
1663 |
|
|
|
1664 |
' Get the source path from package versions table
|
|
|
1665 |
queryString = "SELECT src_path FROM package_versions WHERE pv_id = " & pv_id
|
|
|
1666 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
|
|
1667 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1668 |
get_Src_Path = queryResult("src_path")
|
|
|
1669 |
End If
|
|
|
1670 |
queryResult.Close()
|
|
|
1671 |
Set queryResult = nothing
|
|
|
1672 |
End Function
|
|
|
1673 |
|
|
|
1674 |
'---------------------------------------------------------------
|
| 119 |
ghuddy |
1675 |
' Function: getOldLabel
|
|
|
1676 |
'
|
|
|
1677 |
' Purpose: Returns the previous label; if none then returns empty string
|
|
|
1678 |
'
|
|
|
1679 |
' Since this operation is designed to fulfil the generation of
|
|
|
1680 |
' diff commands, there is no point in considering ripple
|
|
|
1681 |
' versions, since the only differences we find there are in
|
|
|
1682 |
' the build.pl files (for example). So, this function uses
|
|
|
1683 |
' some underlying methods that ignore ripple built versions
|
|
|
1684 |
' therefore concentrating on versions that someone has manually
|
|
|
1685 |
' gone and labelled, presumably because they changed some
|
|
|
1686 |
' source file other than build.pl.
|
|
|
1687 |
'
|
|
|
1688 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1689 |
' last_pv_id : Uniquely identifies the predecssor of this package version
|
|
|
1690 |
' Notes:
|
|
|
1691 |
'
|
|
|
1692 |
Function getOldLabel (pv_id, last_pv_id)
|
| 129 |
ghuddy |
1693 |
Dim lastSignificantPVID
|
| 119 |
ghuddy |
1694 |
|
| 129 |
ghuddy |
1695 |
getOldLabel = ""
|
| 119 |
ghuddy |
1696 |
|
| 129 |
ghuddy |
1697 |
lastSignificantPVID = getLastSignificantPVID(pv_id, last_pv_id)
|
|
|
1698 |
If (lastSignificantPVID <> "") Then
|
|
|
1699 |
getOldLabel = get_Pkg_Label(lastSignificantPVID)
|
|
|
1700 |
End If
|
|
|
1701 |
End Function
|
|
|
1702 |
'---------------------------------------------------------------
|
|
|
1703 |
' Function: getOldSrcPath
|
|
|
1704 |
'
|
|
|
1705 |
' Purpose: Returns the previous src path; if none then returns empty string
|
|
|
1706 |
'
|
|
|
1707 |
' Since this operation is designed to fulfil the generation of
|
|
|
1708 |
' diff commands, there is no point in considering ripple
|
|
|
1709 |
' versions, since the only differences we find there are in
|
|
|
1710 |
' the build.pl files (for example). So, this function uses
|
|
|
1711 |
' some underlying methods that ignore ripple built versions
|
|
|
1712 |
' therefore concentrating on versions that someone has manually
|
|
|
1713 |
' gone and labelled, presumably because they changed some
|
|
|
1714 |
' source file other than build.pl.
|
|
|
1715 |
'
|
|
|
1716 |
' NOTE: With SubVersion, the src_path column in the package_versions
|
|
|
1717 |
' table will be used to hold the Subversion tag. This function
|
|
|
1718 |
' will therefore be used mostly when a package version is
|
|
|
1719 |
' controlled under subversion.
|
|
|
1720 |
'
|
|
|
1721 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1722 |
' last_pv_id : Uniquely identifies the predecssor of this package version
|
|
|
1723 |
' Notes:
|
|
|
1724 |
'
|
|
|
1725 |
Function getOldSrcPath (pv_id, last_pv_id)
|
|
|
1726 |
Dim lastSignificantPVID
|
| 119 |
ghuddy |
1727 |
|
| 129 |
ghuddy |
1728 |
getOldSrcPath = ""
|
| 119 |
ghuddy |
1729 |
|
| 129 |
ghuddy |
1730 |
lastSignificantPVID = getLastSignificantPVID(pv_id, last_pv_id)
|
|
|
1731 |
If (lastSignificantPVID <> "") Then
|
|
|
1732 |
getOldSrcPath = get_Src_Path(lastSignificantPVID)
|
|
|
1733 |
End If
|
|
|
1734 |
End Function
|
|
|
1735 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1736 |
Sub vcs_info_from_vcs_tag( nVcs_tag, ByRef objDetails )
|
|
|
1737 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
1738 |
|
| 129 |
ghuddy |
1739 |
Query_String = " SELECT * FROM vcs_type WHERE tag = '"& nVcs_tag &"'"
|
|
|
1740 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1741 |
If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
|
|
|
1742 |
objDetails.Item("vcs_type_id") = rsTemp("vcs_type_id")
|
|
|
1743 |
objDetails.Item("vcs_name") = rsTemp("name")
|
|
|
1744 |
objDetails.Item("vcs_tag") = rsTemp("tag")
|
|
|
1745 |
Else
|
| 141 |
ghuddy |
1746 |
Call RaiseMsg(enum_MSG_ERROR, "Database does not contain a record of the VCS tag : " & nVcs_tag )
|
| 129 |
ghuddy |
1747 |
End If
|
|
|
1748 |
rsTemp.Close()
|
|
|
1749 |
set rsTemp = nothing
|
|
|
1750 |
End Sub
|
|
|
1751 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1752 |
Sub vcs_info_from_vcs_type_id( nVcs_type_id, ByRef objDetails )
|
|
|
1753 |
Dim rsTemp, Query_String
|
|
|
1754 |
|
|
|
1755 |
If NOT IsNull(nVcs_type_id) Then
|
|
|
1756 |
Query_String = " SELECT * FROM vcs_type WHERE vcs_type_id = "& nVcs_type_id
|
|
|
1757 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1758 |
If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
|
|
|
1759 |
objDetails.Item("vcs_type_id") = rsTemp("vcs_type_id")
|
|
|
1760 |
objDetails.Item("vcs_name") = rsTemp("name")
|
|
|
1761 |
objDetails.Item("vcs_tag") = rsTemp("tag")
|
|
|
1762 |
Else
|
| 141 |
ghuddy |
1763 |
Call RaiseMsg(enum_MSG_ERROR, "Database does not contain a record of the VCS type ID : " & nVcs_type_id )
|
| 129 |
ghuddy |
1764 |
End If
|
|
|
1765 |
rsTemp.Close()
|
|
|
1766 |
set rsTemp = nothing
|
|
|
1767 |
Else
|
| 3616 |
dpurdie |
1768 |
' default to returning Subversion info, assuming it exists in the data
|
|
|
1769 |
Call vcs_info_from_vcs_tag( enum_VCS_SUBVERSION_TAG, objDetails )
|
| 129 |
ghuddy |
1770 |
End If
|
|
|
1771 |
End Sub
|
|
|
1772 |
'----------------------------------------------------------------------------------------------------------------------
|
| 137 |
ghuddy |
1773 |
Sub get_vcs_info_for_package( nPkgLabel, nBuildType, nVcsTypeId, nDLocked, ByRef objDetails )
|
| 129 |
ghuddy |
1774 |
' lots of patch versions exist with N/A as their pkg_label and null as vcs_type_id. These are all uncontrolled
|
|
|
1775 |
' packages published directly into dpkg_archive with no controlled source under clearcase, so we want to treat
|
|
|
1776 |
' them as uncontrolled if possible.
|
| 137 |
ghuddy |
1777 |
If nDLocked = "Y" AND ((nPkgLabel = "N/A") OR IsNull(nPkgLabel)) AND nBuildType = "M" AND IsNull(nVcsTypeId) Then
|
| 129 |
ghuddy |
1778 |
Call vcs_info_from_vcs_tag( enum_VCS_UNCONTROLLED_TAG, objDetails )
|
|
|
1779 |
Else
|
|
|
1780 |
' Otherwise, try and decode the VCS from the package's vcs_type_id entry from the package version table
|
|
|
1781 |
' NOTE: A null vcs_type_id entry will default to ClearCase. That is all we have been using up til now so
|
|
|
1782 |
' it should be safe.
|
|
|
1783 |
Call vcs_info_from_vcs_type_id( nVcsTypeId, objDetails )
|
|
|
1784 |
End If
|
|
|
1785 |
End Sub
|
|
|
1786 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1787 |
Sub get_vcs_info_for_pv_id( nPv_id, ByRef objDetails )
|
|
|
1788 |
Dim rsTemp, Query_String
|
|
|
1789 |
|
|
|
1790 |
Query_String = _
|
| 137 |
ghuddy |
1791 |
" SELECT pv.pkg_label, pv.build_type, pv.vcs_type_id, pv.dlocked "&_
|
| 129 |
ghuddy |
1792 |
" FROM PACKAGE_VERSIONS pv"&_
|
|
|
1793 |
" WHERE pv.pv_id = "& nPv_id
|
|
|
1794 |
|
|
|
1795 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1796 |
If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
|
| 137 |
ghuddy |
1797 |
Call get_vcs_info_for_package( rsTemp("pkg_label"), rsTemp("build_type"), rsTemp("vcs_type_id"), rsTemp("dlocked"), objDetails )
|
| 129 |
ghuddy |
1798 |
Else
|
|
|
1799 |
Call RaiseMsg(enum_MSG_ERROR, "PV_ID (" & nPv_id & ") Not Found")
|
|
|
1800 |
End If
|
|
|
1801 |
rsTemp.Close()
|
|
|
1802 |
set rsTemp = nothing
|
|
|
1803 |
End Sub
|
|
|
1804 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1805 |
Function get_vcs_tag( nPv_id )
|
|
|
1806 |
Dim tempVcsInfoCollector
|
|
|
1807 |
Set tempVcsInfoCollector = CreateObject("Scripting.Dictionary")
|
|
|
1808 |
|
|
|
1809 |
Call get_vcs_info_for_pv_id( nPv_id, tempVcsInfoCollector )
|
|
|
1810 |
get_vcs_tag = tempVcsInfoCollector.Item("vcs_tag")
|
|
|
1811 |
|
|
|
1812 |
Set tempVcsInfoCollector = nothing
|
| 119 |
ghuddy |
1813 |
End Function
|
| 129 |
ghuddy |
1814 |
'----------------------------------------------------------------------------------------------------------------------
|
| 143 |
ghuddy |
1815 |
Function isInDoNotRippleTable( NNrtag_id, NNpv_id )
|
|
|
1816 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
1817 |
|
| 143 |
ghuddy |
1818 |
isInDoNotRippleTable = FALSE
|
|
|
1819 |
|
|
|
1820 |
If NNrtag_id <> "" AND NNpv_id <> "" Then
|
|
|
1821 |
Query_String = " SELECT dnr.pv_id FROM DO_NOT_RIPPLE dnr WHERE dnr.RTAG_ID ="& NNrtag_id &" AND dnr.PV_ID ="& NNpv_id
|
|
|
1822 |
|
|
|
1823 |
Set rsTemp = OraDatabase.DbCreateDynaset(Query_String, cint(0))
|
|
|
1824 |
If rsTemp.RecordCount <> 0 Then
|
|
|
1825 |
isInDoNotRippleTable = TRUE
|
|
|
1826 |
End If
|
|
|
1827 |
rsTemp.Close()
|
|
|
1828 |
set rsTemp = nothing
|
|
|
1829 |
End If
|
|
|
1830 |
End Function
|
| 145 |
ghuddy |
1831 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1832 |
Function pv_id_exists( nPv_id )
|
|
|
1833 |
Dim rsTemp, Query_String
|
| 143 |
ghuddy |
1834 |
|
| 145 |
ghuddy |
1835 |
If NOT IsNull( nPv_id ) AND nPv_id <> "" Then
|
|
|
1836 |
Query_String = _
|
|
|
1837 |
" SELECT pv.pv_id "&_
|
|
|
1838 |
" FROM PACKAGE_VERSIONS pv"&_
|
|
|
1839 |
" WHERE pv.pv_id = "& nPv_id
|
|
|
1840 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1841 |
If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
|
|
|
1842 |
pv_id_exists = TRUE
|
|
|
1843 |
Else
|
|
|
1844 |
pv_id_exists = FALSE
|
|
|
1845 |
End If
|
|
|
1846 |
rsTemp.Close()
|
|
|
1847 |
set rsTemp = nothing
|
|
|
1848 |
Else
|
|
|
1849 |
pv_id_exists = FALSE
|
|
|
1850 |
End If
|
|
|
1851 |
End Function
|
|
|
1852 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1853 |
Function is_daemon_enabled_release( NNrtag_id, defaultReturnValue )
|
|
|
1854 |
Dim rsTemp, Query_String
|
| 143 |
ghuddy |
1855 |
|
| 145 |
ghuddy |
1856 |
If NOT IsNull( NNrtag_id ) AND NNrtag_id <> "" Then
|
| 143 |
ghuddy |
1857 |
|
| 145 |
ghuddy |
1858 |
Query_String = _
|
| 4293 |
dpurdie |
1859 |
" SELECT rc.bmcon_id "&_
|
| 145 |
ghuddy |
1860 |
" FROM RELEASE_CONFIG rc"&_
|
|
|
1861 |
" WHERE rc.rtag_id = "& NNrtag_id
|
|
|
1862 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1863 |
|
|
|
1864 |
is_daemon_enabled_release = FALSE
|
|
|
1865 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF) AND (is_daemon_enabled_release = FALSE))
|
| 4293 |
dpurdie |
1866 |
If (NOT IsNull(rsTemp("bmcon_id"))) AND (rsTemp("bmcon_id") <> "") Then
|
| 145 |
ghuddy |
1867 |
is_daemon_enabled_release = TRUE
|
|
|
1868 |
End If
|
|
|
1869 |
rsTemp.MoveNext
|
|
|
1870 |
WEnd
|
|
|
1871 |
|
|
|
1872 |
rsTemp.Close()
|
|
|
1873 |
set rsTemp = nothing
|
|
|
1874 |
Else
|
|
|
1875 |
is_daemon_enabled_release = defaultReturnValue
|
|
|
1876 |
End If
|
|
|
1877 |
End Function
|
| 147 |
ghuddy |
1878 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
1879 |
' Convert release state into a meaningful string
|
|
|
1880 |
Function Get_Official( nOfficial )
|
|
|
1881 |
If nOfficial = "N" Then
|
|
|
1882 |
Get_Official = "Open"
|
|
|
1883 |
ElseIf nOfficial = "A" Then
|
|
|
1884 |
Get_Official = "Archive"
|
|
|
1885 |
ElseIf nOfficial = "C" Then
|
|
|
1886 |
Get_Official = "CCB"
|
|
|
1887 |
ElseIf nOfficial = "R" Then
|
|
|
1888 |
Get_Official = "Restricted"
|
|
|
1889 |
ElseIf nOfficial = "Y" Then
|
|
|
1890 |
Get_Official = "Closed"
|
|
|
1891 |
Else
|
|
|
1892 |
Get_Official = "?"
|
|
|
1893 |
End If
|
|
|
1894 |
End Function
|
| 151 |
ghuddy |
1895 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1896 |
Function Get_Pkg_Id_For_Pv_Id ( NNpv_id )
|
|
|
1897 |
Dim rsTemp, Query_String
|
| 145 |
ghuddy |
1898 |
|
| 151 |
ghuddy |
1899 |
Get_Pkg_Id_For_Pv_Id = ""
|
| 145 |
ghuddy |
1900 |
|
| 151 |
ghuddy |
1901 |
If NOT IsNull(NNpv_id) AND NNpv_id <> "" Then
|
|
|
1902 |
Query_String = _
|
|
|
1903 |
"SELECT pkg_id FROM package_versions WHERE pv_id = "& NNpv_id
|
|
|
1904 |
|
|
|
1905 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1906 |
|
|
|
1907 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
1908 |
Get_Pkg_Id_For_Pv_Id = rsTemp("pkg_id")
|
|
|
1909 |
End If
|
|
|
1910 |
rsTemp.Close
|
|
|
1911 |
Set rsTemp = nothing
|
|
|
1912 |
End If
|
|
|
1913 |
|
|
|
1914 |
End Function
|
|
|
1915 |
|
| 171 |
brianf |
1916 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 161 |
iaugusti |
1917 |
Function iif(bFlag, sTrueStr, sFalseStr)
|
|
|
1918 |
if bFlag then
|
|
|
1919 |
iif = sTrueStr
|
|
|
1920 |
else
|
|
|
1921 |
iif = sFalseStr
|
|
|
1922 |
end if
|
|
|
1923 |
End Function
|
| 151 |
ghuddy |
1924 |
|
| 171 |
brianf |
1925 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
1926 |
' Sets the state of all build daemons of the specified release
|
|
|
1927 |
Sub SetDaemonStates (artag_id,astate)
|
|
|
1928 |
On Error Resume Next
|
|
|
1929 |
OraDatabase.Parameters.Add "RTAG_ID", artag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
1930 |
OraDatabase.Parameters.Add "NSTATE", astate, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
1931 |
|
|
|
1932 |
objEH.TryORA ( OraSession )
|
|
|
1933 |
|
|
|
1934 |
OraDatabase.ExecuteSQL _
|
|
|
1935 |
"BEGIN PK_BUILDAPI.SET_DAEMON_STATES(:RTAG_ID,:NSTATE); END;"
|
|
|
1936 |
|
|
|
1937 |
objEH.CatchORA ( OraSession )
|
|
|
1938 |
|
|
|
1939 |
OraDatabase.Parameters.Remove "RTAG_Id"
|
|
|
1940 |
OraDatabase.Parameters.Remove "NSTATE"
|
|
|
1941 |
End Sub
|
|
|
1942 |
|
| 183 |
brianf |
1943 |
'----------------------------------------------
|
|
|
1944 |
'Returns true if the specified package version exists in the specified table
|
|
|
1945 |
Function PackageExists(RtagId, pvId, stable)
|
|
|
1946 |
Dim rsTemp
|
|
|
1947 |
Dim sqry
|
| 185 |
brianf |
1948 |
If RtagId = "" Then
|
|
|
1949 |
PackageExists = False
|
|
|
1950 |
Else
|
|
|
1951 |
sqry = "SELECT * FROM " & stable & " WHERE rtag_id = " & RtagId & " AND pv_id = " & pvId
|
|
|
1952 |
Set rsTemp = OraDatabase.DbCreateDynaset(sqry,CInt(0))
|
|
|
1953 |
PackageExists = rsTemp.RecordCount > 0
|
|
|
1954 |
rsTemp.Close()
|
|
|
1955 |
Set rsTemp = Nothing
|
|
|
1956 |
End If
|
| 183 |
brianf |
1957 |
End Function
|
|
|
1958 |
|
| 4710 |
dpurdie |
1959 |
'----------------------------------------------
|
|
|
1960 |
' Test that specified package/version exists in dpkg_archive
|
| 5245 |
dpurdie |
1961 |
' Can also test presence of the archive
|
| 4710 |
dpurdie |
1962 |
' Use http interface as it does not require authetication
|
|
|
1963 |
Function testArchiveAccessPkg(pkgName, pkgVersion)
|
|
|
1964 |
Dim oXMLHTTP
|
|
|
1965 |
Dim testUrl
|
|
|
1966 |
|
|
|
1967 |
testArchiveAccessPkg = False
|
|
|
1968 |
testUrl = dpkg_archiveURL
|
|
|
1969 |
If pkgName <> "" Then
|
|
|
1970 |
testUrl = testUrl & pkgName & "/" & pkgVersion
|
|
|
1971 |
End If
|
|
|
1972 |
Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.3.0")
|
|
|
1973 |
|
| 4756 |
dpurdie |
1974 |
' Use error handling in case dpkg_archive is not available
|
| 4710 |
dpurdie |
1975 |
' Use HEAD to test existence
|
| 4756 |
dpurdie |
1976 |
Err.Clear
|
|
|
1977 |
On Error Resume Next
|
| 4710 |
dpurdie |
1978 |
oXMLHTTP.Open "HEAD", testUrl, False
|
|
|
1979 |
oXMLHTTP.Send
|
|
|
1980 |
|
| 4756 |
dpurdie |
1981 |
' Do not combine the next two If statments - it will not work
|
|
|
1982 |
If Err.Number = 0 Then
|
|
|
1983 |
If oXMLHTTP.Status = 200 Then
|
|
|
1984 |
testArchiveAccessPkg = True
|
|
|
1985 |
End If
|
| 4710 |
dpurdie |
1986 |
End If
|
| 4756 |
dpurdie |
1987 |
On Error Goto 0
|
| 4710 |
dpurdie |
1988 |
End Function
|
| 5008 |
dpurdie |
1989 |
|
|
|
1990 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
1991 |
' Like Cint, but handles NULL by replacing it with a default value
|
|
|
1992 |
Function NiceInt( val, def)
|
| 5045 |
dpurdie |
1993 |
If val <> "" AND IsNumeric(val) Then
|
| 5008 |
dpurdie |
1994 |
NiceInt = CInt(val)
|
|
|
1995 |
Else
|
|
|
1996 |
NiceInt = def
|
|
|
1997 |
End If
|
|
|
1998 |
End Function
|
| 5143 |
dpurdie |
1999 |
|
|
|
2000 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
2001 |
' Test if package can be added to a release
|
|
|
2002 |
' Really tests if a a package of this packages alias can be
|
|
|
2003 |
' manipulated in this release
|
|
|
2004 |
' True: Package alias can be added/replaced in release
|
|
|
2005 |
Function canAddToRelease ( nRtagId, nPvId )
|
| 5156 |
dpurdie |
2006 |
|
|
|
2007 |
' If we don't enough parameters then assume we can add package
|
|
|
2008 |
If nRtagId = "" OR nPvId = "" Then
|
|
|
2009 |
canAddToRelease = TRUE
|
|
|
2010 |
Exit Function
|
|
|
2011 |
End If
|
|
|
2012 |
|
| 5143 |
dpurdie |
2013 |
On Error Resume Next
|
|
|
2014 |
OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
2015 |
OraDatabase.Parameters.Add "PV_ID", nPvId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
2016 |
OraDatabase.Parameters.Add "RETURN_CODE", null, ORAPARM_OUTPUT, ORATYPE_NUMBER
|
|
|
2017 |
|
|
|
2018 |
objEH.TryORA ( OraSession )
|
|
|
2019 |
|
|
|
2020 |
OraDatabase.ExecuteSQL _
|
|
|
2021 |
"BEGIN :RETURN_CODE := PK_RELEASE.CAN_ADD_PKG_TO_RELEASE(:RTAG_ID,:PV_ID); END;"
|
|
|
2022 |
|
|
|
2023 |
If CInt(OraDatabase.Parameters("RETURN_CODE").Value) = 0 Then
|
|
|
2024 |
canAddToRelease = FALSE
|
|
|
2025 |
Else
|
|
|
2026 |
canAddToRelease = TRUE
|
|
|
2027 |
End If
|
|
|
2028 |
|
|
|
2029 |
objEH.CatchORA ( OraSession )
|
|
|
2030 |
|
|
|
2031 |
OraDatabase.Parameters.Remove "RETURN_CODE"
|
|
|
2032 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
2033 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
2034 |
End Function
|
| 5177 |
dpurdie |
2035 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
2036 |
' Returns either the value of the Request('tag') or the default value
|
|
|
2037 |
Function RequestDefault(stag, sdefault)
|
|
|
2038 |
If Request(stag) <> "" Then
|
|
|
2039 |
RequestDefault = Request(stag)
|
|
|
2040 |
Else
|
|
|
2041 |
RequestDefault = sdefault
|
|
|
2042 |
End If
|
|
|
2043 |
End Function
|
| 5178 |
dpurdie |
2044 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
2045 |
' Data structure to assist in the Release Mode Transition Check
|
|
|
2046 |
' Tuples (FromCondition, ToCondition) '-' == Always
|
|
|
2047 |
' Order matches ReleaseModeAccessCheck
|
|
|
2048 |
'
|
|
|
2049 |
Dim RMTD_Data
|
|
|
2050 |
RMTD_Data = Array(Array("-" ,"-"), _
|
|
|
2051 |
Array("ChangeModeFromRestrictive","-"), _
|
|
|
2052 |
Array("ChangeModeFromRestrictive","-"), _
|
|
|
2053 |
Array("ChangeModeFromClosed" ,"ChangeModeToClosed"), _
|
|
|
2054 |
Array("ChangeModeFromClosed" ,"ChangeModeToPreserved"), _
|
|
|
2055 |
Array("ChangeModeFromArchived" ,"ChangeModeToArchived") _
|
|
|
2056 |
)
|
|
|
2057 |
'-------------------------------------------------
|
|
|
2058 |
' Function: ReleaseMode2Index
|
|
|
2059 |
' Description: Convert a enumDB_RELEASE_IN_*** into an index into the above array
|
|
|
2060 |
'
|
|
|
2061 |
Function ReleaseMode2Index( eReleaseMode )
|
|
|
2062 |
If eReleaseMode = enumDB_RELEASE_IN_OPEN_MODE Then
|
|
|
2063 |
ReleaseMode2Index = 0
|
|
|
2064 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_RESTRICTIVE_MODE Then
|
|
|
2065 |
ReleaseMode2Index = 1
|
|
|
2066 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CCB_MODE Then
|
|
|
2067 |
ReleaseMode2Index = 2
|
|
|
2068 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CLOSED_MODE Then
|
|
|
2069 |
ReleaseMode2Index = 3
|
|
|
2070 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_PRESERVE_MODE Then
|
|
|
2071 |
ReleaseMode2Index = 4
|
|
|
2072 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_ARCHIVE_MODE Then
|
|
|
2073 |
ReleaseMode2Index = 5
|
|
|
2074 |
Else
|
|
|
2075 |
ReleaseMode2Index = -1
|
|
|
2076 |
End If
|
|
|
2077 |
End Function
|
|
|
2078 |
|
|
|
2079 |
'-------------------------------------------------
|
|
|
2080 |
' Function: ReleaseModeAccessCheck
|
|
|
2081 |
' Description: Determine if the user can change the Release Mode
|
|
|
2082 |
' from - Start at this Release Mode
|
|
|
2083 |
' to - Can the user transition to this mode
|
|
|
2084 |
' Returns: True - yes they can
|
|
|
2085 |
'
|
|
|
2086 |
Function ReleaseModeAccessCheck( from, toMode )
|
|
|
2087 |
Dim fromIndex : fromIndex = ReleaseMode2Index(from)
|
|
|
2088 |
Dim toIndex : toIndex = ReleaseMode2Index(toMode)
|
|
|
2089 |
ReleaseModeAccessCheck = False
|
|
|
2090 |
|
|
|
2091 |
' Can't Change to same mode
|
|
|
2092 |
If from = toMode Then
|
|
|
2093 |
Exit Function
|
|
|
2094 |
End If
|
|
|
2095 |
|
|
|
2096 |
On Error Resume Next
|
|
|
2097 |
Dim fromAccess : fromAccess = ""
|
|
|
2098 |
Dim toAccess : toAccess = ""
|
|
|
2099 |
|
|
|
2100 |
' Get access type from table
|
|
|
2101 |
' "" - No access (internal error)
|
|
|
2102 |
' "-" - All Access allowed (if user is logged in )
|
|
|
2103 |
' Else - Name of a canActionControlInProject
|
|
|
2104 |
fromAccess = RMTD_Data(fromIndex)(0)
|
|
|
2105 |
toAccess = RMTD_Data(toIndex)(1)
|
|
|
2106 |
|
|
|
2107 |
' Check From Condition
|
|
|
2108 |
If fromAccess = "-" Then
|
|
|
2109 |
ReleaseModeAccessCheck = canActionInProject()
|
|
|
2110 |
ElseIf fromAccess <> "" Then
|
|
|
2111 |
ReleaseModeAccessCheck = canActionControlInProject(fromAccess)
|
|
|
2112 |
End If
|
|
|
2113 |
|
|
|
2114 |
If NOT ReleaseModeAccessCheck Then
|
|
|
2115 |
Exit Function
|
|
|
2116 |
End If
|
|
|
2117 |
|
|
|
2118 |
' Check to Condition
|
|
|
2119 |
If toAccess = "-" Then
|
|
|
2120 |
ReleaseModeAccessCheck = canActionInProject()
|
|
|
2121 |
ElseIf toAccess <> "" Then
|
|
|
2122 |
ReleaseModeAccessCheck = canActionControlInProject(toAccess)
|
|
|
2123 |
End If
|
|
|
2124 |
|
|
|
2125 |
End Function
|
|
|
2126 |
|
|
|
2127 |
'-------------------------------------------------
|
|
|
2128 |
' Function: releaseIsClosed
|
|
|
2129 |
' Description: Determine if a release can be modified at all
|
|
|
2130 |
' Returns: True: Release cannot be modified
|
|
|
2131 |
' ie: it is NOT in a state that allows modification
|
|
|
2132 |
'
|
|
|
2133 |
Function releaseIsClosed(eReleaseMode)
|
|
|
2134 |
If eReleaseMode = enumDB_RELEASE_IN_OPEN_MODE Then
|
|
|
2135 |
releaseIsClosed = False
|
|
|
2136 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_RESTRICTIVE_MODE Then
|
|
|
2137 |
releaseIsClosed = False
|
|
|
2138 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CCB_MODE Then
|
|
|
2139 |
releaseIsClosed = False
|
|
|
2140 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CLOSED_MODE Then
|
|
|
2141 |
releaseIsClosed = True
|
|
|
2142 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_PRESERVE_MODE Then
|
|
|
2143 |
releaseIsClosed = True
|
|
|
2144 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_ARCHIVE_MODE Then
|
|
|
2145 |
releaseIsClosed = True
|
|
|
2146 |
Else
|
|
|
2147 |
releaseIsClosed = True
|
|
|
2148 |
End If
|
|
|
2149 |
End Function
|
|
|
2150 |
|
|
|
2151 |
'-------------------------------------------------
|
|
|
2152 |
' Function: releaseIsWritable
|
|
|
2153 |
' Description: Determine if a release can be modified
|
|
|
2154 |
' Returns: True: Release can be modified
|
|
|
2155 |
' ie: it is in a state that allows modification
|
|
|
2156 |
'
|
|
|
2157 |
Function releaseIsWritable(eReleaseMode)
|
|
|
2158 |
If eReleaseMode = enumDB_RELEASE_IN_OPEN_MODE AND canActionInProject() Then
|
|
|
2159 |
releaseIsWritable = True
|
|
|
2160 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_RESTRICTIVE_MODE AND canActionControlInProject("AlterReleaseContentsInRestrictiveMode") Then
|
|
|
2161 |
releaseIsWritable = True
|
|
|
2162 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CCB_MODE AND canActionControlInProject("AlterReleaseContentsInRestrictiveMode")Then
|
|
|
2163 |
releaseIsWritable = True
|
|
|
2164 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CLOSED_MODE Then
|
|
|
2165 |
releaseIsWritable = False
|
|
|
2166 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_PRESERVE_MODE Then
|
|
|
2167 |
releaseIsWritable = False
|
|
|
2168 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_ARCHIVE_MODE Then
|
|
|
2169 |
releaseIsWritable = False
|
|
|
2170 |
Else
|
|
|
2171 |
releaseIsWritable = False
|
|
|
2172 |
End If
|
|
|
2173 |
End Function
|
|
|
2174 |
|
|
|
2175 |
'-------------------------------------------------
|
|
|
2176 |
' Function: releaseIsMergable
|
|
|
2177 |
' Description: Determine if the user can 'Merge' into the release
|
|
|
2178 |
' Returns: True: Release can be modified
|
|
|
2179 |
' ie: it is in a state that allows modification
|
|
|
2180 |
'
|
|
|
2181 |
Function releaseIsMergable(eReleaseMode)
|
| 5294 |
dpurdie |
2182 |
If eReleaseMode = enumDB_RELEASE_IN_OPEN_MODE AND canActionInProject() Then
|
| 5178 |
dpurdie |
2183 |
releaseIsMergable = True
|
|
|
2184 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_RESTRICTIVE_MODE AND canActionControlInProject("MergeRelease") Then
|
|
|
2185 |
releaseIsMergable = True
|
|
|
2186 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CCB_MODE AND canActionControlInProject("MergeReleaseForCCB") Then
|
|
|
2187 |
releaseIsMergable = True
|
|
|
2188 |
Else
|
|
|
2189 |
releaseIsMergable = False
|
|
|
2190 |
End If
|
|
|
2191 |
End Function
|
| 5251 |
dpurdie |
2192 |
'-------------------------------------------------
|
|
|
2193 |
' Function: RenderLxrStateString
|
|
|
2194 |
' Description: Return a string to show the current LXR state
|
|
|
2195 |
Function RenderLxrStateString(rtagid, lxr, lxrState, txt)
|
|
|
2196 |
If lxr = "N" AND lxrState = "N" Then
|
|
|
2197 |
RenderLxrStateString = ""
|
|
|
2198 |
Else
|
|
|
2199 |
Dim lxrUrl : lxrUrl = LXR_URL & "/" & rtagid
|
|
|
2200 |
Dim image, hover
|
|
|
2201 |
Select Case lxrState
|
|
|
2202 |
Case "I"
|
|
|
2203 |
image = "LXRlogo64.jpeg"
|
|
|
2204 |
hover = "LXR Index available"
|
|
|
2205 |
Case "C"
|
|
|
2206 |
image = "LXRlogo64_off.jpeg"
|
|
|
2207 |
hover = "LXR Index available, but no longer updated"
|
|
|
2208 |
Case "N"
|
|
|
2209 |
image = "LXRlogo64_progress.jpeg"
|
|
|
2210 |
hover = "LXR Requested, but not yet available"
|
|
|
2211 |
Case Else
|
|
|
2212 |
image = "LXRlogo64_progress.jpeg"
|
|
|
2213 |
hover = "LXR Requested, unknown State:(" & lxrState &")"
|
|
|
2214 |
End Select
|
|
|
2215 |
RenderLxrStateString = "<a class=mmItem href='"&lxrUrl&"'><img src=""images/"&image&""" height=16 border=0 vspace=0 hspace=0 style='vertical-align : bottom' title='"&hover&"'>" & txt &"</a>"
|
|
|
2216 |
End If
|
|
|
2217 |
End Function
|
| 5178 |
dpurdie |
2218 |
|
| 119 |
ghuddy |
2219 |
%>
|