Skip to content

Commit 4d4b822

Browse files
author
Miel Vander Sande
committed
Completed draft writers
1 parent a714460 commit 4d4b822

File tree

11 files changed

+534
-2
lines changed

11 files changed

+534
-2
lines changed
318 Bytes
Binary file not shown.
Lines changed: 67 additions & 0 deletions
Loading
Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
/*! @license ©2013 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */
2+
3+
html, input, th, td {
4+
font-family: "Open Sans", Verdana, Arial, sans-serif;
5+
font-size: 11pt;
6+
}
7+
8+
html {
9+
background: #f6f6f6;
10+
}
11+
12+
body {
13+
max-width: 800px;
14+
margin: 0 auto;
15+
line-height: 1.3;
16+
color: #333333;
17+
background-color: white;
18+
padding: 10px 40px;
19+
box-shadow: 2px 2px 15px 0px rgba(50, 50, 50, 0.75);
20+
}
21+
22+
h1, h2, h3, legend {
23+
margin: .4em 0 .2em;
24+
overflow: hidden;
25+
}
26+
h1 {
27+
margin-right: 180px;
28+
}
29+
h1 a {
30+
color: black;
31+
}
32+
h2 {
33+
color: #be1622;
34+
}
35+
h3 {
36+
white-space: nowrap;
37+
overflow: hidden;
38+
text-overflow: ellipsis;
39+
}
40+
41+
p {
42+
margin: 0;
43+
}
44+
45+
a {
46+
color: #be1622;
47+
text-decoration: none;
48+
border-bottom: none 1px;
49+
}
50+
a:hover {
51+
color: #be1622 !important;
52+
border-bottom-style: solid;
53+
}
54+
55+
ul {
56+
padding: 0;
57+
margin: 0 0 .5em 1.5em;
58+
list-style: none;
59+
}
60+
61+
pre {
62+
margin: 0;
63+
}
64+
65+
form {
66+
margin: 0 0 1.5em;
67+
}
68+
69+
fieldset {
70+
border: none;
71+
padding: .5em 0 0 20px;
72+
}
73+
fieldset ul {
74+
margin-left: 0;
75+
}
76+
fieldset li {
77+
line-height: 2em;
78+
}
79+
80+
legend {
81+
font-size: 1.17em;
82+
font-weight: bold;
83+
padding: 0;
84+
margin-left: -20px;
85+
}
86+
87+
label {
88+
width: 100px;
89+
display: block;
90+
float: left;
91+
clear: both;
92+
font-weight: bold;
93+
}
94+
label:after {
95+
content: ":";
96+
}
97+
98+
input {
99+
outline: none;
100+
font-size: .95em;
101+
}
102+
fieldset input {
103+
width: 500px;
104+
color: #be1622;
105+
background-color: transparent;
106+
border: none;
107+
border-bottom: 1px solid #bbbbbb;
108+
cursor: pointer;
109+
}
110+
input[type=submit] {
111+
font-weight: bold;
112+
color: #be1622;
113+
background-color: #f6f6f6;
114+
border-radius: 3px;
115+
padding: 5px 8px;
116+
border: 1px solid #999999;
117+
cursor: pointer;
118+
}
119+
input[type=submit]:hover {
120+
border-color: #666666;
121+
}
122+
input[type=submit]:active {
123+
padding: 6px 7px 4px 9px;
124+
}
125+
.uri {
126+
font-family: "Droid Sans Mono", monospace;
127+
}
128+
129+
header .logo {
130+
text-align: right;
131+
}
132+
header .logo a {
133+
position: absolute;
134+
top: 20px;
135+
margin-left: -100px;
136+
border-bottom-width: 0px;
137+
}
138+
header .logo img {
139+
width: 160px;
140+
}
141+
142+
footer {
143+
clear: both;
144+
margin: 1.5em 0 .5em;
145+
font-size: small;
146+
}
147+
footer * {
148+
color: gray;
149+
margin-right: 5px;
150+
}
151+
152+
.counts {
153+
color: gray;
154+
}
155+
ul.links {
156+
margin: 0;
157+
padding: 0;
158+
display: inline;
159+
}
160+
ul.links li {
161+
display: inline;
162+
padding-left: 20px;
163+
font-weight: bold;
164+
}
165+
166+
ul.triples {
167+
margin: .3em 0 1em 20px;
168+
font-size: .95em;
169+
line-height: 1.5;
170+
font-family: "Droid Sans Mono", monospace;
171+
overflow-x: hidden;
172+
}
173+
ul.triples li {
174+
text-indent: -20px;
175+
padding-left: 20px;
176+
max-width: 100%;
177+
max-height: 1.5em;
178+
overflow: hidden;
179+
white-space: nowrap;
180+
text-overflow: ellipsis;
181+
}
182+
ul.triples li:hover {
183+
max-height: 100em;
184+
white-space: normal;
185+
transition: max-height .5s ease-in;
186+
transition-delay: .5s;
187+
}
188+
ul.triples li:not(:hover) a {
189+
color: inherit;
190+
}
191+
ul.triples a:nth-child(2) {
192+
margin: 0 1em;
193+
}
194+
abbr {
195+
border: none;
196+
}
197+
198+
.index {
199+
margin-bottom: 2em;
200+
}
201+
.datasets {
202+
margin: .5em 20px;
203+
}
204+
dt {
205+
font-weight: bold;
206+
display: block;
207+
float: left;
208+
clear: left;
209+
}
210+
dd {
211+
color: gray;
212+
margin: .1em 0 0 12em;
213+
font-size: .95em;
214+
}
215+
216+
#about {
217+
margin-top: 1.5em;
218+
font-size: .9em;
219+
}
220+
221+
@media screen and (max-width: 700px) {
222+
html, input, th, td {
223+
font-size: 10pt;
224+
}
225+
body {
226+
padding: 15px;
227+
}
228+
header figure {
229+
display: none;
230+
}
231+
h1, legend {
232+
margin: 0;
233+
}
234+
fieldset, ul.triples {
235+
padding: .5em 0;
236+
margin: 0;
237+
}
238+
fieldset input {
239+
width: 70%;
240+
}
241+
label {
242+
width: 80px;
243+
}
244+
ul.triples li {
245+
margin: 1em 0;
246+
}
247+
}

src/org/linkeddatafragments/views/HtmlWriterImpl.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ public HtmlWriterImpl(Map<String, String> prefixes, HashMap<String, IDataSource>
4949
@Override
5050
public void writeFragment(ServletOutputStream outputStream, IDataSource datasource, LinkedDataFragment fragment, LinkedDataFragmentRequest ldfRequest) throws IOException, TemplateException{
5151
Map data = new HashMap();
52+
53+
// base.ftl.html
5254
data.put("assetsPath", "assets/");
5355
data.put("header", datasource.getTitle());
54-
5556
data.put("date", new Date());
5657

58+
// fragment.ftl.html
5759
data.put("datasourceUrl", ldfRequest.getDatasetURL());
5860
data.put("datasource", datasource);
5961
data.put("controls", fragment.getControls());
@@ -79,8 +81,10 @@ public void writeFragment(ServletOutputStream outputStream, IDataSource datasour
7981
@Override
8082
public void writeNotFound(ServletOutputStream outputStream, HttpServletRequest request) throws Exception {
8183
Map data = new HashMap();
82-
data.put("url", request.getRequestURL().toString());
84+
data.put("assetsPath", "assets/");
8385
data.put("datasources", getDatasources());
86+
data.put("date", new Date());
87+
data.put("url", request.getRequestURL().toString());
8488

8589
Writer out = new OutputStreamWriter(outputStream);
8690
notfoundTemplate.process(data, out);
@@ -89,6 +93,8 @@ public void writeNotFound(ServletOutputStream outputStream, HttpServletRequest r
8993
@Override
9094
public void writeError(ServletOutputStream outputStream, Exception ex) throws Exception {
9195
Map data = new HashMap();
96+
data.put("assetsPath", "assets/");
97+
data.put("date", new Date());
9298
data.put("error", ex);
9399

94100
Writer out = new OutputStreamWriter(outputStream);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.linkeddatafragments.views;
2+
3+
import java.util.HashMap;
4+
import java.util.Map;
5+
import org.linkeddatafragments.datasource.IDataSource;
6+
7+
/**
8+
*
9+
* @author mielvandersande
10+
*/
11+
public abstract class LinkedDataFragmentWriterBase implements LinkedDataFragmentWriter {
12+
private final Map<String, String> prefixes;
13+
private final HashMap<String, IDataSource> datasources;
14+
15+
public LinkedDataFragmentWriterBase(Map<String, String> prefixes, HashMap<String, IDataSource> datasources) {
16+
this.prefixes = prefixes;
17+
this.datasources = datasources;
18+
}
19+
20+
public Map<String, String> getPrefixes() {
21+
return prefixes;
22+
}
23+
24+
public HashMap<String, IDataSource> getDatasources() {
25+
return datasources;
26+
}
27+
}

0 commit comments

Comments
 (0)