Subversion Repositories DevTools

Rev

Rev 6070 | Rev 6579 | Go to most recent revision | 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">
153
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
154
<link rel="stylesheet" href="images/navigation.css" type="text/css">
155
<script language="JavaScript" src="images/common.js"></script>
156
<!-- DROPDOWN MENUS -->
5983 dpurdie 157
<!--#include file="_jquery_includes.asp"-->
5357 dpurdie 158
<!--#include file="_menu_def.asp"-->
159
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
160
 
161
</head>
162
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();document.pkgnames.btnnext.focus();">
163
<!-- HEADER -->
164
<!--#include file="_header.asp"-->
165
<!-- BODY ---->
166
<table width="100%" height="80%" border="0" cellpadding="0" cellspacing="0">
167
   <tr>
168
      <td align="center" valign="top" background="images/bg_lght_gray.gif">
169
         <!-- MIDDLE ---------------------------------------->
170
         <table width="650" border="0" cellspacing="0" cellpadding="0">
171
            <tr>
172
               <td>
173
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
174
                     <tr>
175
                        <td width="1%"></td>
176
                        <td align="right"><img src="images/h_trsp_dot.gif" width="30" height="30"></td>
177
                        <td width="1%"></td>
178
                     </tr>
179
                     <tr>
180
                        <td width="1%"></td>
181
                        <td>
182
                           <table width="100%" border="0" cellspacing="0" cellpadding="0">
183
                              <tr>
184
                                 <td nowrap class="form_ttl"><%=Page_Title ( parAdd_type )%></td>
185
                                 <td align="right" valign="bottom"></td>
186
                              </tr>
187
                           </table>
188
                        </td>
189
                        <td width="1%"></td>
190
                     </tr>
191
                     <tr>
192
                        <td align="left" valign="top" width="1%" background="images/lbox_bg_blue.gif">
193
                           <img src="images/lbox_tl_cnr_b.gif" width="13" height="13">
194
                        </td>
195
                        <td background="images/lbox_bg_blue.gif" align="right">
196
                           <!-- Heading --><img src="images/h_trsp_dot.gif" width="1" height="20"><!-- END Heading -->
197
                        </td>
198
                        <td align="right" valign="top" width="1%" background="images/lbox_bg_blue.gif">
199
                           <img src="images/lbox_tr_cnr_b.gif" width="13" height="13">
200
                        </td>
201
                     </tr>
202
                     <tr>
203
                        <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
204
                        <td bgcolor="#FFFFFF" valign="top">
205
                           <!-- Body -->
206
                           <br>
207
                           <table width="100%" border="0" cellspacing="0" cellpadding="0">
208
                              <tr>
209
                                 <td valign="bottom" nowrap>
210
                                    <span class="form_txt">Search result for <strong><%=parPkgfind%></strong></span>
211
                                 </td>
212
                                 <td align="right" valign="top" nowrap>
213
                                    <a href="form_new_version.asp?rtag_id=<%=parRtag_id%>&pkgName=<%=parPkgfind%>" class="body_txt_drk">
214
                                    <strong>Not found what you looking for?</strong>
215
                                    <br>
216
                                    <img src="images/i_new_pkg.gif" width="20" height="21" hspace="3" border="0" align="absmiddle">Create new package name.</a>
217
                                 </td>
218
                              </tr>
219
                           </table>
220
                           <br>
221
                           <table width="100%" border="0" cellspacing="1" cellpadding="2">
222
                              <form name="pkgnames" method="post" action="form_add_pkg_versions.asp?add_type=<%=parAdd_type%>">
223
                                 <tr>
224
                                    <td colspan="2" valign="bottom" nowrap class="form_txt">Select desired packages and click Next.</td>
225
                                 </tr>
226
                                 <tr>
227
                                    <td background="images/bg_form_lightbluedark.gif"></td>
228
                                    <td background="images/bg_form_lightbluedark.gif" class="form_txt"><b>Package Name</b></td>
229
                                 </tr>
230
                                 <%Set rsFind = OraDatabase.DbCreateDynaset( Search_For_Package_Names ( parPkgfind ), cint(0))%>
231
                                 <%RecCount = CInt(rsFind.RecordCount)%>
232
                                 <%While ((NOT rsFind.BOF) AND (NOT rsFind.EOF)) %>
233
                                    <tr>
234
                                       <td background="images/bg_form_lightgray.gif">
235
                                          <%If ( (NOT IsNull(parAdd_type)) AND ((parAdd_type = Cstr(enum_ADD_DEPENDENCIES)) OR (parAdd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES))) ) Then%>
236
                                             <input name="pkg_list" id="pkg_list" type="checkbox" value="<%=rsFind("pv_id")%>" <%If RecCount = 1 Then%>checked<%End If%>>
237
                                          <%Else%>
238
                                             <input name="pkg_list" id="pkg_list" type="checkbox" value="<%=rsFind("pkg_id")%>" <%If RecCount = 1 Then%>checked<%End If%>>
239
                                          <%End If%>
240
                                       </td>
241
                                       <td background="images/bg_form_lightgray.gif" class="form_txt">
242
                                          <%
243
                                          Dim ver_ext
244
                                          ver_ext = ""
245
                                          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
246
                                             ver_ext = rsFind("v_ext")
247
                                             If NOT IsNull(ver_ext) AND ver_ext <> "" Then
248
                                                ' Remove leading dot character, if there is one
249
                                                If Left(ver_ext,1) = "." AND Len(ver_ext) > 1 Then
250
                                                   ver_ext = Mid(ver_ext, 2, Len(ver_ext)-1)
251
                                                Else
252
                                                   ver_ext = ""
253
                                                End If
254
                                             End If
255
                                          End If
256
                                          %>
257
 
258
                                          <%If NOT IsNull(ver_ext) AND Len(ver_ext) > 0 Then%>
259
                                             <%=Highlight_Substring ( rsFind("pkg_name"), parPkgfind )%>&nbsp&nbsp&nbsp&nbsp(<%=ver_ext%>)
260
                                          <%Else%>
261
                                             <%=Highlight_Substring ( rsFind("pkg_name"), parPkgfind )%>
262
                                          <%End If%>
263
                                       </td>
264
                                    </tr>
265
                                    <%rsFind.MoveNext
266
                                 WEnd
267
 
268
                                 rsFind.Close
269
                                 Set rsFind = nothing
270
                                 %>
271
                                 <tr>
272
                                    <td width="1%" nowrap class="form_field">&nbsp; </td>
273
                                    <td nowrap width="100%" class="form_txt">
274
                                       <%If Request("errmsg") <> "" Then Call DisplayInfo( "PKG_NAME_REQUIRED", 200 )%>
275
                                       <input type="reset" name="btn" value="&laquo; Back" class="form_btn" onClick="history.back();">
276
                                       <input type="submit" name="btn" value="Next &raquo;" class="form_btn" id="btnnext">
277
                                       <input type="reset" name="btn" value="Cancel" class="form_btn" onClick="history.go(-2);">
278
                                       <br>
279
                                       <br>
280
                                    </td>
281
                                 </tr>
282
                                 <input type="hidden" name="pv_id" value="<%=parPv_id%>">
283
                                 <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
284
                                 <input type="hidden" name="add_type" value="<%=parAdd_type%>">
285
                                 <input type="hidden" name="pkgfind" value="<%=parPkgfind%>">
286
                              </form>
287
                           </table>
288
                        <!-- END Body-->
289
                        </td>
290
                        <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
291
                     </tr>
292
                     <tr>
293
                        <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom">
294
                           <img src="images/lbox_bl_cnr_b.gif" width="13" height="13">
295
                        </td>
296
                        <td background="images/lbox_bg_blue.gif"></td>
297
                        <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom" align="right">
298
                           <img src="images/lbox_br_cnr_b.gif" width="13" height="13">
299
                        </td>
300
                     </tr>
301
                  </table>
302
               </td>
303
            </tr>
304
         </table>
305
         <!-------------------------------------------------->
306
      </td>
307
   </tr>
5957 dpurdie 308
 <!-- FOOTER -->
309
 <!--#include file="_footer.asp"-->
5357 dpurdie 310
</table>
311
</body>
312
</html>