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