Subversion Repositories DevTools

Rev

Rev 119 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
Option Explicit
2
'=====================================================
3
'        Name: style_a_generator.vbs
4
' Description: Creates a release notes in TEMPLATE A format.
5
'=====================================================
6
 
7
Sub Generate_Notes_Style_A ( NNpv_id, outNotes, SSrtag_name, NNproj_id )
8
	Dim snippetSTR, insertFrom, insterSTR, tempSTR, snippetDEVI, snippetTDSE, snippetJIRA
9
	Dim Query_String, rsQry, CQSQL, rsCQ, rsJIRA, JIRASQL, releaseInfo, newReleaseInfo
10
	Const SYD_PROJID = 142'This is a temp for the BETA release of the functionality
11
	'-----------------------------------------------------------
12
	Set rsCQ = CreateObject("ADODB.Recordset")
13
	Set rsJIRA = CreateObject("ADODB.Recordset")
14
	'-----------------------------------------------------------
15
	WScript.Echo "Generating notes using Template Style A."
16
 
17
	outNotes = ReadFile( AppPath & RELEASE_NOTES_TEMPLATE_A )
18
 
19
 
20
	' --- Title ---
21
	Query_String = ReadFile( AppPath & QUERIES_FOLDER & "\package_official_details.sql" )
22
	OraDatabase.Parameters.Add "PV_ID", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
23
	Set rsQry = OraDatabase.CreateDynaset( Query_String, cint(0))
24
 
25
	Call Get_Snippet ( "Title", outNotes, snippetSTR, insertFrom )
26
	If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
27
		insterSTR = Replace( snippetSTR, "$PKG_TITLE$", rsQry("pkg_name") &" "& rsQry("pkg_version"))
28
	End If
29
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
30
 
31
 
32
	'--- DEVI-037294 Requirement: Insert <ReleaseName>: <PkgName> <PkgVersion> --------------
33
	newReleaseInfo = SSrtag_name + ": " + rsQry("pkg_name") + " " + rsQry("pkg_version")
34
 
35
 
36
	' --- Identification ---
37
	Call Get_Snippet ( "Identification", outNotes, snippetSTR, insertFrom )
38
	If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
39
		insterSTR = Replace( snippetSTR, "$PKG_NAME$", rsQry("pkg_name") )
40
		insterSTR = Replace( insterSTR, "$PKG_VERSION$", rsQry("pkg_version") )
41
		insterSTR = Replace( insterSTR, "$LABEL$", NVL( rsQry("pkg_label") ) )
42
		insterSTR = Replace( insterSTR, "$SOURCE_PATH$", NVL( rsQry("src_path") ) )
43
		insterSTR = Replace( insterSTR, "$RELEASE_DATE$", ( EuroDate ( rsQry("modified_stamp") ) ) )
44
		insterSTR = Replace( insterSTR, "$RELEASOR_EMAIL$", rsQry("modifier_email") )
45
		insterSTR = Replace( insterSTR, "$RELEASOR$", rsQry("modifier") )
46
		insterSTR = Replace( insterSTR, "$OWNER_EMAIL$", rsQry("owner_email") )
47
		insterSTR = Replace( insterSTR, "$OWNER$", rsQry("owner") )
48
	End If
49
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
50
 
51
 
52
 
53
 
54
	' --- Package Information ---
55
	Call Get_Snippet ( "Package_Information", outNotes, snippetSTR, insertFrom )
56
	If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
57
		If IsNull(rsQry("short_desc")) Then
58
			insterSTR = Replace( snippetSTR, "$SHORT_DESCRIPTION$", "Not supplied!" )
59
		Else
60
			insterSTR = Replace( snippetSTR, "$SHORT_DESCRIPTION$", FormatTextBox( HTML_Encode ( rsQry("short_desc") ) ) )
61
		End If
62
 
63
		If IsNull(rsQry("long_desc")) Then
64
			insterSTR = Replace( insterSTR, "$LONG_DESCRIPTION$", "Not supplied!" )
65
		Else
66
			insterSTR = Replace( insterSTR, "$LONG_DESCRIPTION$", FormatTextBox( HTML_Encode ( rsQry("long_desc") ) ) )
67
		End If
68
 
69
	End If
70
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
71
 
72
 
73
 
74
 
75
	' --- Reason for This Version ---
76
	Call Get_Snippet ( "Reason_For_This_Version", outNotes, snippetSTR, insertFrom )
77
	If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
78
		If rsQry("reason") <> "" Then
79
			insterSTR = Replace( snippetSTR, "$REASON$", FormatTextBox( HTML_Encode ( rsQry("reason") ) ) )
80
		Else
81
			insterSTR = Replace( snippetSTR, "$REASON$", "See ""Issues"" section below." )
82
		End If
83
	End If
84
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
85
 
86
 
87
 
88
 
89
	' --- Build Dependencies ---
90
	Query_String = ReadFile( AppPath & QUERIES_FOLDER & "\package_build_dependencies.sql" )
91
	Set rsQry = OraDatabase.CreateDynaset( Query_String, cint(0))
92
	Call Get_Snippet ( "Build_Dependencies", outNotes, snippetSTR, insertFrom )
93
	If rsQry.RecordCount < 1 Then
94
		tempSTR = Replace( snippetSTR, "$PKG_NAME$", "&nbsp;" )
95
		tempSTR = Replace( tempSTR, "$RELEASE_NOTE_PATH$", "&nbsp;" )
96
		insterSTR = insterSTR & Replace( tempSTR, "$PKG_VERSION$", "&nbsp;" )
97
	End If
98
	While ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) 
99
		tempSTR = Replace( snippetSTR, "$PKG_NAME$", rsQry("pkg_name") )
100
		tempSTR = Replace( tempSTR, "$RELEASE_NOTE_PATH$", rsQry("pkg_name") &"/"& rsQry("pkg_version") &"/"& DOC_FOLDER &"/"& Format_FileName( rsQry("pkg_name"), rsQry("pkg_version"), rsQry("dpv_id") ) )
101
		insterSTR = insterSTR & Replace( tempSTR, "$PKG_VERSION$", rsQry("pkg_version") )
102
		rsQry.MoveNext
103
	WEnd
104
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
105
 
106
 
107
 
108
 
109
	' --- Runtime Dependencies ---
110
	Query_String = ReadFile( AppPath & QUERIES_FOLDER & "\package_runtime_dependencies.sql" )
111
	Set rsQry = OraDatabase.CreateDynaset( Query_String, cint(0))
112
	Call Get_Snippet ( "Runtime_Dependencies", outNotes, snippetSTR, insertFrom )
113
	If rsQry.RecordCount < 1 Then
114
		tempSTR = Replace( snippetSTR, "$PKG_NAME$", "&nbsp;" )
115
		tempSTR = Replace( tempSTR, "$PKG_VERSION$", "&nbsp;" )
116
		insterSTR = insterSTR & Replace( tempSTR, "$COMMENTS$", "&nbsp;")
117
	End If
118
	While ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) 
119
		tempSTR = Replace( snippetSTR, "$PKG_NAME$", rsQry("pkg_name") )
120
		tempSTR = Replace( tempSTR, "$PKG_VERSION$", rsQry("pkg_version") )
121
		insterSTR = insterSTR & Replace( tempSTR, "$COMMENTS$", NVL( FormatTextBox ( HTML_Encode ( rsQry("rtd_comments") ) &"<br>"& HTML_Encode ( rsQry("rtd_url") ) ) ) )
122
		rsQry.MoveNext
123
	WEnd
124
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
125
 
126
 
127
 
128
 
129
	' --- Files ---
130
	Query_String = ReadFile( AppPath & QUERIES_FOLDER & "\package_components.sql" )
131
	Set rsQry = OraDatabase.CreateDynaset( Query_String, cint(0))
132
	Call Get_Snippet ( "Files", outNotes, snippetSTR, insertFrom )
133
	If rsQry.RecordCount < 1 Then
134
		tempSTR = Replace( snippetSTR, "$FILE_NAME$", "&nbsp;" )
135
		tempSTR = Replace( tempSTR, "$FILE_PATH$", "&nbsp;" )
136
		tempSTR = Replace( tempSTR, "$BYTE_SIZE$", "&nbsp;" )
137
		tempSTR = Replace( tempSTR, "$CRC_CKSUM$", "&nbsp;" )
138
		insterSTR = insterSTR & Replace( tempSTR, "$CRC_MODCRC$", "&nbsp;" )
139
	End If
140
	While ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) 
141
		tempSTR = Replace( snippetSTR, "$FILE_NAME$", NVL( rsQry("file_name") ) )
142
		tempSTR = Replace( tempSTR, "$FILE_PATH$", NVL( rsQry("file_path") ) )
143
		tempSTR = Replace( tempSTR, "$BYTE_SIZE$", NVL( rsQry("byte_size") ) )
144
		tempSTR = Replace( tempSTR, "$CRC_CKSUM$", NVL( rsQry("crc_cksum") ) )
145
		insterSTR = insterSTR & Replace( tempSTR, "$CRC_MODCRC$", NVL( rsQry("crc_modcrc") ) )
146
		rsQry.MoveNext
147
	WEnd
148
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
149
 
150
 
151
	' --- JIRA Issues ---
152
	Call Get_JIRA_Package_Issues ( JIRASQL )
153
	Call Get_JIRA_Issues ( JIRASQL, rsJIRA )
154
	Call Get_Snippet ( "Issues:List:JIRA", outNotes, snippetJIRA, insertFrom )
155
 
156
	Call Get_Snippet ( "JIRA_Issues:List", outNotes, snippetSTR, insertFrom )
157
 
158
	While ((NOT rsJIRA.BOF) AND (NOT rsJIRA.EOF)) 
159
 
160
			tempSTR = Replace( snippetJIRA, "$ISSUE_DATABASE$", "JIRA" )
161
 
162
			tempSTR = Replace( tempSTR, "$ISSUE_NUMBER$",           rsJIRA("iss_num") )
163
			tempSTR = Replace( tempSTR, "$SUMMARY$",                NVL( HTML_Encode ( rsJIRA("summary") ) ) )
164
 
165
 
166
			tempSTR = Replace( tempSTR, "$ISSUE_TYPE$",             NVL( rsJIRA("issuetype") ) ) 
167
			insterSTR = insterSTR & Replace( tempSTR, "$PRIORITY$", NVL( rsJIRA("priority") ) )
168
 
169
		rsJIRA.MoveNext
170
	Wend	
171
	rsJIRA.Close()
172
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
173
 
174
 
175
	' --- Issues ---
176
	' Fixed:
177
	Call Get_ORA_Package_Issues ( "Fixed_Issues", CQSQL )
178
	Call Get_CQ_Issues ( CQSQL, rsCQ )
179
	Call Get_Snippet ( "Issues:List:DEVI", outNotes, snippetDEVI, insertFrom )
180
	Call Get_Snippet ( "Issues:List:TDSE", outNotes, snippetTDSE, insertFrom )
181
	Call Get_Snippet ( "Fixed_Issues:List", outNotes, snippetSTR, insertFrom )
182
	While ((NOT rsCQ.BOF) AND (NOT rsCQ.EOF)) 
183
		'If CInt(NNproj_id) = CInt(SYD_PROJID) Then
184
			'Extract Release Info If Exists
185
		releaseInfo = rsCQ("releaseinfo")
186
		Call EditReleaseInfoDetails ( rsCQ("iss_db"), rsCQ("iss_id"), newReleaseInfo, releaseInfo )
187
		'End If
188
	    ' Add Row
189
		If rsCQ("iss_db") = enumCLEARQUEST_DEVI_ID Then
190
			tempSTR = Replace( snippetDEVI, "$ISSUE_DATABASE$", "DEVI" )
191
		ElseIf rsCQ("iss_db") = enumCLEARQUEST_TDSE_ID Then
192
			tempSTR = Replace( snippetTDSE, "$ISSUE_DATABASE$", "TDSE" )
193
		End If
194
		tempSTR = Replace( tempSTR, "$TAG_ID$",                 rsCQ("iss_db") &"_"& rsCQ("iss_id") )
195
        tempSTR = Replace( tempSTR, "$BOX_WIDTH$",              String(20, "_") ) 
196
        tempSTR = Replace( tempSTR, "$ISSUE_NUMBER$",           rsCQ("iss_num") )
197
        tempSTR = Replace( tempSTR, "$SUMMARY$",                NVL( HTML_Encode ( rsCQ("summary") ) ) )
198
        ' --- CQ Issues body ---
199
        tempSTR = Replace( tempSTR, "$CQ_ISSUE_TYPE$",          NVL( rsCQ("issue_type") ) )
200
        tempSTR = Replace( tempSTR, "$CQ_SUBMITTER$",           NVL( rsCQ("submitter") ) )
201
        tempSTR = Replace( tempSTR, "$CQ_DETECTED_IN_VERSION$", NVL( rsCQ("release_part1") &"."& rsCQ("release_part2") &"."& rsCQ("release_part3") ) )
202
        tempSTR = Replace( tempSTR, "$CQ_SUBMIT_DATE$",         NVL( EuroDate ( rsCQ("submit_date") ) ) )
203
        tempSTR = Replace( tempSTR, "$CQ_PROJECT$",             NVL( rsCQ("project") ) )
204
        tempSTR = Replace( tempSTR, "$CQ_OWNER$",               NVL( rsCQ("owner") ) )
205
        tempSTR = Replace( tempSTR, "$CQ_PRODUCT$",             NVL( rsCQ("product") ) )
206
        tempSTR = Replace( tempSTR, "$CQ_APPROVER$",            NVL( rsCQ("approver") ) )
207
        tempSTR = Replace( tempSTR, "$CQ_PACKAGE$",             NVL( rsCQ("package_ref") ) )
208
        tempSTR = Replace( tempSTR, "$CQ_PRIORITY$",            NVL( rsCQ("priority") ) )
209
        tempSTR = Replace( tempSTR, "$CQ_STATUS$",              NVL( rsCQ("status") ) )
210
        tempSTR = Replace( tempSTR, "$CQ_DESCRIPTION$",         FormatTextBox ( NVL( HTML_Encode( rsCQ("description") ) ) ) )
211
        tempSTR = Replace( tempSTR, "$CQ_NOTES_LOG$",           FormatTextBox ( NVL( HTML_Encode( rsCQ("notes_log") ) ) ) )
212
        tempSTR = Replace( tempSTR, "$CQ_RELEASE_ID$",          NVL( rsCQ("release_id") ) )
213
        tempSTR = Replace( tempSTR, "$CQ_CLIENT_REFERENCE$",    NVL( rsCQ("client_ref") ) )
214
        tempSTR = Replace( tempSTR, "$CQ_SEVERITY$",            NVL( rsCQ("severity") ) )
215
        tempSTR = Replace( tempSTR, "$CQ_CHANGE_REQUEST$",      Format_CQ_CHANGE_REQUEST ( rsCQ("cr_internal"), rsCQ("cr_external") ) )
216
        '-----------------------
217
        tempSTR = Replace( tempSTR, "$ISSUE_TYPE$",             NVL( rsCQ("issue_type") ) ) 
218
		insterSTR = insterSTR & Replace( tempSTR, "$PRIORITY$", NVL( rsCQ("priority") ) )
219
 
220
		rsCQ.MoveNext
221
	WEnd
222
	rsCQ.Close()
223
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
224
 
225
	' Outstanding:
226
	Call Get_ORA_Package_Issues ( "Outstanding_Issues", CQSQL )
227
	Call Get_CQ_Issues ( CQSQL, rsCQ )
228
	Call Get_Snippet ( "Outstanding_Issues:List", outNotes, snippetSTR, insertFrom )
229
	While ((NOT rsCQ.BOF) AND (NOT rsCQ.EOF)) 
230
	    ' Add Row
231
		If rsCQ("iss_db") = enumCLEARQUEST_DEVI_ID Then
232
			tempSTR = Replace( snippetDEVI, "$ISSUE_DATABASE$", "DEVI" )
233
		ElseIf rsCQ("iss_db") = enumCLEARQUEST_TDSE_ID Then
234
			tempSTR = Replace( snippetTDSE, "$ISSUE_DATABASE$", "TDSE" )
235
		End If
236
		tempSTR = Replace( tempSTR, "$TAG_ID$",                 rsCQ("iss_db") &"_"& rsCQ("iss_id") )
237
        tempSTR = Replace( tempSTR, "$BOX_WIDTH$",              String(20, "_") ) 
238
        tempSTR = Replace( tempSTR, "$ISSUE_NUMBER$",           rsCQ("iss_num") )
239
        tempSTR = Replace( tempSTR, "$SUMMARY$",                NVL( HTML_Encode ( rsCQ("summary") ) ) )
240
        ' --- CQ Issues body ---
241
        tempSTR = Replace( tempSTR, "$CQ_ISSUE_TYPE$",          NVL( rsCQ("issue_type") ) )
242
        tempSTR = Replace( tempSTR, "$CQ_SUBMITTER$",           NVL( rsCQ("submitter") ) )
243
        tempSTR = Replace( tempSTR, "$CQ_DETECTED_IN_VERSION$", NVL( rsCQ("release_part1") &"."& rsCQ("release_part2") &"."& rsCQ("release_part3") ) )
244
        tempSTR = Replace( tempSTR, "$CQ_SUBMIT_DATE$",         NVL( EuroDate( rsCQ("submit_date") ) ) )
245
        tempSTR = Replace( tempSTR, "$CQ_PROJECT$",             NVL( rsCQ("project") ) )
246
        tempSTR = Replace( tempSTR, "$CQ_OWNER$",               NVL( rsCQ("owner") ) )
247
        tempSTR = Replace( tempSTR, "$CQ_PRODUCT$",             NVL( rsCQ("product") ) )
248
        tempSTR = Replace( tempSTR, "$CQ_APPROVER$",            NVL( rsCQ("approver") ) )
249
        tempSTR = Replace( tempSTR, "$CQ_PACKAGE$",             NVL( rsCQ("package_ref") ) )
250
        tempSTR = Replace( tempSTR, "$CQ_PRIORITY$",            NVL( rsCQ("priority") ) )
251
        tempSTR = Replace( tempSTR, "$CQ_STATUS$",              NVL( rsCQ("status") ) )
252
        tempSTR = Replace( tempSTR, "$CQ_DESCRIPTION$",         FormatTextBox ( NVL( HTML_Encode( rsCQ("description") ) ) ) )
253
        tempSTR = Replace( tempSTR, "$CQ_NOTES_LOG$",           FormatTextBox ( NVL( HTML_Encode( rsCQ("notes_log") ) ) ) )
254
        tempSTR = Replace( tempSTR, "$CQ_RELEASE_ID$",          NVL( rsCQ("release_id") ) )
255
        tempSTR = Replace( tempSTR, "$CQ_CLIENT_REFERENCE$",    NVL( rsCQ("client_ref") ) )
256
        tempSTR = Replace( tempSTR, "$CQ_SEVERITY$",            NVL( rsCQ("severity") ) )
257
        tempSTR = Replace( tempSTR, "$CQ_CHANGE_REQUEST$",      Format_CQ_CHANGE_REQUEST ( rsCQ("cr_internal"), rsCQ("cr_external") ) )
258
        '-----------------------
259
        tempSTR = Replace( tempSTR, "$ISSUE_TYPE$",             NVL( rsCQ("issue_type") ) )
260
		insterSTR = insterSTR & Replace( tempSTR, "$PRIORITY$", NVL( rsCQ("priority") ) )
261
 
262
		rsCQ.MoveNext
263
	WEnd
264
	rsCQ.Close()
265
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
266
 
267
 
268
 
269
 
270
	' --- Unit Tests ---
271
	Query_String = ReadFile( AppPath & QUERIES_FOLDER & "\unit_tests.sql" )
272
	Set rsQry = OraDatabase.CreateDynaset( Query_String, cint(0))
273
	Call Get_Snippet ( "Unit_Tests", outNotes, snippetSTR, insertFrom )
274
	If rsQry.RecordCount < 1 Then
275
		tempSTR = Replace( snippetSTR, "$TEST_NAME$", "&nbsp;" )
276
		tempSTR = Replace( tempSTR, "$TEST_SUMMARY$", "&nbsp;" )
277
		tempSTR = Replace( tempSTR, "$TEST_PASSED$", "&nbsp;" )
278
		insterSTR = insterSTR & Replace( tempSTR, "$TEST_COMPLETED$", "&nbsp;" )
279
	End If
280
	While ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) 
281
		tempSTR = Replace( snippetSTR, "$TEST_NAME$", rsQry("test_type_name") )
282
		tempSTR = Replace( tempSTR, "$TEST_SUMMARY$", NVL( FormatTextBox ( HTML_Encode ( rsQry("test_summary") ) ) ) )
283
		tempSTR = Replace( tempSTR, "$TEST_PASSED$", NVL( FormatTextBox ( HTML_Encode ( rsQry("numof_test") ) ) ) )
284
		If NOT IsNull( rsQry("tester") ) Then
285
			tempSTR = Replace( tempSTR, "$TEST_COMPLETED$", EuroDate ( rsQry("completion_date") ) &" by "& rsQry("tester") )
286
		Else
287
			tempSTR = Replace( tempSTR, "$TEST_COMPLETED$", "&nbsp;")
288
		End If
289
		insterSTR = insterSTR & tempSTR
290
		rsQry.MoveNext
291
	WEnd
292
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
293
 
294
 
295
 
296
 
297
	' --- Additional_Notes ---
298
	Query_String = ReadFile( AppPath & QUERIES_FOLDER & "\additional_notes.sql" )
299
	Set rsQry = OraDatabase.CreateDynaset( Query_String, cint(0))
300
	Call Get_Snippet ( "Additional_Notes:Blank", outNotes, tempSTR, insertFrom )
301
	Call Get_Snippet ( "Additional_Notes", outNotes, snippetSTR, insertFrom )
302
	If rsQry.RecordCount < 1 Then
303
		insterSTR = tempSTR
304
	End If
305
	While ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) 
306
		tempSTR = Replace( snippetSTR, "$NOTE_TITLE$", rsQry("note_title") )
307
		tempSTR = Replace( tempSTR, "$NOTE_BODY$", NVL( FormatTextBox ( HTML_Encode ( rsQry("note_body") ) ) ) )
308
		tempSTR = Replace( tempSTR, "$MOD_DATE$", EuroDate ( rsQry("mod_date") ) )
309
		insterSTR = insterSTR & Replace( tempSTR, "$MOD_USER$", NVL( rsQry("full_name") ) )
310
		rsQry.MoveNext
311
	WEnd
312
	Call Insert_To_Page ( outNotes, insertFrom, insterSTR )
313
 
314
 
315
 
316
 
317
	rsQry.Close()
318
	Set rsQry = Nothing
319
	OraDatabase.Parameters.Remove "PV_ID"
320
End Sub