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