Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
129 ghuddy 5
'|                       NEW                         |
6
'|                     PACKAGE                       |
119 ghuddy 7
'|                                                   |
8
'=====================================================
9
%>
10
<%
11
Option explicit
12
' Good idea to set when using redirect
129 ghuddy 13
Response.Expires = 0   ' always load the page, dont store
119 ghuddy 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
<%
22
'------------ ACCESS CONTROL ------------------
23
%>
24
<!--#include file="_access_control_login.asp"-->
25
<!--#include file="_access_control_general.asp"-->
26
<%
27
'------------ Variable Definition -------------
28
Dim parAdd_type
29
Dim parPv_id
30
Dim retPKG_ID
31
Dim parUpdate_type
32
Dim parErrMsg
33
Dim parPkg_name
34
'------------ Constants Declaration -----------
35
'------------ Variable Init -------------------
36
parAdd_type = Request("add_type")
37
parUpdate_type = Request("update_type")
38
parPv_id = Request("pv_id")
39
parRtag_id = Request("rtag_id")
40
parErrMsg = Request("errmsg")
41
parPkg_name = Request.Cookies( COOKIE_NAME )( "pkgfind" )
42
'----------------------------------------------
43
%>
44
<%
45
Sub Create_Package_Name ( SSpkg_name, retPKG_ID )
129 ghuddy 46
   OraDatabase.Parameters.Add "PKG_NAME", Trim(SSpkg_name), ORAPARM_INPUT, ORATYPE_VARCHAR2
47
   OraDatabase.Parameters.Add "retPKG_ID", 0, ORAPARM_OUTPUT, ORATYPE_NUMBER
119 ghuddy 48
 
129 ghuddy 49
   objEH.TryORA ( OraSession )
50
   On Error Resume Next
119 ghuddy 51
 
129 ghuddy 52
   OraDatabase.ExecuteSQL "BEGIN New_Package_Name ( :PKG_NAME, :retPKG_ID ); END;"
119 ghuddy 53
 
129 ghuddy 54
   objEH.CatchORA ( OraSession )
119 ghuddy 55
 
129 ghuddy 56
   retPKG_ID = OraDatabase.Parameters("retPKG_ID").Value
57
 
58
   OraDatabase.Parameters.Remove "PKG_NAME"
59
   OraDatabase.Parameters.Remove "retPKG_ID"
119 ghuddy 60
End Sub
61
'-----------------------------------------------------------------------------------------------------------------------------
62
Function Package_Name_Is_Valid ( SSpkg_name )
129 ghuddy 63
   Dim objRegExpr
64
   Set objRegExpr = New regexp
119 ghuddy 65
 
129 ghuddy 66
   objRegExpr.Pattern = "^[a-z][a-z0-9_-]*[a-z0-9]$"
67
   objRegExpr.IgnoreCase = True
119 ghuddy 68
 
129 ghuddy 69
   Package_Name_Is_Valid = objRegExpr.Test(SSpkg_name)
119 ghuddy 70
End Function
71
'-----------------------------------------------------------------------------------------------------------------------------
72
Function Package_Name_Exists ( SSpkg_name )
129 ghuddy 73
   Dim sqlStr, rsQry
119 ghuddy 74
 
129 ghuddy 75
   sqlStr = "SELECT pkg_name FROM packages WHERE UPPER(pkg_name) = UPPER('" & Trim(SSpkg_name) & "')"
119 ghuddy 76
 
129 ghuddy 77
   Set rsQry = OraDatabase.DbCreateDynaset( sqlStr, cint(0))
119 ghuddy 78
 
129 ghuddy 79
   Package_Name_Exists = rsQry.recordCount > 0
119 ghuddy 80
End Function
81
%>
82
<%
83
If CBool(Request("action")) Then
129 ghuddy 84
   ' Process Form
85
   If Package_Name_Exists(Request("pkg_name")) Then
86
      Response.Redirect ( scriptName &"?rtag_id="& parRtag_id &"&add_type="& parAdd_type &"&errmsg=exists" )
87
   ElseIf Package_Name_Is_Valid(Request("pkg_name")) Then
88
      Call Create_Package_Name ( Request("pkg_name"), retPKG_ID )
89
      Response.Redirect ( "form_add_pkg_versions.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id &"&add_type="& parAdd_type &"&pkg_list="& retPKG_ID)
90
   Else
91
      Response.Redirect ( scriptName &"?rtag_id="& parRtag_id &"&add_type="& parAdd_type &"&errmsg=invalid" )
92
   End If
119 ghuddy 93
End If
94
%>
95
<html>
96
<head>
97
<title>Release Manager</title>
98
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
99
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
100
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
101
<link rel="stylesheet" href="images/navigation.css" type="text/css">
102
<script language="JavaScript" src="images/common.js"></script>
103
<script language="JavaScript">
104
<!--
129 ghuddy 105
   function trimString(elementId)
106
   {
107
      var element = document.getElementById(elementId);
108
      if (element.value == null || element.value == "") return null;
109
      element.value = element.value.replace(/^(\s+)?(.*\S)(\s+)?$/, '$2');
110
   }
119 ghuddy 111
//-->
112
</script>
113
<!-- DROPDOWN MENUS -->
114
<!--#include file="_menu_def.asp"-->
115
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
116
 
117
</head>
118
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onLoad="window.document.newpkg.pkgname.focus();">
119
<!-- MENU LAYERS -------------------------------------->
120
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)">
121
</div>
122
<!-- TIPS LAYERS -------------------------------------->
123
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
124
<!----------------------------------------------------->
125
<!-- HEADER -->
126
<!--#include file="_header.asp"-->
127
<!-- BODY ---->
128
<table width="100%" height="80%" border="0" cellpadding="0" cellspacing="0">
129
  <tr>
130
    <td align="center" valign="top" background="images/bg_lght_gray.gif">
129 ghuddy 131
   <!-- MIDDLE ---------------------------------------->
132
   <table width="650" border="0" cellspacing="0" cellpadding="0">
133
     <tr>
134
       <td>
135
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
136
           <tr>
137
             <td width="1%"></td>
138
             <td align="right"><img src="images/h_trsp_dot.gif" width="30" height="30"></td>
139
             <td width="1%"></td>
140
           </tr>
141
           <tr>
142
             <td width="1%"></td>
143
             <td>
144
               <table width="100%" border="0" cellspacing="0" cellpadding="0">
145
                 <tr>
146
                     <td nowrap class="form_ttl">NEW package name</td>
147
                   <td align="right" valign="bottom"></td>
148
                 </tr>
149
               </table>
150
             </td>
151
             <td width="1%"></td>
152
           </tr>
153
           <tr>
154
             <td align="left" valign="top" width="1%" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
155
             <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><!-- Heading --><img src="images/h_trsp_dot.gif" width="1" height="20"><!-- END Heading --></td>
156
             <td align="right" valign="top" width="1%" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
157
           </tr>
158
           <tr>
159
             <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
160
             <td bgcolor="#FFFFFF" valign="top">
161
               <!-- Body -->
162
               <table width="100%" border="0" cellspacing="1" cellpadding="2">
163
               <form name="newpkg" method="post" action="<%=scriptName%>" onSubmit="trimString('pkgname');MM_validateForm('pkg_name','Package Name','R<%If parAdd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES) Then%>notHTML<%Else%>isPackage<%End If%>');return document.MM_returnValue">
164
                 <tr>
165
                   <td width="100%" colspan="3" nowrap align="center" class="form_group">
166
                   <%If parErrMsg = "invalid" Then
167
                       Call DisplayInfo( "PKG_NAME_INVALID", 420 )
168
                     ElseIf parErrMsg = "exists" Then
169
                       Call DisplayInfo( "PKG_NAME_EXISTS", 300 )
170
                     End If%>
171
                   </td>
172
                 </tr>
173
                 <tr>
174
                   <td width="1%">&nbsp;</td>
175
                   <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif"><br>Package Name<br><br></td>
176
                   <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="body_txt"><br><input name="pkg_name" type="text" class="form_item" id="pkgname" size="40" value="<%=parPkg_name%>"><br><br></td>
177
                 </tr>
178
                 <tr>
179
                   <td width="1%">&nbsp;</td>
180
                   <td width="1%" nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
181
                   <td nowrap width="100%">
182
                   <input type="submit" name="btn" value="Create" class="form_btn">
183
                   <input type="reset" name="btn" value="Cancel" class="form_btn" onClick="history.back();">
184
                   <br><br>
185
                   </td>
186
                 </tr>
187
               <input type="hidden" name="pv_id" value="<%=parPv_id%>">
188
               <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
189
               <input type="hidden" name="add_type" value="<%=parAdd_type%>">
190
               <input type="hidden" name="action" value="true">
191
               </form>
192
               </table>
193
               <!-- END Body-->
194
             </td>
195
             <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
196
           </tr>
197
           <tr>
198
             <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
199
             <td background="images/lbox_bg_blue.gif"></td>
200
             <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
201
           </tr>
202
         </table>
203
       </td>
204
     </tr>
205
   </table>
206
   <!-------------------------------------------------->
207
   </td>
208
   </tr>
209
   <tr>
210
     <td valign="bottom" background="images/bg_lght_gray.gif">
211
   <!-- FOOTER -->
212
   <!--#include file="_footer.asp"-->
213
     </td>
119 ghuddy 214
  </tr>
215
</table>
216
</body>
217
</html>
218
<%
219
Call Destroy_All_Objects
220
%>