1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| package org.apache.xindice.webadmin.viewer.components; |
21 |
| |
22 |
| import java.io.IOException; |
23 |
| import java.io.Writer; |
24 |
| |
25 |
| import javax.servlet.ServletException; |
26 |
| import javax.servlet.http.HttpServletRequest; |
27 |
| import javax.servlet.http.HttpServletResponse; |
28 |
| |
29 |
| import org.apache.xindice.core.Collection; |
30 |
| import org.apache.xindice.util.ReadOnlyException; |
31 |
| import org.apache.xindice.webadmin.viewer.HtmlCollectionViewer; |
32 |
| import org.apache.xindice.webadmin.viewer.HtmlViewerComponent; |
33 |
| import org.apache.xindice.xml.Xml2HtmlWriter; |
34 |
| import org.apache.commons.logging.Log; |
35 |
| import org.apache.commons.logging.LogFactory; |
36 |
| |
37 |
| |
38 |
| |
39 |
| |
40 |
| |
41 |
| |
42 |
| |
43 |
| public class CollectionConfigurationViewer extends HtmlViewerComponent implements HtmlCollectionViewer { |
44 |
| |
45 |
| private static final Log log = LogFactory.getLog(CollectionConfigurationViewer.class); |
46 |
| |
47 |
0
| public void execute(HttpServletRequest req, HttpServletResponse res, Collection col)
|
48 |
| throws ServletException, IOException { |
49 |
| |
50 |
0
| String path = col.getCanonicalName();
|
51 |
0
| String title = "Collection Configuration for " + path;
|
52 |
| |
53 |
0
| Writer output = startViewer(title, path, res);
|
54 |
0
| printStartTable(title, output);
|
55 |
0
| printStartSingleTableBox(output);
|
56 |
| |
57 |
0
| try {
|
58 |
0
| Xml2HtmlWriter.write(col.getConfig().getElement(), output);
|
59 |
0
| printEndSingleTableBox(output);
|
60 |
0
| printEndTable(output);
|
61 |
| } catch (ReadOnlyException e) { |
62 |
0
| log.error(e);
|
63 |
0
| output.write("Cannot read configuration: ");
|
64 |
0
| output.write(e.getMessage());
|
65 |
| } |
66 |
| |
67 |
0
| printEndSingleTableBox(output);
|
68 |
0
| printEndTable(output);
|
69 |
0
| finishViewer(output);
|
70 |
| } |
71 |
| |
72 |
0
| protected String getName() {
|
73 |
0
| return "config";
|
74 |
| } |
75 |
| |
76 |
| } |