]
Minh Hoang TO reassigned GTNPORTAL-1340:
----------------------------------------
Assignee: Minh Hoang TO
Portlet Edit mode is broken in Gatein 3.1 for JSF portlet
---------------------------------------------------------
Key: GTNPORTAL-1340
URL:
https://jira.jboss.org/browse/GTNPORTAL-1340
Project: GateIn Portal
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: WebUI
Affects Versions: 3.1.0-GA
Environment: All
Reporter: Gerbert Nuijen
Assignee: Minh Hoang TO
Fix For: 3.2.0-GA
Original Estimate: 1 hour
Remaining Estimate: 1 hour
The edit mode for jsf portlets is broken in Gatein 3.1. This was introduced with bug fix
https://jira.jboss.org/browse/GTNPORTAL-1228.
The problem is that FragmentResponse has either chars or bytes:
public int getType()
{
if (bytes == null)
{
if (chars == null)
{
return TYPE_EMPTY;
}
else
{
return TYPE_CHARS;
}
}
else
{
return TYPE_BYTES;
}
}
/**
* Return the content as a string.
*
* @return the content
*/
public String getContent()
{
switch (getType())
{
case TYPE_CHARS:
return getChars();
case TYPE_BYTES:
return new String(bytes);
case TYPE_EMPTY:
return "";
default:
throw new AssertionError();
}
}
The correct fix should be something like this:
FragmentResponse fragmentResponse = (FragmentResponse)portletResponse;
if (fragmentResponse.getType() == FragmentResponse.TYPE_BYTES) {
content = new String(fragmentResponse.getBytes(), "UTF-8");
} else {
content = fragmentResponse.getContent();
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: