Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%
2
'===================================================================
141 ghuddy 3
'                     Package Common
119 ghuddy 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
141 ghuddy 12
Dim nEnvTab         ' remember environment tab
119 ghuddy 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
141 ghuddy 31
   Call Rebuild_Environment ( parRtag_id )
119 ghuddy 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
141 ghuddy 46
   Call Get_Pkg_Info ( Request("pv_id"), Request("rtag_id") )
119 ghuddy 47
 
141 ghuddy 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"))
119 ghuddy 50
 
51
Else
141 ghuddy 52
   If (ScriptName <> "dependencies.asp") AND (ScriptName <> "find.asp")Then  Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))
119 ghuddy 53
End If
54
 
55
 
56
'----------------------------------------------
57
%>
58
<%
59
'-----------------------------------------------------------------------------------------------------------------------------
60
Sub RenderPackageProperties ()
61
%>
62
 
141 ghuddy 63
   <tr>
64
      <td background="images/bg_lght_gray.gif"><IMG height="45" src="images/spacer.gif" width=1></td>
119 ghuddy 65
 
141 ghuddy 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>"
119 ghuddy 71
 
141 ghuddy 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))
119 ghuddy 75
 
141 ghuddy 76
               If rsTemp("patch_obsoleted_by") <> "" Then
119 ghuddy 77
 
141 ghuddy 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%" )
119 ghuddy 80
 
141 ghuddy 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
119 ghuddy 90
 
91
 
141 ghuddy 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>
119 ghuddy 114
 
141 ghuddy 115
      <td background="images/bg_lght_gray.gif">&nbsp;</td>
116
   </tr>
119 ghuddy 117
 
141 ghuddy 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>
119 ghuddy 134
<%
135
End Sub
136
'-----------------------------------------------------------------------------------------------------------------------------
137
Sub RenderPackageState ()
141 ghuddy 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
119 ghuddy 143
End Sub
144
'-----------------------------------------------------------------------------------------------------------------------------
145
Sub Print_Pkg_Info()
146
 
141 ghuddy 147
   ' Status:
148
   If IsNull(pkgInfoHash.Item ("is_patch")) Then
149
      Call RenderPackageState ()
150
   Else
151
      If  objAccessControl.IsDataActive ("PROJECTS", DB_PROJ_ID, "EditProjects") AND (objAccessControl.IsActive("UnlockPatch"))  Then
152
         If (pkgInfoHash.Item ("dlocked") = "Y") Then
153
            ' Unlock patch.
154
            Response.write "<a href='_s_unlock_package.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id &"' class='body_txt' title='Unlock the patch.'><b>Status:</b><img src='images/i_edit.gif' width='12' height='12' border='0' ></a>&nbsp;Released<br>"
155
         ElseIf (pkgInfoHash.Item ("dlocked") = "N") Then
156
            ' Lock Patch
157
            Response.write "<a href='_s_lock_package.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id &"' class='body_txt' title='Lock the patch. Release requirements are not applied.'><b>Status:</b><img src='images/i_edit.gif' width='12' height='12' border='0'></a>&nbsp;Not Released<br>"
158
         End If
159
      Else
160
         Call RenderPackageState ()
161
      End If
162
   End If
119 ghuddy 163
 
141 ghuddy 164
   ' Base View:
165
   Response.write "<b>Base View:&nbsp;</b>"& Get_Pkg_Base_View ( parPv_id, parRtag_id ) &"<br>"
119 ghuddy 166
 
141 ghuddy 167
   ' Previous Version:
168
   If IsNull(pkgInfoHash.Item ("is_patch")) Then
169
      If objAccessControl.IsActive("ChangePreviousVersion") Then
170
         If IsNull(pkgInfoHash.Item ("previous_version")) Then
171
            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>"
172
         Else
173
            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>"
174
         End If
175
      Else
176
         If IsNull(pkgInfoHash.Item ("previous_version")) Then
177
            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>"
178
         Else
179
            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>"
180
         End If
181
      End If
182
   End If
183
   Response.write "<br>"
119 ghuddy 184
 
141 ghuddy 185
   Response.write "<table width='100' border='0' cellspacing='0' cellpadding='1'>"
119 ghuddy 186
 
141 ghuddy 187
   ' Owner:
188
   Response.write "<tr>"
189
   If objAccessControl.UserLogedIn() Then
190
      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>"
191
   Else
192
      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>"
193
   End If
194
   Response.write "<td nowrap class='body_txt'>"& pkgInfoHash.Item ("owner") &"</td>"
195
   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>"
196
   Response.write "</tr>"
119 ghuddy 197
 
141 ghuddy 198
   ' Created:
199
   Response.write "<tr>"
200
   Response.write "<td nowrap class='body_txt'><b>Created:&nbsp;</b></td>"
201
   Response.write "<td nowrap class='body_txt'>"& EuroDate(pkgInfoHash.Item ("created_stamp")) &" by "& pkgInfoHash.Item ("creator") &"</td>"
202
   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>"
203
   Response.write "</tr>"
119 ghuddy 204
 
141 ghuddy 205
   ' Last Modified:
206
   Response.write "<tr>"
207
   Response.write "<td nowrap class='body_txt'><b>Last Modified:&nbsp;</b></td>"
208
   Response.write "<td nowrap class='body_txt'>"& EuroDateTime(pkgInfoHash.Item ("modified_stamp")) &" by "& pkgInfoHash.Item ("modifier") &"</td>"
209
   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>"
210
   Response.write "</tr>"
211
   If IsNull(pkgInfoHash.Item ("is_patch"))  AND  (Request("rtag_id") <> "") Then
212
      Response.write "<tr>"
213
      If pkgInfoHash.Item ("insertor") <> "" Then
214
         Response.write "<td nowrap class='body_txt'><b>Added to Release:&nbsp;</b></td>"
215
         Response.write "<td nowrap class='body_txt'>"& EuroDate(pkgInfoHash.Item ("insert_stamp")) &" by "& pkgInfoHash.Item ("insertor") &"</td>"
216
         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>"
217
      End If
218
      Response.write "</tr>"
219
   End If
119 ghuddy 220
 
141 ghuddy 221
   ' Config Specs:
222
   Call Config_Spec (Request("rtag_id"), Request("pv_id"))
223
   Call Config_Spec_Template (pkgInfoHash.Item("dlocked"), rsQry("config_spec_branch"), rsQry("pkg_label"), rsQry("src_path"))
119 ghuddy 224
 
141 ghuddy 225
   ' Jats commands
226
   Call Jats_Commands (pkgInfoHash.Item("dlocked"), rsQry("config_spec_branch"), rsQry("pkg_label"), rsQry("src_path"))
119 ghuddy 227
 
141 ghuddy 228
   rsQry.Close()
229
   Set rsQry = nothing
230
   Response.write "</table>"
119 ghuddy 231
 
232
End Sub
233
'---------------------------------------------------------------
234
Sub Config_Spec (NNRtag_id, NNPv_id)
141 ghuddy 235
   OraDatabase.Parameters.Add "RTAG_ID", NNRtag_id,   ORAPARM_INPUT, ORATYPE_NUMBER
236
   OraDatabase.Parameters.Add "PV_ID", NNPv_id,   ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 237
 
238
 
239
 
141 ghuddy 240
   If NNRtag_id <> "" Then
241
      If pkgInfoHash.Item ("dlocked") <> "Y" Then
242
         Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("config_spec.sql"), cint(0))
243
      Else
244
         Set rsQry = OraDatabase.DbCreateDynaset( Replace(GetQuery("config_spec.sql"), "PV.LAST_PV_ID", "PV.PV_ID"), cint(0))
245
      End If
246
   Else
247
      If pkgInfoHash.Item ("dlocked") <> "Y" Then
248
         Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("config_spec_nortag.sql"), cint(0))
249
      Else
250
         Set rsQry = OraDatabase.DbCreateDynaset( Replace(GetQuery("config_spec_nortag.sql"), "PV.LAST_PV_ID", "PV.PV_ID"), cint(0))
251
      End If
252
   End If
119 ghuddy 253
 
141 ghuddy 254
   OraDatabase.Parameters.Remove "RTAG_ID"
255
   OraDatabase.Parameters.Remove "PV_ID"
119 ghuddy 256
 
257
End Sub
258
 
259
'---------------------------------------------------------------
260
' Function: Config_Spec_Template
261
'
262
' Purpose:  Generates HTML to display the config spec to use
263
'           to create a view loaded with the particular package version.
264
'
265
' Arguments: dlocked       : dlocked state of the package version
266
'            config_branch : The branch, or null
267
'            pkg_label     : The package label
268
'            src_path      : The source path for the package
269
' Notes:
270
'
271
Sub Config_Spec_Template (dlocked, config_branch, pkg_label, src_path)
272
 
141 ghuddy 273
   Dim Template
119 ghuddy 274
 
141 ghuddy 275
   If (pkg_label <> "" AND src_path <> "") Then
276
      If (dlocked <> "Y" AND NOT IsNull(config_branch) AND config_branch <> "" ) Then
277
         Template = "element * CHECKEDOUT <br>" & _
278
         "element .../lost+found -none <br>" & _
279
         "element * .../" & config_branch & "/LATEST <br>" & _
280
         "element * " & pkg_label & " -mkbranch " & config_branch & "<br>" & _
281
         "element * /main/0 -mkbranch " & config_branch & "<br>"  & _
282
         "load " & chr(34) & src_path & chr(34)
283
      Else
284
         Template = "element * CHECKEDOUT <br>" & _
285
         "element .../lost+found -none <br>" & _
286
         "element * " & pkg_label &"<br>" & _
287
         "load " & chr(34) & src_path & chr(34)
288
      End If
289
   Else
290
      Template = "UNAVAILABLE - missing label and/or source path"
291
   End If
119 ghuddy 292
 
141 ghuddy 293
   Response.write "<tr>"
294
   Response.write "<td nowrap class='body_txt'><b>Config Specs:&nbsp;</b></td>"
295
   Response.write "<td nowrap class='body_txt'>"& Template &"</td>"
296
   Response.write "<td nowrap class='body_txt'></td>"
297
   Response.write "</tr>"
119 ghuddy 298
 
299
End Sub
300
 
301
'---------------------------------------------------------------
302
' Function: Jats_Commands
303
'
304
' Purpose:  Generates HTML for displaying the JATS commands for extracting
305
'           a view for the package version, and for building the targets
306
'           within a previously extracted view for the package version.
307
'
308
' Arguments: dlocked       : dlocked state of the package version
309
'            config_branch : The branch, or null
310
'            pkg_label     : The package label
311
'            src_path      : The source path for the package
312
' Notes:
313
'
314
Sub Jats_Commands (dlocked, config_branch, pkg_label, src_path)
315
 
141 ghuddy 316
   Dim Template1, Template2
119 ghuddy 317
 
141 ghuddy 318
   If (pkg_label <> "" AND src_path <> "") Then
319
      If (dlocked <> "Y" AND NOT IsNull(config_branch) AND config_branch <> "" ) Then
320
         Template1 = "jats release -extract " & pkg_label & " -path " & chr(34) & Replace(src_path, "\", "/") & chr(34) &" -branch "& config_branch
321
      Else
322
         Template1 = "jats release -extract " & pkg_label & " -path " & chr(34) & Replace(src_path, "\", "/") & chr(34)
323
      End If
324
      Template2 = "jats release -test " & pkgInfoHash.Item("pkg_label") & " -path " & chr(34) & Replace(src_path, "\", "/") & chr(34)
325
   Else
326
      Template1 = "UNAVAILABLE - missing label and/or source path"
327
      Template2 = "UNAVAILABLE - missing label and/or source path"
328
   End If
119 ghuddy 329
 
141 ghuddy 330
   Response.write "<tr>"
331
   Response.write "<td nowrap class='body_txt'><b>JATS Extract:&nbsp;</b></td>"
332
   Response.write "<td nowrap class='body_txt'>" & Template1 & "</td>"
333
   Response.write "<td nowrap class='body_txt'></td>"
334
   Response.write "</tr>"
335
   Response.write "<tr>"
336
   Response.write "<td nowrap class='body_txt'><b>JATS Test:&nbsp;</b></td>"
337
   Response.write "<td nowrap class='body_txt'>" & Template2 & "</td>"
338
   Response.write "<td nowrap class='body_txt'></td>"
339
   Response.write "</tr>"
119 ghuddy 340
 
341
End Sub
342
 
343
'-----------------------------------------------------------------------------------------------------------------------------
344
%>