Details
-
Type: Task
-
Status: Closed
-
Priority: Major
-
Resolution: Invalid
-
Affects Version/s: 1.8.1
-
Fix Version/s: None
-
Component/s: Framework, ICE-Components
-
Labels:None
-
Environment:JSF 2.0
Description
The components need to ensure that they are not doing any calls that are specific to a particular environment unless absolutely necessary. This is so that portlets can be properly supported without failing. For example, the DataExporterRenderer uses this call which would fail in a portlet environment:
ServletContext context = ((HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false)) .getServletContext();
The inputFile component currently uses another ICEfaces class called CommonEnvironmentRequest to abstract out the environmental differences but some methods are simply not supported in the Portlet API so it may not cover all cases. The work here is to use techniques that are environment agnostic so that all components can be run in portlets.
ServletContext context = ((HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false)) .getServletContext();
The inputFile component currently uses another ICEfaces class called CommonEnvironmentRequest to abstract out the environmental differences but some methods are simply not supported in the Portlet API so it may not cover all cases. The work here is to use techniques that are environment agnostic so that all components can be run in portlets.
Issue Links
- depends on
-
ICE-4367 dataExporter does not work in portal environment
- Closed
DataExporterRenderer.java
private File createFile(FacesContext fc, UIData uiData, DataExporter oe) {
OutputTypeHandler outputHandler = null;
ServletContext context = ((HttpSession) FacesContext
.getCurrentInstance().getExternalContext().getSession(false))
.getServletContext();
IncludeRenderer.java
URLConnection includedConnection = includedURL.openConnection();
includedConnection
.setRequestProperty("Cookie",
"JSESSIONID=" + ((HttpSession) context.getExternalContext()
.getSession(false)).getId());