Skip to content

Commit fbbb9ed

Browse files
committed
Added the feature and updatesite projects (issue #31).
1 parent 7aa8417 commit fbbb9ed

File tree

10 files changed

+896
-0
lines changed

10 files changed

+896
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>checker.framework.cascade.updatesite</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.pde.UpdateSiteBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.pde.UpdateSiteNature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<html>
2+
<head>
3+
<title>checker.framework.cascade.updatesite</title>
4+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5+
<style>@import url("web/site.css");</style>
6+
<script type="text/javascript">
7+
var returnval = 0;
8+
var stylesheet, xmlFile, cache, doc;
9+
function init(){
10+
// NSCP 7.1+ / Mozilla 1.4.1+ / Safari
11+
// Use the standard DOM Level 2 technique, if it is supported
12+
if (document.implementation && document.implementation.createDocument) {
13+
xmlFile = document.implementation.createDocument("", "", null);
14+
stylesheet = document.implementation.createDocument("", "", null);
15+
if (xmlFile.load){
16+
xmlFile.load("site.xml");
17+
stylesheet.load("web/site.xsl");
18+
} else {
19+
alert("Document could not be loaded by browser.");
20+
}
21+
xmlFile.addEventListener("load", transform, false);
22+
stylesheet.addEventListener("load", transform, false);
23+
}
24+
//IE 6.0+ solution
25+
else if (window.ActiveXObject) {
26+
xmlFile = new ActiveXObject("msxml2.DOMDocument.3.0");
27+
xmlFile.async = false;
28+
xmlFile.load("site.xml");
29+
stylesheet = new ActiveXObject("msxml2.FreeThreadedDOMDocument.3.0");
30+
stylesheet.async = false;
31+
stylesheet.load("web/site.xsl");
32+
cache = new ActiveXObject("msxml2.XSLTemplate.3.0");
33+
cache.stylesheet = stylesheet;
34+
transformData();
35+
}
36+
}
37+
// separate transformation function for IE 6.0+
38+
function transformData(){
39+
var processor = cache.createProcessor();
40+
processor.input = xmlFile;
41+
processor.transform();
42+
data.innerHTML = processor.output;
43+
}
44+
// separate transformation function for NSCP 7.1+ and Mozilla 1.4.1+
45+
function transform(){
46+
returnval+=1;
47+
if (returnval==2){
48+
var processor = new XSLTProcessor();
49+
processor.importStylesheet(stylesheet);
50+
doc = processor.transformToDocument(xmlFile);
51+
document.getElementById("data").innerHTML = doc.documentElement.innerHTML;
52+
}
53+
}
54+
</script>
55+
</head>
56+
<body onload="init();">
57+
<!--[insert static HTML here]-->
58+
<div id="data"><!-- this is where the transformed data goes --></div>
59+
</body>
60+
</html>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<site>
3+
<feature url="features/checker.framework.cascade_1.0.0.qualifier.jar" id="checker.framework.cascade" version="1.0.0.qualifier">
4+
<category name="Cascade"/>
5+
</feature>
6+
<category-def name="Cascade" label="Cascade"/>
7+
</site>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<STYLE type="text/css">
2+
td.spacer {padding-bottom: 10px; padding-top: 10px;}
3+
.title { font-family: sans-serif; color: #99AACC;}
4+
.bodyText { font-family: sans-serif; font-size: 9pt; color:#000000; }
5+
.sub-header { font-family: sans-serif; font-style: normal; font-weight: bold; font-size: 9pt; color: white;}
6+
.log-text {font-family: sans-serif; font-style: normal; font-weight: lighter; font-size: 8pt; color:black;}
7+
.big-header { font-family: sans-serif; font-style: normal; font-weight: bold; font-size: 9pt; color: white; border-top:10px solid white;}
8+
.light-row {background:#FFFFFF}
9+
.dark-row {background:#EEEEFF}
10+
.header {background:#99AADD}
11+
#indent {word-wrap : break-word;width :300px;text-indent:10px;}
12+
</STYLE>
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl="urn:schemas-microsoft-com:xslt">
2+
<xsl:output method="html" encoding="UTF-8"/>
3+
<xsl:key name="cat" match="category" use="@name"/>
4+
<xsl:template match="/">
5+
<xsl:for-each select="site">
6+
<html>
7+
<head>
8+
<title>checker.framework.cascade.updatesite</title>
9+
<style>@import url("web/site.css");</style>
10+
</head>
11+
<body>
12+
<h1 class="title">checker.framework.cascade.updatesite</h1>
13+
<p class="bodyText"><xsl:value-of select="description"/></p>
14+
<table width="100%" border="0" cellspacing="1" cellpadding="2">
15+
<xsl:for-each select="category-def">
16+
<xsl:sort select="@label" order="ascending" case-order="upper-first"/>
17+
<xsl:sort select="@name" order="ascending" case-order="upper-first"/>
18+
<xsl:if test="count(key('cat',@name)) != 0">
19+
<tr class="header">
20+
<td class="sub-header" width="30%">
21+
<xsl:value-of select="@name"/>
22+
</td>
23+
<td class="sub-header" width="70%">
24+
<xsl:value-of select="@label"/>
25+
</td>
26+
</tr>
27+
<xsl:for-each select="key('cat',@name)">
28+
<xsl:sort select="ancestor::feature//@version" order="ascending"/>
29+
<xsl:sort select="ancestor::feature//@id" order="ascending" case-order="upper-first"/>
30+
<tr>
31+
<xsl:choose>
32+
<xsl:when test="(position() mod 2 = 1)">
33+
<xsl:attribute name="class">dark-row</xsl:attribute>
34+
</xsl:when>
35+
<xsl:otherwise>
36+
<xsl:attribute name="class">light-row</xsl:attribute>
37+
</xsl:otherwise>
38+
</xsl:choose>
39+
<td class="log-text" id="indent">
40+
<xsl:choose>
41+
<xsl:when test="ancestor::feature//@label">
42+
<a href="{ancestor::feature//@url}"><xsl:value-of select="ancestor::feature//@label"/></a>
43+
<br/>
44+
<div id="indent">
45+
(<xsl:value-of select="ancestor::feature//@id"/> - <xsl:value-of select="ancestor::feature//@version"/>)
46+
</div>
47+
</xsl:when>
48+
<xsl:otherwise>
49+
<a href="{ancestor::feature//@url}"><xsl:value-of select="ancestor::feature//@id"/> - <xsl:value-of select="ancestor::feature//@version"/></a>
50+
</xsl:otherwise>
51+
</xsl:choose>
52+
<br />
53+
</td>
54+
<td>
55+
<table>
56+
<xsl:if test="ancestor::feature//@os">
57+
<tr><td class="log-text" id="indent">Operating Systems:</td>
58+
<td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@os"/></td>
59+
</tr>
60+
</xsl:if>
61+
<xsl:if test="ancestor::feature//@ws">
62+
<tr><td class="log-text" id="indent">Windows Systems:</td>
63+
<td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@ws"/></td>
64+
</tr>
65+
</xsl:if>
66+
<xsl:if test="ancestor::feature//@nl">
67+
<tr><td class="log-text" id="indent">Languages:</td>
68+
<td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@nl"/></td>
69+
</tr>
70+
</xsl:if>
71+
<xsl:if test="ancestor::feature//@arch">
72+
<tr><td class="log-text" id="indent">Architecture:</td>
73+
<td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@arch"/></td>
74+
</tr>
75+
</xsl:if>
76+
</table>
77+
</td>
78+
</tr>
79+
</xsl:for-each>
80+
<tr><td class="spacer"><br/></td><td class="spacer"><br/></td></tr>
81+
</xsl:if>
82+
</xsl:for-each>
83+
<xsl:if test="count(feature) &gt; count(feature/category)">
84+
<tr class="header">
85+
<td class="sub-header" colspan="2">
86+
Uncategorized
87+
</td>
88+
</tr>
89+
</xsl:if>
90+
<xsl:choose>
91+
<xsl:when test="function-available('msxsl:node-set')">
92+
<xsl:variable name="rtf-nodes">
93+
<xsl:for-each select="feature[not(category)]">
94+
<xsl:sort select="@id" order="ascending" case-order="upper-first"/>
95+
<xsl:sort select="@version" order="ascending" />
96+
<xsl:value-of select="."/>
97+
<xsl:copy-of select="." />
98+
</xsl:for-each>
99+
</xsl:variable>
100+
<xsl:variable name="myNodeSet" select="msxsl:node-set($rtf-nodes)/*"/>
101+
<xsl:for-each select="$myNodeSet">
102+
<tr>
103+
<xsl:choose>
104+
<xsl:when test="position() mod 2 = 1">
105+
<xsl:attribute name="class">dark-row</xsl:attribute>
106+
</xsl:when>
107+
<xsl:otherwise>
108+
<xsl:attribute name="class">light-row</xsl:attribute>
109+
</xsl:otherwise>
110+
</xsl:choose>
111+
<td class="log-text" id="indent">
112+
<xsl:choose>
113+
<xsl:when test="@label">
114+
<a href="{@url}"><xsl:value-of select="@label"/></a>
115+
<br />
116+
<div id="indent">
117+
(<xsl:value-of select="@id"/> - <xsl:value-of select="@version"/>)
118+
</div>
119+
</xsl:when>
120+
<xsl:otherwise>
121+
<a href="{@url}"><xsl:value-of select="@id"/> - <xsl:value-of select="@version"/></a>
122+
</xsl:otherwise>
123+
</xsl:choose>
124+
<br /><br />
125+
</td>
126+
<td>
127+
<table>
128+
<xsl:if test="@os">
129+
<tr><td class="log-text" id="indent">Operating Systems:</td>
130+
<td class="log-text" id="indent"><xsl:value-of select="@os"/></td>
131+
</tr>
132+
</xsl:if>
133+
<xsl:if test="@ws">
134+
<tr><td class="log-text" id="indent">Windows Systems:</td>
135+
<td class="log-text" id="indent"><xsl:value-of select="@ws"/></td>
136+
</tr>
137+
</xsl:if>
138+
<xsl:if test="@nl">
139+
<tr><td class="log-text" id="indent">Languages:</td>
140+
<td class="log-text" id="indent"><xsl:value-of select="@nl"/></td>
141+
</tr>
142+
</xsl:if>
143+
<xsl:if test="@arch">
144+
<tr><td class="log-text" id="indent">Architecture:</td>
145+
<td class="log-text" id="indent"><xsl:value-of select="@arch"/></td>
146+
</tr>
147+
</xsl:if>
148+
</table>
149+
</td>
150+
</tr>
151+
</xsl:for-each>
152+
</xsl:when>
153+
<xsl:otherwise>
154+
<xsl:for-each select="feature[not(category)]">
155+
<xsl:sort select="@id" order="ascending" case-order="upper-first"/>
156+
<xsl:sort select="@version" order="ascending" />
157+
<tr>
158+
<xsl:choose>
159+
<xsl:when test="count(preceding-sibling::feature[not(category)]) mod 2 = 1">
160+
<xsl:attribute name="class">dark-row</xsl:attribute>
161+
</xsl:when>
162+
<xsl:otherwise>
163+
<xsl:attribute name="class">light-row</xsl:attribute>
164+
</xsl:otherwise>
165+
</xsl:choose>
166+
<td class="log-text" id="indent">
167+
<xsl:choose>
168+
<xsl:when test="@label">
169+
<a href="{@url}"><xsl:value-of select="@label"/></a>
170+
<br />
171+
<div id="indent">
172+
(<xsl:value-of select="@id"/> - <xsl:value-of select="@version"/>)
173+
</div>
174+
</xsl:when>
175+
<xsl:otherwise>
176+
<a href="{@url}"><xsl:value-of select="@id"/> - <xsl:value-of select="@version"/></a>
177+
</xsl:otherwise>
178+
</xsl:choose>
179+
<br /><br />
180+
</td>
181+
<td>
182+
<table>
183+
<xsl:if test="@os">
184+
<tr><td class="log-text" id="indent">Operating Systems:</td>
185+
<td class="log-text" id="indent"><xsl:value-of select="@os"/></td>
186+
</tr>
187+
</xsl:if>
188+
<xsl:if test="@ws">
189+
<tr><td class="log-text" id="indent">Windows Systems:</td>
190+
<td class="log-text" id="indent"><xsl:value-of select="@ws"/></td>
191+
</tr>
192+
</xsl:if>
193+
<xsl:if test="@nl">
194+
<tr><td class="log-text" id="indent">Languages:</td>
195+
<td class="log-text" id="indent"><xsl:value-of select="@nl"/></td>
196+
</tr>
197+
</xsl:if>
198+
<xsl:if test="@arch">
199+
<tr><td class="log-text" id="indent">Architecture:</td>
200+
<td class="log-text" id="indent"><xsl:value-of select="@arch"/></td>
201+
</tr>
202+
</xsl:if>
203+
</table>
204+
</td>
205+
</tr>
206+
</xsl:for-each>
207+
</xsl:otherwise>
208+
</xsl:choose>
209+
</table>
210+
</body>
211+
</html>
212+
</xsl:for-each>
213+
</xsl:template>
214+
</xsl:stylesheet>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>checker.framework.cascade</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.pde.FeatureBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.pde.FeatureNature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bin.includes = feature.xml,\
2+
feature.properties,\
3+
license.html

0 commit comments

Comments
 (0)