Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5355 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			          wFTP						 	 |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/config.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/_popup_window_common.asp"-->
17
<!--#include file="class/classTabControl.asp"-->
18
<!--#include file="class/classTemplateManager.asp"-->
19
<%
20
'------------ ACCESS CONTROL ------------------
21
%>
22
<!--#include file="_access_control_general.asp"-->
23
<%
24
'------------ VARIABLE DEFINITION -------------
25
Dim objTabControl
26
Dim objTemplateManager
27
Dim rsQry
28
Dim OsTab
29
'------------ CONSTANTS DECLARATION -----------
30
'------------ VARIABLE INIT -------------------
31
 
32
Call GetMainDBParameters ( dbPARproj_id, dbPARbranch_id, dbPARbom_id, dbPARnode_id, dbPARos_id, dbPARprod_id )
33
parNode_id = dbPARnode_id
34
parOs_id = dbPARos_id
35
'------------ CONDITIONS ----------------------
36
'----------------------------------------------
37
%>
38
<%
39
'--------------------------------------------------------------------------------------------------------------------------
40
Function GenerateFTPscript ( nOsId )
41
	Dim rsQry, query, returnString
42
	Dim	projName, branchName, osName
43
	Dim PkgName, PkgVersion, Ext, Description, PkgHealthTag, CmdInterface, Owner, IsInterface, PkgFlag, VersionFlag
44
 
45
	OraDatabase.Parameters.Add "OS_ID", nOsId,	ORAPARM_INPUT, ORATYPE_NUMBER 
46
 
47
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("NodeSpecDetails.sql"), ORADYN_DEFAULT )		
48
 
49
	'returnString = NULL
50
 
51
	projName	=	rsQry("proj_name")
52
	branchName	=	rsQry("branch_name")
53
	osName	=	rsQry("os_name")
54
 
55
 
56
	If osName = "Solaris" Then
57
		osName = "sparc"
58
	Else
59
		osName = "win32"
60
	End If
61
 
62
	OraDatabase.Parameters.Remove "OS_ID"	
63
 
64
	rsQry.Close
65
	Set rsQry = Nothing
66
 
67
	OraDatabase.Parameters.Add "OS_ID", nOsId,	ORAPARM_INPUT, ORATYPE_NUMBER 
68
 
69
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ProductsList.sql"), ORADYN_DEFAULT )
70
 
71
 
72
	returnString	=	returnString	+	"#FTP Script for WIN32" + VBNewLine
73
	returnString	=	returnString	+	"#ftp -s:<SCRIPT_FILE>" + VBNewLine
74
	returnString	=	returnString	+	"open auperaunx26" + VBNewLine
75
	returnString	=	returnString	+	"<USERNAME>" + VBNewLine
76
	returnString	=	returnString	+	"<PASSWORD>" + VBNewLine
77
	returnString	=	returnString	+	"binary" + VBNewLine
78
	returnString	=	returnString	+	"prompt" + VBNewLine
79
	returnString	=	returnString	+	"cd /export" + VBNewLine
80
	returnString	=	returnString	+	"cd deploy" + VBNewLine
81
	returnString	=	returnString	+	"cd releases" + VBNewLine
82
	returnString	=	returnString	+	"cd "&chr(34)&projName&chr(34) + VBNewLine
83
	returnString	=	returnString	+	"cd "&chr(34)&branchName&chr(34) + VBNewLine
84
 
85
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
86
 
87
		If osName = "win32" Then
88
			returnString = returnString	+	"mget "&chr(34)&rsQry("pkg_name")&"/"&osName&"/"&rsQry("pkg_version")&"/release/"&rsQry("pkg_name")&"-"&rsQry("pkg_version")&".exe"&chr(34)&""& VbNewLine
89
		Else
90
			returnString = returnString	+	"mget "&chr(34)&rsQry("pkg_name")&"/"&osName&"/"&rsQry("pkg_version")&"/release/"&rsQry("pkg_name")&"-"&rsQry("pkg_version")&".pkg.gz"&chr(34)&""& VbNewLine
91
		End If
92
 
93
		rsQry.MoveNext()
94
	WEnd
95
 
96
	returnString	=	returnString	+	"bye" + VBNewLine
97
 
98
	rsQry.Close
99
	Set rsQry = Nothing
100
 
101
 
102
 
103
 
104
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ProductsList.sql"), ORADYN_DEFAULT )
105
 
106
 
107
	projName = Replace(projName, " ", "\ ")
108
	projName = Replace(projName, "(", "\(")
109
	projName = Replace(projName, ")", "\)")
110
 
111
	branchName = Replace(branchName, " ", "\ ")
112
 
113
	returnString = returnString + VBNewLine + VBNewLine + VBNewLine
114
	returnString	=	returnString	+	"#FTP script for SPARC" + VBNewLine
115
	returnString	=	returnString	+	"#ftp -n -v auperaunx26 < <SCRIPT_FILE>" + VBNewLine
116
	returnString	=	returnString	+	"user" + VBNewLine
117
	returnString	=	returnString	+	"<USERNAME>" + VBNewLine
118
	returnString	=	returnString	+	"binary" + VBNewLine
119
	returnString	=	returnString	+	"prompt" + VBNewLine
120
	returnString	=	returnString	+	"cd /export" + VBNewLine
121
	returnString	=	returnString	+	"cd deploy" + VBNewLine
122
	returnString	=	returnString	+	"cd releases" + VBNewLine
123
	returnString	=	returnString	+	"cd "&projName + VBNewLine
124
	returnString	=	returnString	+	"cd "&branchName + VBNewLine
125
 
126
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
127
		returnString	=	returnString	+	"cd "&rsQry("pkg_name") + VBNewLine	
128
		returnString	=	returnString	+	"cd "&osName + VBNewLine	
129
		returnString	=	returnString	+	"cd "&rsQry("pkg_version") + VBNewLine
130
		returnString	=	returnString	+	"cd release" + VBNewLine
131
 
132
		If osName = "win32" Then
133
			returnString	=	returnString	+	"get "&rsQry("pkg_name")&"-"&rsQry("pkg_version")&".exe" + VBNewLine
134
		Else
135
			returnString	=	returnString	+	"get "&rsQry("pkg_name")&"-"&rsQry("pkg_version")&".pkg.gz" + VBNewLine
136
		End If
137
 
138
		returnString	=	returnString	+	"cd .." + VBNewLine	
139
		returnString	=	returnString	+	"cd .." + VBNewLine
140
		returnString	=	returnString	+	"cd .." + VBNewLine
141
		returnString	=	returnString	+	"cd .." + VBNewLine
142
 
143
		rsQry.MoveNext()
144
	WEnd
145
	OraDatabase.Parameters.Remove "OS_ID"
146
	returnString	=	returnString	+	"bye" + VBNewLine
147
 
148
	rsQry.Close
149
	Set rsQry = Nothing
150
 
151
	' Return string 
152
	GenerateFTPscript = returnString
153
 
154
End Function
155
'--------------------------------------------------------------------------------------------------------------------------
156
%>
157
<%
158
'------------ RUN BEFORE PAGE RENDER ----------
159
 
160
 
161
'----------------------------------------------
162
%>
163
<html>
164
<head>
165
<title>Deployment Manager</title>
166
<link rel="shortcut icon" href="<%=FavIcon%>"/>
167
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
168
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
169
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
170
<script language="JavaScript" src="scripts/common.js"></script>
171
</head>
172
 
173
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();">
174
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
175
  <tr>
176
    <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;FTP Script Export </span> <br>
177
    Click on the text to select.</td>
178
  </tr>
179
</table>
180
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
181
  <tr>
182
    <td width="1" background="images/bg_blue.gif"><img src="images/spacer.gif" width="10" height="35"></td>
183
    <td width="100%" background="images/bg_blue.gif" valign="bottom">
184
	<!-- TAB CONTROLS ++++++++++++++++++++++ -->
185
		<%
186
		'[1] Tab Name
187
		'[2] Tab Link
188
		'[3] JavaScript Event e.g. "onClick='...'"
189
		'[4] Tab Image Selected
190
		'[5] Tab Image Diselected
191
		'[6] Tab Image Disabled
192
		'[7] Tab Hint
193
		'[8] Force Disable. Values: Y, N(default)
194
 
195
 
196
		OraDatabase.Parameters.Add "NODE_ID", parNode_id, ORAPARM_INPUT, ORATYPE_NUMBER 
197
 
198
		Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("OsList.sql"), ORADYN_DEFAULT )
199
 
200
		OraDatabase.Parameters.Remove "NODE_ID"
201
 
202
 
203
		Set objTabControl = New TabControl
204
		objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleWinXP/tab_style.html") ) ' Supply tab style definition
205
		objTabControl.TabStyle = "StyleWinXP"
206
 
207
		If Request("ostab") <> "" Then
208
			OsTab = CDbl( Request("ostab") )
209
		Else
210
			OsTab = 0
211
		End If
212
 
213
 
214
		While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
215
 
216
			objTabControl.Add ( Array( rsQry("os_name"), SCRIPT_NAME &"?ostab="& rsQry("os_id") &"&"& objPMod.ComposeURL() , "", "", "", "", "", "" ) )
217
 
218
			If OsTab = 0 Then
219
				OsTab = CDbl( rsQry("os_id"))
220
				objTabControl.SelectByName rsQry("os_name")
221
 
222
			ElseIf OsTab = CDbl(rsQry("os_id")) Then
223
				OsTab = rsQry("os_id")
224
				objTabControl.SelectByName rsQry("os_name")
225
 
226
			End If
227
 
228
 
229
			rsQry.MoveNext()
230
		WEnd
231
 
232
		rsQry.Close()
233
		Set rsQry = nothing
234
 
235
 
236
		objTabControl.Render ()
237
		%>
238
		<!-- END OF TAB CONTROLS +++++++++++++++ -->
239
	</td>
240
    <td width="1" background="images/bg_blue.gif"></td>
241
  </tr>
242
  <tr>
243
    <td>&nbsp;</td>
244
    <td><br><textarea name="textfield" cols="70" rows="20" wrap="OFF" class="body_cmd" onFocus="this.select()"><%=GenerateFTPscript( OsTab )%></textarea></td>
245
    <td>&nbsp;</td>
246
  </tr>
247
</table>
248
</body>
249
</html>
250
<%
251
'------------ RUN AFTER PAGE RENDER -----------
252
'----------------------------------------------
253
%><!--#include file="common/globals_destructor.asp"-->