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