Subversion Repositories DevTools

Rev

Rev 6579 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|             SEARCH RESULT                         |
6
'|               PACKAGES                            |
7
'|                                                   |
8
'=====================================================
9
%>
10
<%
11
Option explicit
12
' Good idea to set when using redirect
13
Response.Expires = 0   ' always load the page, dont store
14
%>
15
<!--#include file="common/conf.asp"-->
16
<!--#include file="common/globals.asp"-->
17
<!--#include file="common/formating.asp"-->
18
<!--#include file="common/qstr.asp"-->
19
<!--#include file="common/common_subs.asp"-->
20
<%
21
' Make sure rtag_id is always present
22
If Request("pv_id") = "" AND Request("rtag_id") = "" Then
5957 dpurdie 23
   Call Destroy_All_Objects
5357 dpurdie 24
   Response.Redirect("index.asp")
25
End If
26
 
27
objPMod.PersistInQryString ( aPersistList(enumPAR_ADD_TYPE) )
28
objPMod.PersistInCookie("pkgfind")
29
%>
30
<%
31
'------------ ACCESS CONTROL ------------------
32
%>
33
<!--#include file="_access_control_login.asp"-->
34
<!--#include file="_access_control_general.asp"-->
35
<%
36
'------------ Variable Definition -------------
37
Dim parAdd_type
38
Dim parPkgfind
39
Dim rsFind
40
Dim parPv_id
41
Dim RecCount
42
 
43
'------------ Constants Declaration -----------
44
'------------ Variable Init -------------------
45
parAdd_type = Request("add_type")
46
parPkgfind = Request("pkgfind")
47
parPv_id = Request("pv_id")
48
'----------------------------------------------
49
%>
50
<%
51
Function Page_Title ( NNadd_type )
52
   If NNadd_type = Cstr(enum_ADD_PACKAGES) Then
53
      Page_Title = "ADD package"
54
 
55
   ElseIf NNadd_type = Cstr(enum_ADD_DEPENDENCIES) Then
56
      Page_Title = "ADD dependency"
57
 
58
   ElseIf NNadd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES) Then
59
      Page_Title = "ADD Runtime Dependency"
60
 
61
   Else
62
      Page_Title = ""
63
 
64
   End If
65
End Function
66
 
67
Function Search_For_Package_Names ( SSpkgfind )
68
   Dim pkg_name_like, SQLor, pkglistARR
69
 
70
   SQLor = ""
71
   If Len( Replace( SSpkgfind, " ", "" ) ) = 0 Then
72
      ' Show all pkg names
73
      SQLor = " OR pkg.pkg_name LIKE '%'"
74
 
75
   Else
76
      ' Search for ...
77
      pkglistARR = Split( Trim( SSpkgfind ), " ")
78
 
79
      If Ubound( pkglistARR ) > 0 Then
80
         ' Multiple pkg_name search
81
         For Each pkg_name_like In pkglistARR
82
            If pkg_name_like <> "" Then
83
               SQLor = SQLor &" OR UPPER(pkg.pkg_name) LIKE UPPER('%"& pkg_name_like &"%')"
84
            End If
85
         Next
86
 
87
      Else
88
         ' Single pkg_name search
89
         SQLor = " OR UPPER(pkg.pkg_name) LIKE UPPER('%"& Trim( SSpkgfind ) &"%')"
90
      End If
91
 
92
   End If
93
 
94
   ' Search may be restricted to those packages that have versions in the specified release, so alter the
95
   ' query accordingly.
96
   If ( (NOT IsNull(parAdd_type)) AND (NOT IsNull(parRtag_id)) AND (parAdd_type = Cstr(enum_ADD_DEPENDENCIES)) ) Then
97
      ' find all packages matching wildcard, that have versions in the specified release, and that are not already
98
      ' configured as a build dependency, and that is not the actual package we are configuring dependencies for
99
      Search_For_Package_Names = _
100
      " SELECT pkg.*, pv.pv_id, pv.v_ext"&_
101
      "  FROM packages pkg, release_content rc, package_versions pv"&_
102
      " WHERE pkg.pkg_id != 0"&_
103
      "   AND pv.pkg_id = pkg.pkg_id"&_
104
      "   AND pv.pv_id = rc.pv_id"&_
105
      "   AND rc.pv_id NOT IN (SELECT pd.dpv_id FROM package_dependencies pd WHERE pd.pv_id = "& parPv_id & ")"&_
106
      "   AND pkg.pkg_id NOT IN (SELECT pvv.pkg_id FROM package_versions pvv WHERE pvv.pv_id = "& parPv_id & ")"&_
107
      "   AND rc.rtag_id = "& parRtag_id &_
108
      "   AND ( pkg.pkg_name = ''"&_
109
      SQLor &_
110
      "       )"&_
111
      "ORDER BY UPPER(pkg.pkg_name)"
112
   Else
113
      If ( (NOT IsNull(parAdd_type)) AND (NOT IsNull(parRtag_id)) AND (parAdd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES)) ) Then
114
         ' find all packages matching wildcard, that have versions in the specified release, and that are not already
115
         ' configured as a runtime dependency, and that is not the actual package we are configuring dependencies for
116
         Search_For_Package_Names = _
117
         " SELECT pkg.*, pv.pv_id, pv.v_ext"&_
118
         "  FROM packages pkg, release_content rc, package_versions pv"&_
119
         " WHERE pkg.pkg_id != 0"&_
120
         "   AND pv.pkg_id = pkg.pkg_id"&_
121
         "   AND pv.pv_id = rc.pv_id"&_
122
         "   AND pv.pv_id NOT IN (SELECT rtd.rtd_id FROM runtime_dependencies rtd WHERE rtd.pv_id = "& parPv_id & ")"&_
123
         "   AND pkg.pkg_id NOT IN (SELECT pvv.pkg_id FROM package_versions pvv WHERE pvv.pv_id = "& parPv_id & ")"&_
124
         "   AND rc.rtag_id = "& parRtag_id &_
125
         "   AND ( pkg.pkg_name = ''"&_
126
         SQLor &_
127
         "       )"&_
128
         "ORDER BY UPPER(pkg.pkg_name)"
129
      Else
130
         ' simply find all packages matching wildcard, regardless of the specified release or any other constraint
131
         ' This is needed when user is adding package versions to a release.
6289 dpurdie 132
         ' Only allow the addition of package names that have versions
5357 dpurdie 133
         Search_For_Package_Names = _
134
         " SELECT pkg.*"&_
135
         "  FROM packages pkg"&_
136
         " WHERE pkg.pkg_id != 0"&_
137
         "   AND ( pkg.pkg_name = ''"&_
138
         SQLor &_
139
         "       )"&_
6289 dpurdie 140
         "  AND  exists (select 1 from PACKAGE_VERSIONS pv where pv.PKG_ID = pkg.PKG_ID)" &_
5357 dpurdie 141
         "ORDER BY UPPER(pkg.pkg_name)"
142
      End If
143
   End If
144
 
145
End Function
146
%>
147
<html>
148
<head>
149
<title>Release Manager</title>
150
<link rel="shortcut icon" href="<%=FavIcon%>"/>
151
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
152
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 153
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
154
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
155
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 156
<!-- DROPDOWN MENUS -->
5983 dpurdie 157
<!--#include file="_jquery_includes.asp"-->
5357 dpurdie 158
<!--#include file="_menu_def.asp"-->
6579 dpurdie 159
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 160
</head>
161
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();document.pkgnames.btnnext.focus();">
162
<!-- HEADER -->
163
<!--#include file="_header.asp"-->
164
<!-- BODY ---->
165
<table width="100%" height="80%" border="0" cellpadding="0" cellspacing="0">
166
   <tr>
6874 dpurdie 167
      <td align="center" valign="top" class='bg_grey'>
5357 dpurdie 168
         <!-- MIDDLE ---------------------------------------->
6874 dpurdie 169
         <div>
170
             <div class=Panel style='width:650px;margin-top: 30px;'>
171
                 <div class=rounded_box_caption><%=Page_Title ( parAdd_type )%></div>
172
                 <div class='rounded_box'>
173
                     <div class=rounded_box_pad>
174
                   <!-- Body -->
175
                   <br>
176
                   <table width="100%" border="0" cellspacing="0" cellpadding="0">
177
                      <tr>
178
                         <td valign="bottom" nowrap>
179
                            <span class="form_txt">Search result for <strong><%=parPkgfind%></strong></span>
180
                         </td>
181
                         <td align="right" valign="top" nowrap>
182
                            <a href="form_new_version.asp?rtag_id=<%=parRtag_id%>&pkgName=<%=parPkgfind%>" class="body_txt_drk">
183
                            <strong>Not found what you looking for?</strong>
184
                            <br>
185
                            <img src="images/i_new_pkg.gif" width="20" height="21" hspace="3" border="0" align="absmiddle">Create new package name.</a>
186
                         </td>
187
                      </tr>
188
                   </table>
189
                   <br>
190
                   <div class=textPanel>
191
                    Select desired packages and click Next.
192
                    </div>
193
                    <form name="pkgnames" method="post" action="form_add_pkg_versions.asp?add_type=<%=parAdd_type%>">
194
                    <table width="100%" border="0" cellspacing="1" cellpadding="2" class=stdGrey>
195
                         <thead>
196
                            <th width="1%"></th>
197
                            <th>Package Name</th>
198
                         </thead>
199
                         <%Set rsFind = OraDatabase.DbCreateDynaset( Search_For_Package_Names ( parPkgfind ), cint(0))%>
200
                         <%RecCount = CInt(rsFind.RecordCount)%>
201
                         <%While ((NOT rsFind.BOF) AND (NOT rsFind.EOF)) %>
202
                            <tr>
203
                               <td>
204
                                  <%If ( (NOT IsNull(parAdd_type)) AND ((parAdd_type = Cstr(enum_ADD_DEPENDENCIES)) OR (parAdd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES))) ) Then%>
205
                                     <input name="pkg_list" id="pkg_list" type="checkbox" value="<%=rsFind("pv_id")%>" <%If RecCount = 1 Then%>checked<%End If%>>
206
                                  <%Else%>
207
                                     <input name="pkg_list" id="pkg_list" type="checkbox" value="<%=rsFind("pkg_id")%>" <%If RecCount = 1 Then%>checked<%End If%>>
208
                                  <%End If%>
209
                               </td>
210
                               <td>
211
                                  <%
212
                                  Dim ver_ext
213
                                  ver_ext = ""
214
                                  If ( (NOT IsNull(parAdd_type)) AND (NOT IsNull(parRtag_id)) AND ((parAdd_type = Cstr(enum_ADD_DEPENDENCIES)) OR (parAdd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES))) ) Then
215
                                     ver_ext = rsFind("v_ext")
216
                                     If NOT IsNull(ver_ext) AND ver_ext <> "" Then
217
                                        ' Remove leading dot character, if there is one
218
                                        If Left(ver_ext,1) = "." AND Len(ver_ext) > 1 Then
219
                                           ver_ext = Mid(ver_ext, 2, Len(ver_ext)-1)
220
                                        Else
221
                                           ver_ext = ""
222
                                        End If
223
                                     End If
224
                                  End If
225
                                  %>
5357 dpurdie 226
 
6874 dpurdie 227
                                  <%If NOT IsNull(ver_ext) AND Len(ver_ext) > 0 Then%>
228
                                     <%=Highlight_Substring ( rsFind("pkg_name"), parPkgfind )%>&nbsp&nbsp&nbsp&nbsp(<%=ver_ext%>)
229
                                  <%Else%>
230
                                     <%=Highlight_Substring ( rsFind("pkg_name"), parPkgfind )%>
231
                                  <%End If%>
232
                               </td>
233
                            </tr>
234
                            <%rsFind.MoveNext
235
                         WEnd
5357 dpurdie 236
 
6874 dpurdie 237
                         rsFind.Close
238
                         Set rsFind = nothing
239
                         %>
240
                   </table>
241
                     </div>
242
               <%If Request("errmsg") <> "" Then %>
243
                <div class='textPanel rounded_box_pad'>
244
                   <%Call DisplayInfo( "PKG_NAME_REQUIRED", 200 )%>
245
                </div>
246
               <%End If%>
247
               <div class='buttonPanel'>
248
                   <input type="reset" name="btn" value="&laquo; Back" onClick="history.back();">
249
                   <input type="submit" name="btn" value="Next &raquo;" id="btnnext">
250
                   <input type="reset" name="btn" value="Cancel" onClick="history.go(-2);">
251
                   <input type="hidden" name="pv_id" value="<%=parPv_id%>">
252
                   <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
253
                   <input type="hidden" name="add_type" value="<%=parAdd_type%>">
254
                   <input type="hidden" name="pkgfind" value="<%=parPkgfind%>">
255
               </div>
256
               </form>
257
            <!-- END Body-->
258
                </div>
259
            </div>
260
        </div>
261
    </td>
262
</tr>
263
</table>
5957 dpurdie 264
 <!-- FOOTER -->
265
 <!--#include file="_footer.asp"-->
5357 dpurdie 266
</body>
267
</html>