Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
62 rsolanki 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			          wNodeSpec					 	 |
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 GenerateOsSpec ( nOsId )
41
	Dim rsQry, query, returnString
42
	Dim PkgName, PkgVersion, Ext, Description, PkgHealthTag, CmdInterface, Owner, IsInterface, PkgFlag, VersionFlag
43
 
44
	OraDatabase.Parameters.Add "OS_ID", nOsId,	ORAPARM_INPUT, ORATYPE_NUMBER 
45
 
46
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("NodeSpecDetails.sql"), ORADYN_DEFAULT )		
47
 
48
	returnString = NULL
49
 
50
	returnString = returnString &_
51
	"#Copyright ERG Transit Systems (c) 1998-2006, All Rights Reserved"& VBNewline &_
52
	"#----------------------------------------------------------------"& VBNewline &_
53
	"#**** Source Information ****"& VBNewline &_
54
	"#"& VBNewline &_
55
	"#Source File Name: "& rsQry("node_spec_file")& VBNewline &_
56
	"#"& VBNewline &_
57
	"#Source File Type: PERL Module File (.pm)"& VBNewline &_
58
	"#"& VBNewline &_
59
	"#Author: Deployment Manager"& VBNewline &_
60
	"#"& VBNewline &_
61
	"#Purpose: This file contains the package specification for"& VBNewline &_ 
62
	"#	"& rsQry("node_name") &" node."& VBNewline &_
63
	"#"& VBNewline &_
64
	"#	The data is provided in the form of two PERL preinitialised"& VBNewline &_
65
	"#	HASH of HASHES"& VBNewline &_
66
	"#"& VBNewline &_
67
	"#	The first hash contains all details regarding the persistant"& VBNewline &_
68
	"#	processes running on the node. It contains the following fields,"& VBNEWline &_
69
	"#"& VBNEWline &_
70
	"#	-PkgOnwer"& VBNEWline &_
71
	"#	-PkgHealthTag"& VBNEWline &_
72
	"#	-PkgDesc"& VBNEWline &_
73
	"#	-CmdInterface"& VBNEWline &_
74
	"#"& VBNEWline &_
75
	"#	The second hash contains all details regarding the deployed"& VBNewline &_
76
	"#	packages installed on the node. It contains the following fields,"& VBNewline &_
77
	"#"& VBNEWline &_
78
	"#	-ERGPkgFlag"& VBNEWline &_
79
	"#	-CheckVersionFlag"& VBNEWline &_
80
	"#	-PkgVersion"& VBNEWline &_
81
	"#	-PkgBuildNo"& VBNEWline &_
82
	"#	-PkgDesc"& VBNEWline &_
83
	"#"& VBNEWline &_
84
	"#----------------------------------------------------------------"& VBNewline & VBNewline
85
 
86
 
87
	returnString = returnString &_
88
	"%pkgmnt::G_NodeDmInfo = ("& VBNewLine &_
89
	"	BomName 	=> '"& rsQry("bom_name") &"',"& VBNewLine &_
90
	"	BranchName 	=> '"& rsQry("branch_name") &"',"& VBNewLine &_
91
	"	NodeName 	=> '"& rsQry("node_name") &"',"& VBNewLine &_
92
	"	OsName 		=> '"& rsQry("os_name") &"',"& VBNewLine &_
93
	"	ProjectName 	=>  '"& rsQry("proj_name") &"',"& VBNewLine &_
94
	"	_ForceVersion 	=> {},"& VBNewLine &_
95
	"	_NoAdd 		=> {}"& VBNewLine &_
96
	");"& VBNewLine & VBNewLine 
97
 
98
	returnString = returnString &_
99
	"$pkgmnt::G_NodeSBOMVersion = '"& rsQry("sbom_version") &"';"& VBNewLine & VBNewLine &_
100
	"$pkgmnt::G_NodeName = '"& rsQry("node_name") &"';"& VBNewLine & VBNewLine 
101
 
102
	OraDatabase.Parameters.Remove "OS_ID"	
103
 
104
	rsQry.Close
105
	Set rsQry = Nothing
106
 
107
 
108
	OraDatabase.Parameters.Add "OS_ID", nOsId,	ORAPARM_INPUT, ORATYPE_NUMBER 
109
 
110
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("OsProcessConfig.sql"), ORADYN_DEFAULT )	
111
 
112
 
113
	If rsQry.Recordcount <> 0 Then
114
		returnString = returnString &_
115
		"%pkgmnt::G_NodeProcessHash = ("& VBNewLine 
116
	Else
117
		returnString = returnString &_
118
		"%pkgmnt::G_NodeProcessHash = ("
119
 
120
	End If
121
 
122
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
123
		PkgHealthTag = rsQry("pkg_health_tag")
124
		CmdInterface = rsQry("cmd_interface")
125
		Owner = rsQry("pkg_owner")
126
		IsInterface = rsQry("is_interface")
127
		PkgName = rsQry("pkg_name")
128
 
129
 
130
 
131
		returnString = returnString &_
132
			""& PkgHealthTag &" => {"& VBNewLine &_
133
            "	CmdInterface	=> '"& CmdInterface &"',"& VBNewLine &_
134
            "	IsInterface	=> '"& IsInterface &"',"& VBNewLine &_ 
135
            "	Pkg		=> '"& PkgName &"',"& VBNewLine &_
136
            "	PkgHealthTag	=> '"& PkgHealthTag &"',"& VBNewLine &_
137
            "	PkgOnwer	=> '"& Owner &"'"& VBNewLine &_
138
            "	},"& VBNewLine						
139
 
140
		rsQry.MoveNext()
141
	WEnd	
142
 
143
	' Format final output
144
	If NOT IsNull(returnString) And rsQry.Recordcount <> 0 Then
145
		returnString = Left ( returnString, InStrRev( returnString, "," ) - 1 ) & VBNewLine
146
	End If	
147
 
148
	returnString = returnString &_
149
	");" & VBNewLine & VBNewLine 
150
 
151
	OraDatabase.Parameters.Remove "OS_ID"	
152
 
153
	rsQry.Close
154
	Set rsQry = Nothing	
155
 
156
 
157
	OraDatabase.Parameters.Add "OS_ID", nOsId,	ORAPARM_INPUT, ORATYPE_NUMBER 
158
 
159
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ExportOsProductList.sql"), ORADYN_DEFAULT )
160
 
161
	returnString = returnString &_
162
	"%pkgmnt::G_NodePkgHash = ("& VBNewLine 
163
 
164
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
165
		If IsNull(rsQry("sunos_electronic_name")) Then
166
			PkgName = rsQry("pkg_name")
167
		Else
168
			PkgName = rsQry("sunos_electronic_name")			
169
		End If
170
 
171
		PkgVersion = rsQry("pkg_version")
172
		Ext = rsQry("v_ext")
173
		Description = rsQry("pv_description")
174
 
175
		If InStr(1, PkgName, "ERG") = 1 Or PkgName = "AceTao"  Then
176
			PkgFlag = "T"
177
			VersionFlag = "T"
178
		Else
179
			PkgFlag = "F"
180
			VersionFlag = "F"		
181
		End If
182
 
183
		' Format Description
184
		If NOT IsNull(Description) Then
185
			Description = Replace ( Description, VBNewLine, "" )
186
			Description = Replace ( Description, """", "" )
187
		End if
188
 
189
		' Format Extension
190
		If NOT IsNull(Ext) Then
191
			' Remove first dot from extension
192
			If InStr( 1, Ext, "." ) = 1 Then
193
				Ext = Right( Ext, Len(Ext) - 1 )
194
			End If
195
 
196
		End If
197
 
198
 
199
 
200
		returnString = returnString &_
201
			""& PkgName &" => {"& VBNewLine &_
202
            "          CheckVersionFlag  => '"& VersionFlag &"',"& VBNewLine &_
203
            "          ERGPkgFlag        => '"& PkgFlag &"',"& VBNewLine 
204
 
205
		returnString = returnString &_
206
            "          PkgDesc           => '"& Description &"', "& VBNewLine
207
 
208
		If IsNull(Ext) Then
209
			returnString = returnString &_
210
	            "          PkgProjAcronym    => '???',"&  VBNewLine &_ 
211
				"          PkgVersion        => '"& PkgVersion &"'"&  VBNewLine 
212
		Else
213
			returnString = returnString &_
214
            	"          PkgProjAcronym    => '"& Ext &"',"&  VBNewLine &_
215
				"          PkgVersion        => '"& Left(PkgVersion, Len(PkgVersion) - Len(Ext) - 1 ) &"'"&  VBNewLine
216
		End If
217
 
218
 
219
           returnString = returnString &_
220
		    "	},"& VBNewLine
221
 
222
 
223
 
224
		rsQry.MoveNext()
225
	WEnd
226
 
227
	OraDatabase.Parameters.Remove "OS_ID"
228
 
229
	rsQry.Close
230
	Set rsQry = Nothing
231
 
232
 
233
	' Format final output
234
	If NOT IsNull(returnString) Then
235
		returnString = Left ( returnString, InStrRev( returnString, "," ) - 1 ) & VBNewLine
236
	End If
237
 
238
	returnString = returnString &_
239
	");" & VBNewLine & VBNewLine & "1;" & VBNewLine 	
240
 
241
 
242
	' Return string 
243
	GenerateOsSpec = returnString
244
 
245
End Function
246
'--------------------------------------------------------------------------------------------------------------------------
247
%>
248
<%
249
'------------ RUN BEFORE PAGE RENDER ----------
250
 
251
 
252
'----------------------------------------------
253
%>
254
<html>
255
<head>
256
<title>Deployment Manager</title>
257
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
258
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
259
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
260
<script language="JavaScript" src="scripts/common.js"></script>
261
</head>
262
 
263
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.os_name.focus();">
264
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
265
  <tr>
266
    <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;Node Spec Export </span> <br>
267
    Click on the text to select.</td>
268
  </tr>
269
</table>
270
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
271
  <tr>
272
    <td width="1" background="images/bg_green.gif"><img src="images/spacer.gif" width="10" height="35"></td>
273
    <td width="100%" background="images/bg_green.gif" valign="bottom">
274
	<!-- TAB CONTROLS ++++++++++++++++++++++ -->
275
		<%
276
		'[1] Tab Name
277
		'[2] Tab Link
278
		'[3] JavaScript Event e.g. "onClick='...'"
279
		'[4] Tab Image Selected
280
		'[5] Tab Image Diselected
281
		'[6] Tab Image Disabled
282
		'[7] Tab Hint
283
		'[8] Force Disable. Values: Y, N(default)
284
 
285
 
286
		OraDatabase.Parameters.Add "NODE_ID", parNode_id, ORAPARM_INPUT, ORATYPE_NUMBER 
287
 
288
		Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("OsList.sql"), ORADYN_DEFAULT )
289
 
290
		OraDatabase.Parameters.Remove "NODE_ID"
291
 
292
 
293
		Set objTabControl = New TabControl
294
		objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleWinXP/tab_style.html") ) ' Supply tab style definition
295
		objTabControl.TabStyle = "StyleWinXP"
296
 
297
		If Request("ostab") <> "" Then
298
			OsTab = CDbl( Request("ostab") )
299
		Else
300
			OsTab = 0
301
		End If
302
 
303
 
304
		While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
305
 
306
			objTabControl.Add ( Array( rsQry("os_name"), SCRIPT_NAME &"?ostab="& rsQry("os_id") &"&"& objPMod.ComposeURL() , "", "", "", "", "", "" ) )
307
 
308
			If OsTab = 0 Then
309
				OsTab = CDbl( rsQry("os_id"))
310
				objTabControl.SelectByName rsQry("os_name")
311
 
312
			ElseIf OsTab = CDbl(rsQry("os_id")) Then
313
				OsTab = rsQry("os_id")
314
				objTabControl.SelectByName rsQry("os_name")
315
 
316
			End If
317
 
318
 
319
			rsQry.MoveNext()
320
		WEnd
321
 
322
		rsQry.Close()
323
		Set rsQry = nothing
324
 
325
 
326
		objTabControl.Render ()
327
		%>
328
		<!-- END OF TAB CONTROLS +++++++++++++++ -->
329
	</td>
330
    <td width="1" background="images/bg_green.gif"></td>
331
  </tr>
332
  <tr>
333
    <td>&nbsp;</td>
334
    <td><br><textarea name="textfield" cols="70" rows="20" wrap="OFF" class="body_cmd" onFocus="this.select()"><%=GenerateOsSpec( OsTab )%></textarea></td>
335
    <td>&nbsp;</td>
336
  </tr>
337
</table>
338
</body>
339
</html>
340
<%
341
'------------ RUN AFTER PAGE RENDER -----------
342
'----------------------------------------------
343
%><!--#include file="common/globals_destructor.asp"-->