#3 how to get it to work with jboss portal?

open
nobody
None
5
2006-08-07
2006-08-07
Anonymous
No

Hi,

I was trying to draw a chart within a portlet in jboss
portal with chartcreator but failed. the image is not
rendering. by view source, I've got
<img id="impressions" width="400" height="300"
src="chartcreatorrequest.jsf?ts=1154984708281&amp;id=impressions"
/> but the picture is just not drawn.

my jsf file:

<chart:chart id="impressions" title="Impressions"
datasource="#{folderDailyImps}" type="timeseries"
width="400" height="300" />

my bean

@Out(scope=ScopeType.SESSION, required=false)
private TimeSeriesCollection folderDailyImps;

@Factory("folderDailyImps")
public void populateTimeSeries() {

Connection conn = _session.connection();
PreparedStatement ps = null;
ResultSet rs = null;
TimeSeries series = null;
folderDailyImps = new TimeSeriesCollection();

try {
ps = conn.prepareStatement(SQL_GET_GOOGLE_TIME_SERIES);
ps.setInt(1, 1);
rs = ps.executeQuery();

while (rs.next()) {
if (series != null) {
folderDailyImps.addSeries(series); // Add the last
series
}
series = new TimeSeries(rs.getString("name"),
Day.class);
series.add(new Day(new
Date(rs.getDate("xdate").getTime())), rs
.getInt("imps"));
logger.info(rs.getString("name") + " " +
rs.getDate("xdate") + " " + rs.getInt("imps"));
}
logger.info("folderDailyImps factory method invoked");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

portlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0">

<portlet>
<portlet-name>Reporting</portlet-name>

<portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>
<init-param>
<name>default-view</name>
<value>/home.seam</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>Reporting</title>
</portlet-info>
</portlet>

</portlet-app>

porlet-instance.xml
<?xml version="1.0"?>
<deployments>
<deployment>
<instance>
<instance-id>ReportingInstance</instance-id>
<portlet-ref>Reporting</portlet-ref>
</instance>
</deployment>
</deployments>

portal-object.xml

<deployment>
<if-exists>overwrite</if-exists>
<parent-ref>siab</parent-ref>
<page>
<page-name>Reporting</page-name>
<properties />
<window>
<window-name>ReportingWindow</window-name>
<instance-ref>ReportingInstance</instance-ref>
<region>center</region>
<height>1</height>
</window>
<security-constraint>
<policy-permission>
<role-name>Authenticated</role-name>
<action-name>viewrecursive</action-name>
</policy-permission>
</security-constraint>
</page>
</deployment>

Discussion


Log in to post a comment.