forked from zscgeek/W3C-Tracker-to-DoC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathW3C_Tracker_XML_DoC.groovy
330 lines (283 loc) · 9.65 KB
/
W3C_Tracker_XML_DoC.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
import groovyx.net.http.HTTPBuilder
import static groovyx.net.http.Method.HEAD
import static groovyx.net.http.ContentType.TEXT
DOC_DATE="31 January 2012"
PRODUCT="13"
SPEC="EmotionML 1.0"
SPEC_LONG="Emotion Markup Language (EmotionML) 1.0"
SPEC_URL="http://www.w3.org/TR/2011/WD-emotionml-20110407/"
SPEC_MATURITY="Last Call Working Draft"
PERIOD_START="7 April 2011"
PERIOD_END="7 June 2011"
EDITOR="Marc Schroeder, DFKI GmbH"
WORKING_GROUP="Multimodal Interaction"
ACTIVITY_URL="http://www.w3.org/2002/mmi/"
PUBLIC_MAILING_LIST="[email protected]"
PUBLIC_ARCHIVE_URL="http://lists.w3.org/Archives/Public/www-multimodal/"
def checkPublic(url){
// return true
// create a new builder
def http = new HTTPBuilder( url )
http.request( HEAD, TEXT ) {req ->
response.success = { resp ->
def loc = resp.getFirstHeader('Location')
if (loc != null && loc != "") {
if (loc.toString().indexOf("Archives/Member") == -1)
{
return true
} else {
return false
}
} else {
return true
}
}
response.failure = { resp ->
return false
}
}
}
def today= new Date() //represents the date and time when it is created
def ir = new XmlSlurper().parse(args[0])
def allIssues = ir.issues.issue
def specIssues = ir.issues.issue.findAll{it.product.text()==PRODUCT}
def publicIssues = ir.issues.issue.findAll{it.product.text()==PRODUCT && it.title.text().contains('PUBLIC')}
def lcwdIssues = ir.issues.issue.findAll{it.product.text()==PRODUCT && it.title.text().contains('LCWD')}
def pubOrlcwdIssues = ir.issues.issue.findAll {
it.product.text()==PRODUCT &&
(it.title.text().contains('LCWD') || it.title.text().contains('PUBLIC'))
}
// def issueSet = pubOrlcwdIssues
def issueSet = specIssues
StringWriter writer = new java.io.StringWriter()
def build = new groovy.xml.MarkupBuilder(writer)
build.getMkp().pi("xml":[version:"1.0", encoding:"utf-8"])
build.html {
head {
meta('http-equiv':"content-type", content:"text/html; charset=UTF-8")
title SPEC + ": " + SPEC_MATURITY + " Disposition of Comments"
link( rel:"stylesheet", type:"text/css",href:"http://www.w3.org/StyleSheets/general.css")
style(type:"text/css", '''
.indent {
margin: 30px;
}
.indentpre {
margin: 30px;
background-color: AliceBlue
}
.NA {
}
.ACCEPTED {
background-color: Aquamarine
}
.REJECTED {
background-color: Yellow
}
.DEFERRED {
background-color: Gainsboro
}
''')
}
body(bgcolor: '#ffffff') {
div class:"head", {
p {
a href:"http://www.w3.org" {
img width:"72", height:"48", alt:"W3C", src:"http://www.w3.org/Icons/w3c_home"
}
a href:"",""
}
h1 id:"title", SPEC + ': ' + SPEC_MATURITY + ' Disposition of Comments'
h2 DOC_DATE
dl {
dt "Editor"
dd EDITOR
}
p class:"copyright", {
a href:"http://www.w3.org/Consortium/Legal/ipr-notice#Copyright", "Copyright"
mkp.yield ' © 2012'
a href:"http://www.w3.org/", {
abbr title:"World Wide Web Consortium", "W3C"
}
sup '®'
mkp.yield ' ('
a href:"http://www.csail.mit.edu/", {
abbr title:"Massachusetts Institute of Technology", "MIT"
}
mkp.yield ','
a href:"http://www.ercim.org/", {
acronym title:"European Research Consortium for Informatics and Mathematics", 'ERCIM'
}
mkp.yield ','
a href:"http://www.keio.ac.jp/", 'Keio'
mkp.yield '), All Rights Reserved. W3C'
a href:"http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer", "liability"
mkp.yield ','
a href:"http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks", "trademark"
mkp.yield ','
a href:"http://www.w3.org/Consortium/Legal/copyright-documents-19990405", "document use"
mkp.yield ' rules apply.'
}
hr {}
}
h2 "Abstract"
p {
mkp.yield 'This document details the responses made by the '
mkp.yield WORKING_GROUP
mkp.yield ' Working Group to issues raised during the '
a href:"http://www.w3.org/2004/02/Process-20040205/tr.html#cfi","Last Call Working Draft"
mkp.yield ' period (beginning ' + PERIOD_START +' and ending ' + PERIOD_END + '). Comments were provided by other W3C Working Groups and the public via the'
a href:"mailto:"+PUBLIC_MAILING_LIST,PUBLIC_MAILING_LIST
mkp.yield " ("
a href:PUBLIC_ARCHIVE_URL, "archive"
mkp.yield " ) mailing list."
}
h2 "Status"
p {
mkp.yield 'This document of the W3C\'s ' + WORKING_GROUP + ' Working Group describes the disposition '
mkp.yield 'of comments as of ' + DOC_DATE + ' on the ' + SPEC_MATURITY + ' of the '
a href:SPEC_URL, SPEC_LONG
mkp.yield '. It may be updated, replaced or rendered obsolete by other W3C documents at any time.'
}
p {
mkp.yield 'For background on this work, please see the '
a href:ACTIVITY_URL, WORKING_GROUP + " Activity Statement."
}
h2 "Comment summary"
p "Legend:"
table border:"1", {
tr {
td 'class':"ACCEPTED", "ACCEPTED"
td 'class':"ACCEPTED", "Comment was accepted"
}
tr {
td 'class':"REJECTED", "REJECTED"
td 'class':"REJECTED", "Comment was rejected by working group."
}
tr {
td 'class':"DEFERRED", "DEFERRED"
td 'class':"DEFERRED", "Comment was deferred to a future version of the spec."
}
}
p "Results:"
table border:"1", {
tr {
th "ID"
th "Title"
th "Date Opened"
th "Last Updated"
th "Disposition"
th "Acceptance"
th "Related Issues"
}
for ( issue in issueSet ) {
tr {
//
// Link to issue detail
//
td {
a 'href':"#ISSUE-${issue.id}", "ISSUE-${issue.id}"
}
//
// Issue title
//
td "${issue.title}"
//
// Issue creation date
//
td "${issue.created}"
//
// Get the date of the last email
//
def lastUpdate = "N/A"
def hov = ""
for ( email in issue.emails.email ) {
if (
email.subject.toString().toLowerCase().indexOf("disposition of comments") == -1 &&
email.subject.toString().indexOf("DoC") == -1
) {
lastUpdate = "${new java.util.Date(Long.parseLong(email.timestamp.toString()) * 1000).format('yyyy-MM-dd')}"
hov = "${email.subject}"
break
}
}
td 'title':"${hov}", "${lastUpdate}"
//
// Get the disposition and acceptance type of the comment
//
def c = issue.notes.note.size()
def result = "NA"
def acceptance = "NA"
def related = "NONE"
for (note in issue.notes.note) {
if (note.description.toString().startsWith("RESULT=") ) {
result = "${note.description.toString().substring(7)}"
}
if (note.description.toString().startsWith("ACCEPTANCE=") ) {
acceptance = "${note.description.toString().substring(11)}"
}
if (note.description.toString().startsWith("RELATED=") ) {
related = "${note.description.toString().substring(8)}"
}
}
td 'class':"${result}", "${result}"
td 'class':"${acceptance}", "${acceptance}"
td "${related}"
}
}
}
//
// Dump local info about each issue.
//
h2 "Issue detail"
for ( issue in issueSet ) {
hr {}
h3 'id':"ISSUE-${issue.id}", "ISSUE-${issue.id} - ${issue.title}"
h4 "Tracker (W3C Member only):"
a class:'indent','href':"http://www.w3.org/Voice/Group/track/issues/${issue.id}?changelog", "ISSUE-${issue.id}"
h4 "Opened: ${issue.created}"
def lastUpdate = "N/A"
for ( note in issue.notes.note ) {
lastUpdate = "${new java.util.Date(Long.parseLong(note.timestamp.toString()) * 1000).format('yyyy-MM-dd hh:mm')}"
}
h4 "Last Updated: ${lastUpdate}"
h4 "State: ${issue.state}"
h4 "Description:"
pre 'class':'indentpre', "${issue.description}"
h4 "Notes:"
for ( note in issue.notes.note ) {
ul {
li {
b "${new java.util.Date(Long.parseLong(note.timestamp.toString()) * 1000).format('yyyy-MM-dd hh:mm')}: "
pre "${note.description}"
}
}
}
h4 "Related e-mails:"
// emails are in reverse order (sigh)
// this will reverse them.
def stack = new ArrayList()
for ( email in issue.emails.email ) {
stack.add(0, email)
}
ul {
for ( email in stack ) {
if (
email.subject.toString().toLowerCase().indexOf("disposition of comments") == -1 &&
email.subject.toString().indexOf("DoC") == -1
)
{
li {
b "${new java.util.Date(Long.parseLong(email.timestamp.toString()) * 1000).format('yyyy-MM-dd hh:mm')}: "
if (checkPublic(email.link)) {
a 'href':"${email.link}", "${email.subject}"
} else {
a 'href':"${email.link}", "${email.subject} - [members only]"
}
}
}
}
}
}
}
}
print writer;