Subversion Repositories DevTools

Rev

Rev 6070 | Rev 6190 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6070 Rev 6189
Line 49... Line 49...
49
Dim pkgA, pkgB, pkgname, delimiter, rsQryA, rsQryB, rsQryCommentsA, rsQryCommentsB, sqlstrA, counterA, sqlstrB, counterB
49
Dim pkgA, pkgB, pkgname, delimiter, rsQryA, rsQryB, rsQryCommentsA, rsQryCommentsB, sqlstrA, counterA, sqlstrB, counterB
50
Dim SSsql, retVal, rsCQ, DEVIiss
50
Dim SSsql, retVal, rsCQ, DEVIiss
51
Dim a, b, c, d, pkgversion, errormsg, ChangeASource, ChangeAUpdate, ChangeBSource, ChangeBUpdate, pvCollectionA, pvCollectionB
51
Dim a, b, c, d, pkgversion, errormsg, ChangeASource, ChangeAUpdate, ChangeBSource, ChangeBUpdate, pvCollectionA, pvCollectionB
52
Dim source_change, scFlag
52
Dim source_change, scFlag
53
Dim changeType
53
Dim changeType
54
Dim pendingAdditions
54
Dim pkgSeen
55
Dim isaSdk                  ' Target is an SDK based package
55
Dim isaSdk                  ' Target is an SDK based package
56
Dim isMergable              ' Target package can be modified
56
Dim isMergable              ' Target package can be modified
57
 
57
 
58
'------------ Constants Declaration -----------
58
'------------ Constants Declaration -----------
59
Const LIMG_UPDATED = "<img src='images/i_updated.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='Updated'>"
59
Const LIMG_UPDATED = "<img src='images/i_updated.gif' width='11' height='11' border='0' hspace='5' align='absmiddle' title='Updated'>"
Line 76... Line 76...
76
parRtagA = Request("rtagA")
76
parRtagA = Request("rtagA")
77
parRtagB = Request("rtagB")
77
parRtagB = Request("rtagB")
78
Set objRelCollectorA = CreateObject("Scripting.Dictionary")
78
Set objRelCollectorA = CreateObject("Scripting.Dictionary")
79
Set objRelCollectorB = CreateObject("Scripting.Dictionary")
79
Set objRelCollectorB = CreateObject("Scripting.Dictionary")
80
Set dDiffFilter = CreateObject("Scripting.Dictionary")
80
Set dDiffFilter = CreateObject("Scripting.Dictionary")
81
Set pendingAdditions = CreateObject("Scripting.Dictionary")
81
Set pkgSeen = CreateObject("Scripting.Dictionary")
82
'----------------------------------------------
82
'----------------------------------------------
83
If Request("btn") = "Mail Me Report" Then
83
If Request("btn") = "Mail Me Report" Then
84
    email = true
84
    email = true
85
    genReport = true
85
    genReport = true
86
End If
86
End If
Line 451... Line 451...
451
    End If
451
    End If
452
    rsTemp.Close
452
    rsTemp.Close
453
    Set rsTemp = nothing
453
    Set rsTemp = nothing
454
End Function
454
End Function
455
'--------------------------------------------------------------------------------------------------------------------------
455
'--------------------------------------------------------------------------------------------------------------------------
456
' We need a way of discriminating between versions in the destination release that are pending, and those that are officially
-
 
457
' in the release. This function allows us to do that on the fly within the VBSCRIPT HTML generating code, indicating specifically
-
 
458
' if the given PV_ID reflects a pending additive merge.
-
 
459
Function Is_Pending_Add(NNrtag_id, NNpv_id)
-
 
460
    If IsNull(NNrtag_id) OR IsNull(NNpv_id) Then
-
 
461
        Is_Pending_Add = 0
-
 
462
    Else
-
 
463
        Is_Pending_Add = Get_Record_Count( "PLANNED pl WHERE pl.rtag_id = " & NNrtag_id & " AND pl.pv_id = " & NNpv_id & " AND pl.operation = 'A'" )
-
 
464
    End If
-
 
465
End Function
-
 
466
'--------------------------------------------------------------------------------------------------------------------------
-
 
467
' We need a way of discriminating between versions in the destination release that are pending, and those that are officially
-
 
468
' in the release. This function allows us to do that on the fly within the VBSCRIPT HTML generating code, indicating specifically
-
 
469
' if the given PV_ID reflects a pending subtractive merge.
-
 
470
Function Is_Pending_Sub(NNrtag_id, NNpv_id)
-
 
471
    If IsNull(NNrtag_id) OR IsNull(NNpv_id) Then
-
 
472
        Is_Pending_Sub = 0
-
 
473
    Else
-
 
474
        Is_Pending_Sub = Get_Record_Count( "PLANNED pl WHERE pl.rtag_id = " & NNrtag_id & " AND pl.pv_id = " & NNpv_id & " AND pl.operation = 'S'" )
-
 
475
    End If
-
 
476
End Function
-
 
477
 
-
 
478
'--------------------------------------------------------------------------------------------------------------------------
-
 
479
Sub MergePackages ()
456
Sub MergePackages ()
480
    Dim aFullList, aAddPkgList, aRemovePkgList, dAddPkgList, dRemovePkgList, PvId
457
    Dim aFullList, aAddPkgList, aRemovePkgList, dAddPkgList, dRemovePkgList, PvId
481
    Dim OraParameter
458
    Dim OraParameter
482
    Dim rc
459
    Dim rc
483
 
460
 
Line 554... Line 531...
554
            If Err.Number = 0 Then
531
            If Err.Number = 0 Then
555
                ' Does this PV_ID exist in the destination release's planned table?
532
                ' Does this PV_ID exist in the destination release's planned table?
556
                rc = Get_Record_Count ("PLANNED pl WHERE pl.pv_id = " & PvId & " AND pl.rtag_id = " & Request("rtagB") )
533
                rc = Get_Record_Count ("PLANNED pl WHERE pl.pv_id = " & PvId & " AND pl.rtag_id = " & Request("rtagB") )
557
                If  rc > 0 Then
534
                If  rc > 0 Then
558
                    ' Given that merging now merges into pending, the merge page may be used to remove items that have
535
                    ' Given that merging now merges into pending, the merge page may be used to remove items that have
559
                    ' previously been merged but have not yet been committed to the destination release. For these,
536
                    ' previously been merged but have not yet been committed to the destination release.
560
                    ' we cannot call PK_RELEASE.GET_PACKAGE_VIEW(). We have to call PK_PLANNED.GET_PACKAGE_VIEW() instead.
-
 
561
                    OraDatabase.ExecuteSQL _
537
                    OraDatabase.ExecuteSQL _
562
                    "BEGIN  "&_
538
                   "BEGIN "&_
563
                    "  :VIEW_ID := PK_PLANNED.GET_PACKAGE_VIEW ( :PV_ID, :RTAG_B ); "&_
-
 
564
                    "  PK_PLANNED.MERGE_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_B, :USER_ID, :OPERATION );  "&_
539
                   " PK_ENVIRONMENT.MAKE_REJECT ( :PV_ID, :RTAG_B, :USER_ID ); "&_
565
                    "END;"
540
                   "END; "
566
                Else
541
                Else
567
                    ' DEVI-45275, Merge into Planned (pending) table instead of release_content table.
542
                    ' DEVI-45275, Merge into Planned (pending) table instead of release_content table.
568
                    OraDatabase.ExecuteSQL _
543
                    OraDatabase.ExecuteSQL _
569
                    "BEGIN  "&_
544
                    "BEGIN  "&_
570
                    "  :VIEW_ID := PK_RELEASE.GET_PACKAGE_VIEW ( :PV_ID, :RTAG_B ); "&_
545
                    "  :VIEW_ID := PK_RELEASE.GET_PACKAGE_VIEW ( :PV_ID, :RTAG_B ); "&_
Line 1007... Line 982...
1007
                                                                    <tr>
982
                                                                    <tr>
1008
                                                                        <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_NO_CHANGE%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_NO_CHANGE)%>></td>
983
                                                                        <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_NO_CHANGE%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_NO_CHANGE)%>></td>
1009
                                                                        <td nowrap background="images/bg_action_norm.gif" class="form_field">Unchanged</td>
984
                                                                        <td nowrap background="images/bg_action_norm.gif" class="form_field">Unchanged</td>
1010
                                                                    </tr>
985
                                                                    </tr>
1011
                                                                    <tr>
986
                                                                    <tr>
-
 
987
                                                                        <td background="images/bg_action_norm.gif"><input type="checkbox" name="difilter" value="<%=enumDB_NUM_DIFF_PENDING%>" <%=GetIsDiffFilterChecked(enumDB_NUM_DIFF_PENDING)%>></td>
-
 
988
                                                                        <td nowrap background="images/bg_action_norm.gif" class="form_field">Pending</td>
-
 
989
                                                                    </tr>
-
 
990
                                                                    <tr>
1012
                                                                        <td background="images/bg_action_norm.gif">&nbsp;</td>
991
                                                                        <td background="images/bg_action_norm.gif">&nbsp;</td>
1013
                                                                        <td background="images/bg_action_norm.gif"><input name="btn" type="submit" class="form_btn" value="Hide"></td>
992
                                                                        <td background="images/bg_action_norm.gif"><input name="btn" type="submit" class="form_btn" value="Hide"></td>
1014
                                                                    </tr>
993
                                                                    </tr>
1015
                                                                </table>
994
                                                                </table>
1016
                                                            </div>
995
                                                            </div>
Line 1044... Line 1023...
1044
                                                    <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="1"></td>
1023
                                                    <td width="1" bgcolor="#E4E9EC"><img src="images/spacer.gif" width="20" height="1"></td>
1045
                                                </tr>
1024
                                                </tr>
1046
                                                <%
1025
                                                <%
1047
                                                OraDatabase.Parameters.Add "RTAG_A",     parRtagA,    ORAPARM_INPUT, ORATYPE_NUMBER
1026
                                                OraDatabase.Parameters.Add "RTAG_A",     parRtagA,    ORAPARM_INPUT, ORATYPE_NUMBER
1048
                                                OraDatabase.Parameters.Add "RTAG_B",     parRtagB,    ORAPARM_INPUT, ORATYPE_NUMBER
1027
                                                OraDatabase.Parameters.Add "RTAG_B",     parRtagB,    ORAPARM_INPUT, ORATYPE_NUMBER
1049
                                                OraDatabase.Parameters.Add "NO_CHANGE", GetIsDiffFilterChecked(enumDB_NUM_DIFF_NO_CHANGE), ORAPARM_INPUT, ORATYPE_VARCHAR2
1028
                                                OraDatabase.Parameters.Add "NO_CHANGE",  GetIsDiffFilterChecked(enumDB_NUM_DIFF_NO_CHANGE), ORAPARM_INPUT, ORATYPE_VARCHAR2
1050
                                                OraDatabase.Parameters.Add "ADDED",      GetIsDiffFilterChecked(enumDB_NUM_DIFF_NEW),         ORAPARM_INPUT, ORATYPE_VARCHAR2
1029
                                                OraDatabase.Parameters.Add "ADDED",      GetIsDiffFilterChecked(enumDB_NUM_DIFF_NEW),       ORAPARM_INPUT, ORATYPE_VARCHAR2
1051
                                                OraDatabase.Parameters.Add "UPDATED",    GetIsDiffFilterChecked(enumDB_NUM_DIFF_UPDATED),    ORAPARM_INPUT, ORATYPE_VARCHAR2
1030
                                                OraDatabase.Parameters.Add "UPDATED",    GetIsDiffFilterChecked(enumDB_NUM_DIFF_UPDATED),   ORAPARM_INPUT, ORATYPE_VARCHAR2
1052
                                                OraDatabase.Parameters.Add "REMOVED",    GetIsDiffFilterChecked(enumDB_NUM_DIFF_REMOVED),    ORAPARM_INPUT, ORATYPE_VARCHAR2
1031
                                                OraDatabase.Parameters.Add "REMOVED",    GetIsDiffFilterChecked(enumDB_NUM_DIFF_REMOVED),   ORAPARM_INPUT, ORATYPE_VARCHAR2
1053
 
1032
 
1054
                                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleaseDiff.sql"), cint(0))
1033
                                                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleaseDiff.sql"), cint(0))
1055
 
1034
 
1056
                                                OraDatabase.Parameters.Remove "RTAG_A"
1035
                                                OraDatabase.Parameters.Remove "RTAG_A"
1057
                                                OraDatabase.Parameters.Remove "RTAG_B"
1036
                                                OraDatabase.Parameters.Remove "RTAG_B"
Line 1212... Line 1191...
1212
                                                        ' NOTE. the result set is sorted by change type (see releasediff.sql) such that if there are multiple entries
1191
                                                        ' NOTE. the result set is sorted by change type (see releasediff.sql) such that if there are multiple entries
1213
                                                        '         for the same PV_ID, they are sorted in the following order: unchanged, additions, removals, updates.
1192
                                                        '         for the same PV_ID, they are sorted in the following order: unchanged, additions, removals, updates.
1214
                                                        '         This is important to the row skip filtering carried out below.
1193
                                                        '         This is important to the row skip filtering carried out below.
1215
                                                        Dim skipRow
1194
                                                        Dim skipRow
1216
                                                        If rsQry("pv_id_a") Then
1195
                                                        If rsQry("pv_id_a") Then
1217
                                                            skipRow = pendingAdditions.Exists(CStr(rsQry("pv_id_a")))
1196
                                                            skipRow = pkgSeen.Exists(CStr(rsQry("pv_id_a")))
-
 
1197
                                                            pkgSeen.Item(CStr(rsQry("pv_id_a"))) = 1
1218
                                                        Else
1198
                                                        Else
1219
                                                            skipRow = FALSE
1199
                                                            skipRow = FALSE
1220
                                                        End If
1200
                                                        End If
-
 
1201
 
-
 
1202
                                                        If GetIsDiffFilterChecked(enumDB_NUM_DIFF_PENDING) <> "" Then
-
 
1203
                                                            If rsQry("CHANGE_TYPE") = "APS" OR rsQry("CHANGE_TYPE") = "APA" Then
-
 
1204
                                                                skipRow = TRUE
-
 
1205
                                                            End If
-
 
1206
                                                        End If
-
 
1207
 
1221
                                                        %>
1208
                                                        %>
1222
                                                        <%If NOT skipRow Then%>
1209
                                                        <%If NOT skipRow Then%>
1223
                                                            <tr>
1210
                                                            <tr>
1224
                                                                <td class="body_row" nowrap>
1211
                                                                <td class="body_row" nowrap>
1225
                                                                    <DIV id="PVA<%=rowId%>" style="background:<%=colorA%>; padding:5px;" data_color="<%=colorA%>">
1212
                                                                    <DIV id="PVA<%=rowId%>" style="background:<%=colorA%>; padding:5px;" data_color="<%=colorA%>">
Line 1228... Line 1215...
1228
                                                                </td>
1215
                                                                </td>
1229
 
1216
 
1230
                                                                <%
1217
                                                                <%
1231
                                                                Dim pkgADisplayControl
1218
                                                                Dim pkgADisplayControl
1232
                                                                pkgADisplayControl = isMergable
1219
                                                                pkgADisplayControl = isMergable
1233
                                                                If IsNull( changeType ) OR (changeType = "A")  OR (changeType = "0") Then pkgADisplayControl = FALSE
1220
                                                                If IsNull( changeType ) OR (changeType = "A")  OR (changeType = "B") OR (changeType = "APA")  OR (changeType = "APS")  Then pkgADisplayControl = FALSE
1234
                                                                If isaSdk Then pkgADisplayControl = FALSE
1221
                                                                If isaSdk Then pkgADisplayControl = FALSE
1235
                                                                %>
1222
                                                                %>
1236
                                                                <td bgcolor="#F5F5F5">
1223
                                                                <td bgcolor="#F5F5F5">
1237
                                                                    <%If pkgADisplayControl Then%>
1224
                                                                    <%If pkgADisplayControl Then%>
1238
                                                                        <DIV id="IMGMERGE<%=rowId%>"><a href="javascript:;" onClick="MergePackage( '<%=rsQry("pv_id_a")%>', '<%=rsQry("pv_id_b")%>', '<%=rowId%>' );"><%=btnMerge%></a></DIV>
1225
                                                                        <DIV id="IMGMERGE<%=rowId%>"><a href="javascript:;" onClick="MergePackage( '<%=rsQry("pv_id_a")%>', '<%=rsQry("pv_id_b")%>', '<%=rowId%>' );"><%=btnMerge%></a></DIV>
Line 1261... Line 1248...
1261
                                                                    <DIV id="PVB<%=rowId%>" 
1248
                                                                    <DIV id="PVB<%=rowId%>" 
1262
                                                                         style="background:<%=colorB%>; padding:5px;" 
1249
                                                                         style="background:<%=colorB%>; padding:5px;" 
1263
                                                                         data_color="<%=colorB%>"
1250
                                                                         data_color="<%=colorB%>"
1264
                                                                         data_pkg="<%=rsQry("pkg_name_b") &" "& rsQry("pkg_version_b")%>"
1251
                                                                         data_pkg="<%=rsQry("pkg_name_b") &" "& rsQry("pkg_version_b")%>"
1265
                                                                         >
1252
                                                                         >
1266
                                                                        <%If IsNull(rsQry("pv_id_b")) Then %>
1253
                                                                        <%=rsQry("pkg_name_b") &" "& rsQry("pkg_version_b")%>
1267
                                                                            <%If Is_Pending_Sub(Request("rtagB"), rsQry("pv_id_a")) Then%>
1254
                                                                        <%If ChangeType = "APS" Then%>
1268
                                                                                (removal pending<%=Quick_Help("RemovalPending")%>)
1255
                                                                                (removal pending<%=Quick_Help("RemovalPending")%>)
1269
                                                                            <%End If %>
-
 
1270
                                                                        <%Else%>
1256
                                                                        <%ElseIf ChangeType = "APA" Then%>
1271
                                                                            <%=rsQry("pkg_name_b") &" "& rsQry("pkg_version_b")%>
-
 
1272
                                                                            <%If Is_Pending_Add(Request("rtagB"), rsQry("pv_id_b")) Then%>
-
 
1273
                                                                                (addition pending<%=Quick_Help("AdditionPending")%>)
1257
                                                                                (addition pending<%=Quick_Help("AdditionPending")%>)
1274
                                                                                <% 'Add this pending addition to the dictionary so that we can filter out REMOVED entries
-
 
1275
                                                                                    'with identical PV_ID's that we might encounter further on in the result set
-
 
1276
                                                                                If NOT pendingAdditions.Exists(rsQry("pv_id_b")) Then
-
 
1277
                                                                                    pendingAdditions.Add CStr(rsQry("pv_id_b")), CStr(rsQry("pkg_version_b"))
-
 
1278
                                                                                End If%>
-
 
1279
                                                                            <%ElseIf Is_Pending_Sub(Request("rtagB"), rsQry("pv_id_b")) Then%>
-
 
1280
                                                                                (removal pending<%=Quick_Help("RemovalPending")%>)
-
 
1281
                                                                            <%End If %>
-
 
1282
                                                                        <%End If %>
1258
                                                                        <%End If %>
1283
                                                                    </DIV>
1259
                                                                    </DIV>
1284
                                                                    <input type="hidden" disabled="disabled" name="addpkg" id="ADDPKG_<%=rowId%>" value="">
1260
                                                                    <input type="hidden" disabled="disabled" name="addpkg" id="ADDPKG_<%=rowId%>" value="">
1285
                                                                    <input type="hidden" disabled="disabled" name="removepkg" id="REMOVEPKG_<%=rowId%>" value="">
1261
                                                                    <input type="hidden" disabled="disabled" name="removepkg" id="REMOVEPKG_<%=rowId%>" value="">
1286
                                                                </td>
1262
                                                                </td>