Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 3.0
-
Fix Version/s: EE-3.0.0.BETA, 3.0.1
-
Component/s: Framework
-
Labels:None
-
Environment:ICEfaces 3 portal
Description
During the work done for http://jira.icefaces.org/browse/ICE-7684, we implemented a fix to solve a problem with the ace:dateExporter component when running on a portlet. The original problem in that case was related to the following section of code:
public void restoreState(FacesContext context, Object state) {
//call method from super-class to restore the component attributes first
super.restoreState(context, state);
Map attributes = getAttributes();
String name = (String) attributes.get("name");
String library = (String) attributes.get("library");
String version = (String) attributes.get("version");
ResourceHandler resourceHandler = context.getApplication().getResourceHandler();
--> Resource r = resourceHandler.createResource(name, fixResourceParameter(library));
String path = r.getRequestPath();
if (version == null) {
script = path;
} else {
if (path.contains("?")) {
script = path + "&v=" + version;
} else {
script = path + "?v=" + version;
}
}
}
There are 2 reasons for evaluating and potentially removing the createResource() call during restoreState().
1) It exposes an issue in the PortletFaces Bridge where the request wrapper we set is replaced by the original raw request and the request parameter values are lost (seeICE-7684 for more details).
2) It may be unnecessarily performance intensive.
public void restoreState(FacesContext context, Object state) {
//call method from super-class to restore the component attributes first
super.restoreState(context, state);
Map attributes = getAttributes();
String name = (String) attributes.get("name");
String library = (String) attributes.get("library");
String version = (String) attributes.get("version");
ResourceHandler resourceHandler = context.getApplication().getResourceHandler();
--> Resource r = resourceHandler.createResource(name, fixResourceParameter(library));
String path = r.getRequestPath();
if (version == null) {
script = path;
} else {
if (path.contains("?")) {
script = path + "&v=" + version;
} else {
script = path + "?v=" + version;
}
}
}
There are 2 reasons for evaluating and potentially removing the createResource() call during restoreState().
1) It exposes an issue in the PortletFaces Bridge where the request wrapper we set is replaced by the original raw request and the request parameter values are lost (see
2) It may be unnecessarily performance intensive.
Issue Links
- blocks
-
ICE-7713 Improve strategy for behaviour of ace:fileEntry component in portlets.
- Closed
Assigning to Mircea for a future release.