[jboss-user] [JBoss Portal] - Re: have any one get chartcreator to work with jboss portal?

javajedi do-not-reply at jboss.com
Tue Aug 8 04:45:04 EDT 2006


Doesn't really have anything to do with JBoss Portal, but I just patched the chart creator to work inside JBoss Portal.  In case anyone cares, here is the patch:

diff --new-file -rc ./net/sf/jsfcomp/chartcreator/ChartListener.java /home/tim/src/3p/chartcreator-1.2.0-RC1/net/sf/jsfcomp/chartcreator/ChartListener.java
  | *** ./net/sf/jsfcomp/chartcreator/ChartListener.java  2006-08-08 01:22:01.000000000 -0700
  | --- /home/tim/src/3p/chartcreator-1.2.0-RC1/net/sf/jsfcomp/chartcreator/ChartListener.java  2006-08-08 01:17:28.000000000 -0700
  | ***************
  | *** 53,58 ****
  | --- 53,64 ----
  |       Map sessionMap = externalContext.getSessionMap();
  | 
  |       String id = (String)requestMap.get("id");
  | +     for (Object key : sessionMap.keySet()) {
  | +       String s = (String) key;
  | +       if (s.endsWith("?" + id)) {
  | +         id = s;
  | +       }
  | +     }
  |       ChartData chartData = (ChartData) sessionMap.get(id);
  |       JFreeChart chart = ChartUtils.createChartWithType(chartData);
  |       ChartUtils.setGeneralChartProperties(chart, chartData);
  | ***************
  | *** 71,81 ****
  |     }
  | 
  |     public void beforePhase(PhaseEvent phaseEvent) {
  | -
  |     }
  | 
  |     public PhaseId getPhaseId() {
  | !     return PhaseId.RESTORE_VIEW;
  |     }
  | 
  |     private void writeChartWithServletResponse(HttpServletResponse response, JFreeChart chart, ChartData chartData) throws IOException{
  | --- 77,86 ----
  |     }
  | 
  |     public void beforePhase(PhaseEvent phaseEvent) {
  |     }
  | 
  |     public PhaseId getPhaseId() {
  | !     return PhaseId.ANY_PHASE;
  |     }
  | 
  |     private void writeChartWithServletResponse(HttpServletResponse response, JFreeChart chart, ChartData chartData) throws IOException{
  | diff --new-file -rc ./net/sf/jsfcomp/chartcreator/UIChart.java /home/tim/src/3p/chartcreator-1.2.0-RC1/net/sf/jsfcomp/chartcreator/UIChart.java
  | *** ./net/sf/jsfcomp/chartcreator/UIChart.java  2006-08-08 01:22:01.000000000 -0700
  | --- /home/tim/src/3p/chartcreator-1.2.0-RC1/net/sf/jsfcomp/chartcreator/UIChart.java  2006-08-08 01:23:24.000000000 -0700
  | ***************
  | *** 113,119 ****
  |       writer.writeAttribute("id", getClientId(context), null);
  |       writer.writeAttribute("width", String.valueOf(getWidth()), null);
  |       writer.writeAttribute("height", String.valueOf(getHeight()), null);
  | !     writer.writeAttribute("src", ChartListener.CHART_REQUEST + ".jsf?ts=" + System.currentTimeMillis() + "&id=" + getClientId(context), null);
  |       ChartUtils.renderPassThruImgAttributes(writer, this);
  |     }
  | 
  | --- 113,122 ----
  |       writer.writeAttribute("id", getClientId(context), null);
  |       writer.writeAttribute("width", String.valueOf(getWidth()), null);
  |       writer.writeAttribute("height", String.valueOf(getHeight()), null);
  | !     writer.writeAttribute("src", context.getApplication().getViewHandler().getResourceURL(context, "/") +
  | !         ChartListener.CHART_REQUEST + ".jsf?ts=" + System.currentTimeMillis() +
  | !         "&id=" + getClientId(context), null);
  | !
  |       ChartUtils.renderPassThruImgAttributes(writer, this);
  |     }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963734#3963734

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963734



More information about the jboss-user mailing list