Search in sources :

Example 1 with ChartingPluginApi

use of com.xpn.xwiki.plugin.charts.ChartingPluginApi in project xwiki-platform by xwiki.

the class ChartingAction method render.

@Override
public String render(XWikiContext context) throws XWikiException {
    XWikiRequest request = context.getRequest();
    String path = request.getRequestURI();
    String filename = Util.decodeURI(path.substring(path.lastIndexOf("/") + 1), context);
    try {
        ((ChartingPluginApi) context.getWiki().getPluginApi("charting", context)).outputFile(filename, context);
    } catch (IOException e) {
        throw new XWikiException(XWikiException.MODULE_XWIKI_APP, XWikiException.ERROR_XWIKI_APP_SEND_RESPONSE_EXCEPTION, "Exception while sending response", e);
    }
    return null;
}
Also used : ChartingPluginApi(com.xpn.xwiki.plugin.charts.ChartingPluginApi) XWikiRequest(com.xpn.xwiki.web.XWikiRequest) IOException(java.io.IOException) XWikiException(com.xpn.xwiki.XWikiException)

Aggregations

XWikiException (com.xpn.xwiki.XWikiException)1 ChartingPluginApi (com.xpn.xwiki.plugin.charts.ChartingPluginApi)1 XWikiRequest (com.xpn.xwiki.web.XWikiRequest)1 IOException (java.io.IOException)1