[gatein-issues] [JBoss JIRA] Created: (GTNPORTAL-1340) Portlet Edit mode is broken in Gatein 3.1 for JSF portlet

Gerbert Nuijen (JIRA) jira-events at lists.jboss.org
Tue Jun 29 06:00:46 EDT 2010


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


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: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the gatein-issues mailing list