Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%
2
'===================================================================
3
'							Package Common
4
'===================================================================
5
%>
6
<!--#include file="../class/classTemplateManager.asp"-->
7
<!--#include file="../class/classTabControl.asp"-->
8
<!--#include file="../class/classActionButtonControl.asp"-->
9
<%
10
'------------ VARIABLE DEFINITION -------------
11
Dim parPv_id
12
Dim nEnvTab			' remember environment tab
13
Dim objBtnControl
14
Dim aTabBtnsDef
15
'------------ CONSTANTS DECLARATION -----------
16
'------------ VARIABLE INIT -------------------
17
parPv_id = Request("pv_id")
18
Set objBtnControl = New ActionButtonControl
19
'------------ CONDITIONS ----------------------
20
'----------------------------------------------
21
%>
22
<%
23
'------------ RUN BEFORE PAGE RENDER ----------
24
 
25
'--- Make sure rtag_id is always present
26
If (Request("rtag_id") = "") AND (Request("pv_id") = "") Then Response.Redirect("index.asp")
27
 
28
 
29
'--- Rebuild Environment
30
If (Request("rtag_id") <> "") Then
31
	Call Rebuild_Environment ( parRtag_id )
32
End If
33
 
34
'--- Persist following parameters between postbacks
35
objPMod.PersistInQryString ( aPersistList(enumPAR_RTAG_ID) )
36
objPMod.PersistInQryString ( aPersistList(enumPAR_PV_ID) )
37
 
38
 
39
'--- Get Environment (lefthand side menu) tab
40
nEnvTab = GetEnvTab ( Request("envtab") )
41
 
42
 
43
'--- Get Package General Information
44
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
45
If Request("pv_id") <> "" Then
46
	Call Get_Pkg_Info ( Request("pv_id"), Request("rtag_id") )
47
 
48
	' Make sure pv_id exists as it may be removed
49
	If pkgInfoHash.Item("pv_id") = "" Then Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))
50
 
51
Else
52
	If (ScriptName <> "dependencies.asp") AND (ScriptName <> "find.asp")Then  Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))
53
End If
54
 
55
 
56
'----------------------------------------------
57
%>
58
<%
59
'-----------------------------------------------------------------------------------------------------------------------------
60
Sub RenderPackageProperties ()
61
%>
62
 
63
  <tr>
64
    <td background="images/bg_lght_gray.gif"><IMG height="45" src="images/spacer.gif" width=1></td>
65
 
66
	<td valign="bottom" background="images/bg_lght_gray.gif" nowrap class="body_txt">
67
	<%
68
	If pkgInfoHash.Item ("is_patch") = "Y" Then
69
		'--- PATCH ---
70
		Response.write "<br><a href='patches.asp?pv_id="& pkgInfoHash.Item ("patch_parent_id") &"&rtag_id="& Request("rtag_id") &"' class='txt_linked'><img src='icons/i_caretone.gif' hspace='2' border='0' align='absmiddle'>Back To "& pkgInfoHash.Item ("pkg_name") &"</a><br><br>"
71
 
72
		If pkgInfoHash.Item ("is_obsolete") = "Y" Then
73
			Dim rsTemp
74
			Set rsTemp = OraDatabase.DbCreateDynaset( "select patch_obsoleted_by from package_patches where patch_id ="&pkgInfoHash.Item ("pv_id"), cint(0))
75
 
76
			If rsTemp("patch_obsoleted_by") <> "" Then
77
 
78
				Set rsTemp = OraDatabase.DbCreateDynaset( "select pkg_version from package_versions where pv_id ="&rsTemp("patch_obsoleted_by"), cint(0))
79
				Call Messenger ( "<SPAN class='err_alert'><b>Patch Is Obsolete!</b></SPAN><br>"& NewLine_To_BR( "<b>Obsoleted by patch "& rsTemp("pkg_version") & ". </b> " ) & NewLine_To_BR( pkgInfoHash.Item ("obsolete_comments") ), 3, "100%" )
80
 
81
				rsTemp.Close()
82
				Set rsTemp = nothing
83
			Else
84
				Call Messenger ( "<SPAN class='err_alert'><b>Patch Is Obsolete!</b></SPAN><br>"& NewLine_To_BR( pkgInfoHash.Item ("obsolete_comments") ), 3, "100%" )
85
			End If
86
			Response.write enum_imgPatchObsolete
87
		Else
88
			Response.write enum_imgPatch
89
		End If
90
 
91
 
92
		If pkgInfoHash.Item ("dlocked") = "Y" Then
93
			Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_version") &"<img src='images/i_locked.gif' width='12' height='14' border='0' hspace='5' align='top'></SPAN>"
94
		Else
95
			Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_version") &"</SPAN>"
96
		End If
97
	Else
98
		'--- PACKAGE ---
99
		If pkgInfoHash.Item ("dlocked") = "Y" Then
100
			If pkgInfoHash.Item ("deprecated_state") = 6 Then
101
				Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_name") &"&nbsp;"& pkgInfoHash.Item ("pkg_version") &"<img src='images/i_locked.gif' width='12' height='14' border='0' hspace='5' align='top'>"&enum_imgDeprecated&"</SPAN>"
102
			ElseIf pkgInfoHash.Item ("product_state") = 4 Then
103
				Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_name") &"&nbsp;"& pkgInfoHash.Item ("pkg_version") &"<img src='images/i_locked.gif' width='12' height='14' border='0' hspace='5' align='top'>"&enum_imgProductRejected&"</SPAN>"
104
			Else
105
				Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_name") &"&nbsp;"& pkgInfoHash.Item ("pkg_version") &"<img src='images/i_locked.gif' width='12' height='14' border='0' hspace='5' align='top'></SPAN>"
106
			End If
107
		Else
108
			Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_name") &"&nbsp;"& pkgInfoHash.Item ("pkg_version") &"</SPAN>"
109
		End If
110
	End If
111
	%>
112
	<br><br>
113
	</td>
114
 
115
    <td background="images/bg_lght_gray.gif">&nbsp;</td>
116
  </tr>
117
 
118
  <tr>
119
    <td background="images/bg_lght_gray.gif"></td>
120
	<td background="images/bg_lght_gray.gif">
121
	<SPAN id="spanShowDetails" name="spanShowDetails"><a href="javascript:;" class="body_scol" onClick="DisplaySPAN(true);" style="display:block">Show Details...</a></SPAN>
122
	<SPAN id="spanHideDetails" name="spanHideDetails" style="display:none;"><a href="javascript:;" class="body_colb" onClick="DisplaySPAN(false);">Hide Details</a></SPAN>
123
	<SPAN id="spanPkgInfo" name="spanPkgInfo" style="display:none;">
124
	<table width="400" border="0" cellspacing="0" cellpadding="3">
125
	  <tr>
126
		<td background="images/bg_form_lightbluedark.gif" nowrap class="body_txt"><%Call Print_Pkg_Info()%></td>
127
	  </tr>
128
	</table>
129
	</SPAN>
130
	<br>
131
	</td>
132
    <td background="images/bg_lght_gray.gif"></td>
133
  </tr>
134
<%
135
End Sub
136
'-----------------------------------------------------------------------------------------------------------------------------
137
Sub RenderPackageState ()
138
	If (pkgInfoHash.Item ("dlocked") = "Y") Then
139
		Response.write "<b>Status:</b>&nbsp;Released<br>"
140
	Else
141
		Response.write "<b>Status:&nbsp;</b>Not released<br>"
142
	End If
143
End Sub
144
'-----------------------------------------------------------------------------------------------------------------------------
145
Sub Print_Pkg_Info()
146
 
147
	' Status:
133 ghuddy 148
   Call RenderPackageState ()
119 ghuddy 149
 
150
	' Base View:
151
	Response.write "<b>Base View:&nbsp;</b>"& Get_Pkg_Base_View ( parPv_id, parRtag_id ) &"<br>"
152
 
153
	' Previous Version:
154
	If IsNull(pkgInfoHash.Item ("is_patch")) Then
155
		If objAccessControl.IsActive("ChangePreviousVersion") Then
156
			If IsNull(pkgInfoHash.Item ("previous_version")) Then
157
				Response.write "<a href='javascript:;' onClick='MM_openBrWindow(""_wform_change_previous_version.asp?rfile="& scriptName &"&pv_id="& parPv_id &"&rtag_id="& parRtag_id &""",""ChangeOwner"",""resizable=yes,width=400,height=200"")' class='body_txt'><b>Previous Version:</b><img src='images/i_edit.gif' width='12' height='12' border='0' alt='Edit'></a>&nbsp;Unknown!<br>"
158
			Else
159
				Response.write "<a href='javascript:;' onClick='MM_openBrWindow(""_wform_change_previous_version.asp?rfile="& scriptName &"&pv_id="& parPv_id &"&rtag_id="& parRtag_id &""",""ChangeOwner"",""resizable=yes,width=400,height=200"")' class='body_txt'><b>Previous Version:</b><img src='images/i_edit.gif' width='12' height='12' border='0' alt='Edit'>&nbsp;"& pkgInfoHash.Item ("previous_version") &"</a><br>"
160
			End If
161
		Else
162
			If IsNull(pkgInfoHash.Item ("previous_version")) Then
163
				Response.write "<b>Previous Version:</b><img src='images/i_edit_disable.gif' width='12' height='12' border='0' alt='Edit'></a>&nbsp;Unknown!<br>"
164
			Else
165
				Response.write "<b>Previous Version:</b><img src='images/i_edit_disable.gif' width='12' height='12' border='0' alt='Edit'>&nbsp;"& pkgInfoHash.Item ("previous_version") &"</a><br>"
166
			End If
167
		End If
168
	End If
169
	Response.write "<br>"
170
 
171
	Response.write "<table width='100' border='0' cellspacing='0' cellpadding='1'>"
172
 
173
	' Owner:
174
	Response.write "<tr>"
175
	If objAccessControl.UserLogedIn() Then
176
		Response.write "<td nowrap><a href='javascript:;' onClick='MM_openBrWindow(""_wform_change_owner.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id &""",""ChangeOwner"",""resizable=yes,width=400,height=200"")' class='body_txt'><b>Owner:</b><img src='images/i_edit.gif' width='12' height='12' border='0' alt='Change owner'></a>&nbsp;</td>"
177
	Else
178
		Response.write "<td nowrap class='body_txt'><b>Owner:</b><img src='images/i_edit_disable.gif' width='12' height='12' border='0' alt='Change owner'></td>"
179
	End If
180
	Response.write "<td nowrap class='body_txt'>"& pkgInfoHash.Item ("owner") &"</td>"
181
	Response.write "<td><a href='mailto:"& pkgInfoHash.Item ("owner_email") &"' class='txt_linked'><img src='images/bt_send_email.gif' width='36' height='13' hspace='3' border='0' align='absmiddle' alt='"& pkgInfoHash.Item ("owner_email") &"'></a></td>"
182
	Response.write "</tr>"
183
 
184
	' Created:
185
	Response.write "<tr>"
186
	Response.write "<td nowrap class='body_txt'><b>Created:&nbsp;</b></td>"
187
	Response.write "<td nowrap class='body_txt'>"& EuroDate(pkgInfoHash.Item ("created_stamp")) &" by "& pkgInfoHash.Item ("creator") &"</td>"
188
	Response.write "<td><a href='mailto:"& pkgInfoHash.Item ("creator_email") &"' class='txt_linked'><img src='images/bt_send_email.gif' width='36' height='13' hspace='3' border='0' align='absmiddle' alt='"& pkgInfoHash.Item ("creator_email") &"'></a></td>"
189
	Response.write "</tr>"
190
 
191
	' Last Modified:
192
	Response.write "<tr>"
193
	Response.write "<td nowrap class='body_txt'><b>Last Modified:&nbsp;</b></td>"
194
	Response.write "<td nowrap class='body_txt'>"& EuroDateTime(pkgInfoHash.Item ("modified_stamp")) &" by "& pkgInfoHash.Item ("modifier") &"</td>"
195
	Response.write "<td><a href='mailto:"& pkgInfoHash.Item ("modifier_email") &"' class='txt_linked'><img src='images/bt_send_email.gif' width='36' height='13' hspace='3' border='0' align='absmiddle' alt='"& pkgInfoHash.Item ("modifier_email") &"'></a></td>"
196
	Response.write "</tr>"
197
	If IsNull(pkgInfoHash.Item ("is_patch"))  AND  (Request("rtag_id") <> "") Then
198
		Response.write "<tr>"
199
		If pkgInfoHash.Item ("insertor") <> "" Then
200
			Response.write "<td nowrap class='body_txt'><b>Added to Release:&nbsp;</b></td>"
201
			Response.write "<td nowrap class='body_txt'>"& EuroDate(pkgInfoHash.Item ("insert_stamp")) &" by "& pkgInfoHash.Item ("insertor") &"</td>"
202
			Response.write "<td><a href='mailto:"& pkgInfoHash.Item ("insertor_email") &"' class='txt_linked'><img src='images/bt_send_email.gif' width='36' height='13' hspace='3' border='0' align='absmiddle' alt='"& pkgInfoHash.Item ("insertor_email") &"'></a></td>"
203
		End If
204
		Response.write "</tr>"
205
	End If
206
 
207
	' Config Specs:
208
	Call Config_Spec (Request("rtag_id"), Request("pv_id"))
209
	Call Config_Spec_Template (pkgInfoHash.Item("dlocked"), rsQry("config_spec_branch"), rsQry("pkg_label"), rsQry("src_path"))
210
 
211
	' Jats commands
212
	Call Jats_Commands (pkgInfoHash.Item("dlocked"), rsQry("config_spec_branch"), rsQry("pkg_label"), rsQry("src_path"))
213
 
214
	rsQry.Close()
215
	Set rsQry = nothing
216
	Response.write "</table>"
217
 
218
End Sub
219
'---------------------------------------------------------------
220
Sub Config_Spec (NNRtag_id, NNPv_id)
221
	OraDatabase.Parameters.Add "RTAG_ID", NNRtag_id,	ORAPARM_INPUT, ORATYPE_NUMBER
222
	OraDatabase.Parameters.Add "PV_ID", NNPv_id,	ORAPARM_INPUT, ORATYPE_NUMBER
223
 
224
 
225
 
226
	If NNRtag_id <> "" Then
227
		If pkgInfoHash.Item ("dlocked") <> "Y" Then
228
			Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("config_spec.sql"), cint(0))
229
		Else
230
			Set rsQry = OraDatabase.DbCreateDynaset( Replace(GetQuery("config_spec.sql"), "PV.LAST_PV_ID", "PV.PV_ID"), cint(0))
231
		End If
232
	Else
233
		If pkgInfoHash.Item ("dlocked") <> "Y" Then
234
			Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("config_spec_nortag.sql"), cint(0))
235
		Else
236
			Set rsQry = OraDatabase.DbCreateDynaset( Replace(GetQuery("config_spec_nortag.sql"), "PV.LAST_PV_ID", "PV.PV_ID"), cint(0))
237
		End If
238
	End If
239
 
240
	OraDatabase.Parameters.Remove "RTAG_ID"
241
	OraDatabase.Parameters.Remove "PV_ID"
242
 
243
End Sub
244
 
245
'---------------------------------------------------------------
246
' Function: Config_Spec_Template
247
'
248
' Purpose:  Generates HTML to display the config spec to use
249
'           to create a view loaded with the particular package version.
250
'
251
' Arguments: dlocked       : dlocked state of the package version
252
'            config_branch : The branch, or null
253
'            pkg_label     : The package label
254
'            src_path      : The source path for the package
255
' Notes:
256
'
257
Sub Config_Spec_Template (dlocked, config_branch, pkg_label, src_path)
258
 
259
	Dim Template
260
 
261
	If (pkg_label <> "" AND src_path <> "") Then
262
		If (dlocked <> "Y" AND NOT IsNull(config_branch) AND config_branch <> "" ) Then
263
			Template = "element * CHECKEDOUT <br>" & _
264
			"element .../lost+found -none <br>" & _
265
			"element * .../" & config_branch & "/LATEST <br>" & _
266
			"element * " & pkg_label & " -mkbranch " & config_branch & "<br>" & _
267
			"element * /main/0 -mkbranch " & config_branch & "<br>"  & _
268
			"load " & chr(34) & src_path & chr(34)
269
		Else
270
			Template = "element * CHECKEDOUT <br>" & _
271
			"element .../lost+found -none <br>" & _
272
			"element * " & pkg_label &"<br>" & _
273
			"load " & chr(34) & src_path & chr(34)
274
		End If
275
	Else
276
		Template = "UNAVAILABLE - missing label and/or source path"
277
	End If
278
 
279
	Response.write "<tr>"
280
	Response.write "<td nowrap class='body_txt'><b>Config Specs:&nbsp;</b></td>"
281
	Response.write "<td nowrap class='body_txt'>"& Template &"</td>"
282
	Response.write "<td nowrap class='body_txt'></td>"
283
	Response.write "</tr>"
284
 
285
End Sub
286
 
287
'---------------------------------------------------------------
288
' Function: Jats_Commands
289
'
290
' Purpose:  Generates HTML for displaying the JATS commands for extracting
291
'           a view for the package version, and for building the targets
292
'           within a previously extracted view for the package version.
293
'
294
' Arguments: dlocked       : dlocked state of the package version
295
'            config_branch : The branch, or null
296
'            pkg_label     : The package label
297
'            src_path      : The source path for the package
298
' Notes:
299
'
300
Sub Jats_Commands (dlocked, config_branch, pkg_label, src_path)
301
 
302
	Dim Template1, Template2
303
 
304
	If (pkg_label <> "" AND src_path <> "") Then
305
		If (dlocked <> "Y" AND NOT IsNull(config_branch) AND config_branch <> "" ) Then
306
			Template1 = "jats release -extract " & pkg_label & " -path " & chr(34) & Replace(src_path, "\", "/") & chr(34) &" -branch "& config_branch
307
		Else
308
			Template1 = "jats release -extract " & pkg_label & " -path " & chr(34) & Replace(src_path, "\", "/") & chr(34)
309
		End If
310
		Template2 = "jats release -test " & pkgInfoHash.Item("pkg_label") & " -path " & chr(34) & Replace(src_path, "\", "/") & chr(34)
311
	Else
312
		Template1 = "UNAVAILABLE - missing label and/or source path"
313
		Template2 = "UNAVAILABLE - missing label and/or source path"
314
	End If
315
 
316
	Response.write "<tr>"
317
	Response.write "<td nowrap class='body_txt'><b>JATS Extract:&nbsp;</b></td>"
318
	Response.write "<td nowrap class='body_txt'>" & Template1 & "</td>"
319
	Response.write "<td nowrap class='body_txt'></td>"
320
	Response.write "</tr>"
321
	Response.write "<tr>"
322
	Response.write "<td nowrap class='body_txt'><b>JATS Test:&nbsp;</b></td>"
323
	Response.write "<td nowrap class='body_txt'>" & Template2 & "</td>"
324
	Response.write "<td nowrap class='body_txt'></td>"
325
	Response.write "</tr>"
326
 
327
End Sub
328
 
329
'-----------------------------------------------------------------------------------------------------------------------------
330
%>