Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.1
-
Component/s: ICE-Components
-
Labels:None
-
Environment:Operating System: Windows XP
Platform: PC
Description
noted in the forum: http://www.icefaces.org/JForum/posts/list/3066.page
user contrib:
I just got charts to work with a couple of changes to
com.icesoft.faces.component.outputchart.OutputChart
Code:
public String getPath() {
String folder = "/";
if (getFacesContext() != null
&& getFacesContext().getExternalContext() != null) {
if (DOMResponseWriter.isStreamWriting()) {
folder = "./web/chart/images";
} else {
Object ctx = getFacesContext().getExternalContext()
.getContext();
if (ctx instanceof ServletContext) {
folder = ((ServletContext) ctx).getRealPath("charts");
} else {
folder = ((PortletContext) ctx).getRealPath("charts");
}
}
}
return folder;
}
Code:
private String getChartFileName() {
Object req = FacesContext.getCurrentInstance().getExternalContext()
.getRequest();
String sessionId = "";
if (req instanceof HttpServletRequest) {
sessionId = ((HttpServletRequest) req).getRequestedSessionId();
} else {
sessionId = ((RenderRequest) req).getRequestedSessionId();
}
return this.getType()
+ this.getClientId(FacesContext.getCurrentInstance())
.replaceAll(":", "") + sessionId + imageCounter++
+ ".jpeg";
}
user contrib:
I just got charts to work with a couple of changes to
com.icesoft.faces.component.outputchart.OutputChart
Code:
public String getPath() {
String folder = "/";
if (getFacesContext() != null
&& getFacesContext().getExternalContext() != null) {
if (DOMResponseWriter.isStreamWriting()) {
folder = "./web/chart/images";
} else {
Object ctx = getFacesContext().getExternalContext()
.getContext();
if (ctx instanceof ServletContext) {
folder = ((ServletContext) ctx).getRealPath("charts");
} else {
folder = ((PortletContext) ctx).getRealPath("charts");
}
}
}
return folder;
}
Code:
private String getChartFileName() {
Object req = FacesContext.getCurrentInstance().getExternalContext()
.getRequest();
String sessionId = "";
if (req instanceof HttpServletRequest) {
sessionId = ((HttpServletRequest) req).getRequestedSessionId();
} else {
sessionId = ((RenderRequest) req).getRequestedSessionId();
}
return this.getType()
+ this.getClientId(FacesContext.getCurrentInstance())
.replaceAll(":", "") + sessionId + imageCounter++
+ ".jpeg";
}
Issue Links
- blocks
-
ICE-1809 Support for Liferay Portal
- Closed
Marking as FIXED.
Our latest portlet demos that showed at JavaOne indicate that charts do work in portlets. Probably due to the refactoring of resource location logic, things should work much better now.