Subversion Repositories DevTools

Rev

Rev 13 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13 Rev 15
Line 37... Line 37...
37
%>
37
%>
38
<%
38
<%
39
'--------------------------------------------------------------------------------------------------------------------------
39
'--------------------------------------------------------------------------------------------------------------------------
40
Function GenerateOsSpec ( nOsId )
40
Function GenerateOsSpec ( nOsId )
41
	Dim rsQry, query, returnString
41
	Dim rsQry, query, returnString
42
	Dim PkgName, PkgVersion, Ext, Description
42
	Dim PkgName, PkgVersion, Ext, Description, PkgHealthTag, CmdInterface, Owner, IsInterface, PkgFlag, VersionFlag
43
	
43
	
44
	OraDatabase.Parameters.Add "OS_ID", nOsId,	ORAPARM_INPUT, ORATYPE_NUMBER 
44
	OraDatabase.Parameters.Add "OS_ID", nOsId,	ORAPARM_INPUT, ORATYPE_NUMBER 
45
	
45
		
46
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ExportOsProductList.sql"), ORADYN_DEFAULT )
46
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("NodeSpecDetails.sql"), ORADYN_DEFAULT )		
47
	
47
	
48
	returnString = NULL
48
	returnString = NULL
49
	
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
	
50
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
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")
51
		PkgName = rsQry("pkg_name")
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
		
52
		PkgVersion = rsQry("pkg_version")
171
		PkgVersion = rsQry("pkg_version")
53
		Ext = rsQry("v_ext")
172
		Ext = rsQry("v_ext")
54
		Description = rsQry("pv_description")
173
		Description = rsQry("pv_description")
55
		
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
		
56
		' Format Description
183
		' Format Description
57
		If NOT IsNull(Description) Then
184
		If NOT IsNull(Description) Then
58
			Description = Replace ( Description, VBNewLine, "" )
185
			Description = Replace ( Description, VBNewLine, "" )
59
			Description = Replace ( Description, """", "" )
186
			Description = Replace ( Description, """", "" )
60
		End if
187
		End if
Line 66... Line 193...
66
				Ext = Right( Ext, Len(Ext) - 1 )
193
				Ext = Right( Ext, Len(Ext) - 1 )
67
			End If
194
			End If
68
			
195
			
69
		End If
196
		End If
70
		
197
		
71
		
198
 
72
		
199
		
73
		returnString = returnString &_
200
		returnString = returnString &_
74
			"'"& PkgName &"' => {"& VBNewLine &_
201
			""& PkgName &" => {"& VBNewLine &_
75
            "          ERGPkgFlag        => ""T"","& VBNewLine &_
202
            "          ERGPkgFlag        => '"& PkgFlag &"',"& VBNewLine &_
76
            "          CheckVersionFlag  => ""T"","& VBNewLine 
203
            "          CheckVersionFlag  => '"& VersionFlag &"',"& VBNewLine 
77
			
204
			
78
		If IsNull(Ext) Then
205
		If IsNull(Ext) Then
79
			returnString = returnString &_
206
			returnString = returnString &_
80
	            "          PkgVersion        => """& PkgVersion &""","&  VBNewLine 
207
	            "          PkgVersion        => '"& PkgVersion &"',"&  VBNewLine &_ 
-
 
208
				"          PkgProjAcronym    => '???',"&  VBNewLine 
81
		Else
209
		Else
82
			returnString = returnString &_
210
			returnString = returnString &_
83
            "          PkgVersion        => """& Left(PkgVersion, Len(PkgVersion) - Len(Ext) - 1 ) &""","&  VBNewLine &_
211
            	"          PkgVersion        => '"& Left(PkgVersion, Len(PkgVersion) - Len(Ext) - 1 ) &"',"&  VBNewLine &_
84
            "          PkgProjAcronym    => """& Ext &""","&  VBNewLine 
212
            	"          PkgProjAcronym    => '"& Ext &"',"&  VBNewLine 
85
		End If
213
		End If
86
		
214
		
87
		returnString = returnString &_
215
		returnString = returnString &_
88
            "          PkgDesc           => """& Description &""" "& VBNewLine &_
216
            "          PkgDesc           => '"& Description &"' "& VBNewLine &_
89
            "      },"& VBNewLine
217
            "	},"& VBNewLine
90
		
218
		
91
		
219
		
92
		
220
		
93
		rsQry.MoveNext()
221
		rsQry.MoveNext()
94
	WEnd
222
	WEnd
Line 99... Line 227...
99
	Set rsQry = Nothing
227
	Set rsQry = Nothing
100
	
228
	
101
	
229
	
102
	' Format final output
230
	' Format final output
103
	If NOT IsNull(returnString) Then
231
	If NOT IsNull(returnString) Then
104
		returnString = Left ( returnString, InStrRev( returnString, "," ) - 1 )
232
		returnString = Left ( returnString, InStrRev( returnString, "," ) - 1 ) & VBNewLine
105
	End If
233
	End If
106
	
234
	
-
 
235
	returnString = returnString &_
-
 
236
	");" & VBNewLine & VBNewLine & "1;" & VBNewLine 	
-
 
237
	
107
	
238
	
108
	' Return string 
239
	' Return string 
109
	GenerateOsSpec = returnString
240
	GenerateOsSpec = returnString
110
	
241
	
111
End Function
242
End Function