1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.web; |
21 |
|
|
22 |
|
import java.io.IOException; |
23 |
|
|
24 |
|
import com.xpn.xwiki.XWikiContext; |
25 |
|
import com.xpn.xwiki.XWikiException; |
26 |
|
import com.xpn.xwiki.plugin.graphviz.GraphVizPlugin; |
27 |
|
import com.xpn.xwiki.util.Util; |
28 |
|
|
29 |
|
@Deprecated |
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.29 |
|
30 |
|
public class DotAction extends XWikiAction |
31 |
|
{ |
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.29 |
|
32 |
0 |
@Override... |
33 |
|
public String render(XWikiContext context) throws XWikiException |
34 |
|
{ |
35 |
0 |
XWikiRequest request = context.getRequest(); |
36 |
0 |
String path = request.getRequestURI(); |
37 |
0 |
String filename = Util.decodeURI(path.substring(path.lastIndexOf("/") + 1), context); |
38 |
0 |
try { |
39 |
0 |
((GraphVizPlugin) context.getWiki().getPlugin("graphviz", context)).outputDotImageFromFile(filename, |
40 |
|
context); |
41 |
|
} catch (IOException e) { |
42 |
0 |
throw new XWikiException(XWikiException.MODULE_XWIKI_APP, |
43 |
|
XWikiException.ERROR_XWIKI_APP_SEND_RESPONSE_EXCEPTION, |
44 |
|
"Exception while sending response", e); |
45 |
|
} |
46 |
0 |
return null; |
47 |
|
} |
48 |
|
} |