1 package org.apache.maven.doxia.siterenderer;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.Date;
26 import java.util.List;
27 import java.util.Locale;
28 import java.util.Map;
29
30 import org.apache.maven.artifact.Artifact;
31 import org.apache.maven.doxia.site.decoration.DecorationModel;
32 import org.apache.maven.doxia.site.skin.SkinModel;
33 import org.codehaus.plexus.util.ReaderFactory;
34 import org.codehaus.plexus.util.WriterFactory;
35
36
37
38
39
40
41 public class SiteRenderingContext
42 {
43 private String inputEncoding = ReaderFactory.FILE_ENCODING;
44
45 private String outputEncoding = WriterFactory.UTF_8;
46
47 private String templateName;
48
49 private ClassLoader templateClassLoader;
50
51 private Map<String, ?> templateProperties;
52
53 private Locale locale = Locale.getDefault();
54
55 private List<Locale> siteLocales = new ArrayList<Locale>();
56
57 private DecorationModel decoration;
58
59 private String defaultWindowTitle;
60
61 private Artifact skin;
62
63 private SkinModel skinModel;
64
65 private boolean usingDefaultTemplate;
66
67 private File rootDirectory;
68
69 private List<File> siteDirectories = new ArrayList<File>();
70
71 private Map<String, String> moduleExcludes;
72
73 private List<ExtraDoxiaModuleReference> modules = new ArrayList<ExtraDoxiaModuleReference>();
74
75 private boolean validate;
76
77 private Date publishDate;
78
79 private File processedContentOutput;
80
81
82
83
84
85
86
87
88 public boolean isValidate()
89 {
90 return validate;
91 }
92
93
94
95
96
97
98
99 public void setValidate( boolean validate )
100 {
101 this.validate = validate;
102 }
103
104
105
106
107
108
109 public String getTemplateName()
110 {
111 return templateName;
112 }
113
114
115
116
117
118
119 public ClassLoader getTemplateClassLoader()
120 {
121 return templateClassLoader;
122 }
123
124
125
126
127
128
129 public void setTemplateClassLoader( ClassLoader templateClassLoader )
130 {
131 this.templateClassLoader = templateClassLoader;
132 }
133
134
135
136
137
138
139 public Map<String, ?> getTemplateProperties()
140 {
141 return templateProperties;
142 }
143
144
145
146
147
148
149 public void setTemplateProperties( Map<String, ?> templateProperties )
150 {
151 this.templateProperties = Collections.unmodifiableMap( templateProperties );
152 }
153
154
155
156
157
158
159 public Locale getLocale()
160 {
161 return locale;
162 }
163
164
165
166
167
168
169 public void setLocale( Locale locale )
170 {
171 this.locale = locale;
172 }
173
174
175
176
177
178
179
180 public List<Locale> getSiteLocales()
181 {
182 return siteLocales;
183 }
184
185
186
187
188
189
190 public void addSiteLocales( List<Locale> locales )
191 {
192 siteLocales.addAll( locales );
193 }
194
195
196
197
198
199
200 public DecorationModel getDecoration()
201 {
202 return decoration;
203 }
204
205
206
207
208
209
210 public void setDecoration( DecorationModel decoration )
211 {
212 this.decoration = decoration;
213 }
214
215
216
217
218
219
220 public void setDefaultWindowTitle( String defaultWindowTitle )
221 {
222 this.defaultWindowTitle = defaultWindowTitle;
223 }
224
225
226
227
228
229
230 public String getDefaultWindowTitle()
231 {
232 return defaultWindowTitle;
233 }
234
235
236
237
238
239
240 public Artifact getSkin()
241 {
242 return skin;
243 }
244
245
246
247
248
249
250 public void setSkin( Artifact skin )
251 {
252 this.skin = skin;
253 }
254
255
256
257
258
259
260 public SkinModel getSkinModel()
261 {
262 return skinModel;
263 }
264
265
266
267
268
269
270 public void setSkinModel( SkinModel skinModel )
271 {
272 this.skinModel = skinModel;
273 }
274
275
276
277
278
279
280 public void setTemplateName( String templateName )
281 {
282 this.templateName = templateName;
283 }
284
285
286
287
288
289
290 public void setUsingDefaultTemplate( boolean usingDefaultTemplate )
291 {
292 this.usingDefaultTemplate = usingDefaultTemplate;
293 }
294
295
296
297
298
299
300 public boolean isUsingDefaultTemplate()
301 {
302 return usingDefaultTemplate;
303 }
304
305
306
307
308
309
310
311 public void addSiteDirectory( File siteDirectory )
312 {
313 this.siteDirectories.add( siteDirectory );
314 }
315
316
317
318
319
320
321
322
323 public void addModuleDirectory( File moduleBasedir, String moduleParserId )
324 {
325 this.modules.add( new ExtraDoxiaModuleReference( moduleParserId, moduleBasedir ) );
326 }
327
328
329
330
331
332
333 public List<File> getSiteDirectories()
334 {
335 return siteDirectories;
336 }
337
338
339
340
341
342
343 public List<ExtraDoxiaModuleReference> getModules()
344 {
345 return modules;
346 }
347
348
349
350
351
352
353 public Map<String, String> getModuleExcludes()
354 {
355 return moduleExcludes;
356 }
357
358
359
360
361
362
363 public void setModuleExcludes( Map<String, String> moduleExcludes )
364 {
365 this.moduleExcludes = moduleExcludes;
366 }
367
368
369
370
371
372
373 public String getInputEncoding()
374 {
375 return inputEncoding;
376 }
377
378
379
380
381
382
383 public void setInputEncoding( String inputEncoding )
384 {
385 this.inputEncoding = inputEncoding;
386 }
387
388
389
390
391
392
393 public String getOutputEncoding()
394 {
395 return outputEncoding;
396 }
397
398
399
400
401
402
403 public void setOutputEncoding( String outputEncoding )
404 {
405 this.outputEncoding = outputEncoding;
406 }
407
408
409
410
411
412
413 public Date getPublishDate()
414 {
415 return publishDate;
416 }
417
418
419
420
421
422
423 public void setPublishDate( Date publishDate )
424 {
425 this.publishDate = publishDate;
426 }
427
428
429
430
431
432
433
434 public File getProcessedContentOutput()
435 {
436 return processedContentOutput;
437 }
438
439
440
441
442
443
444
445
446 public void setProcessedContentOutput( File processedContentOutput )
447 {
448 this.processedContentOutput = processedContentOutput;
449 }
450
451
452
453
454
455
456
457
458 public File getRootDirectory()
459 {
460 return rootDirectory;
461 }
462
463
464
465
466
467
468
469 public void setRootDirectory( File rootDirectory )
470 {
471 this.rootDirectory = rootDirectory;
472 }
473 }