You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Neil Griffin (JIRA)" <de...@myfaces.apache.org> on 2010/02/05 22:06:28 UTC

[jira] Created: (PORTLETBRIDGE-112) Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet

Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet
--------------------------------------------------------------------------------------

                 Key: PORTLETBRIDGE-112
                 URL: https://issues.apache.org/jira/browse/PORTLETBRIDGE-112
             Project: MyFaces Portlet Bridge
          Issue Type: Improvement
          Components: Impl
    Affects Versions: 2.0.0-alpha
            Reporter: Neil Griffin


Liferay Portal 5.2.3 (and newer) has a PortletInvokerImpl.isFacesPortlet() method that will return true if the value of the <portlet-class> from WEB-INF/portlet.xml for "javax.portlet.faces.GenericFacesPortlet". However, if someone needs to subclass javax.portlet.faces.GenericFacesPortlet and override the getBridgeClassName() method, then Liferay's PortletInvokerImpl.isFacesPortlet() will return false.

The purpose of PortletInvokerImpl.isFacesPortlet() is really just for Liferay's PortletRequestImpl.init(HttpServletRequest, Portlet, InvokerPortlet, PortletContext, WindowState, PortletMode, PortletPreferences, long) method, which will strip-off the namespace from request parameters for all portlets except JSF portlets.

This is somewhat of a hack, but in order to fake-out Liferay's PortletRequestImpl.init(...) method, I am recommending that you have the MyFaces Bridge's PortletExternalContextImpl.encodeNameSpace(String) method from this:

  public String encodeNamespace(String s)
  {
    return ((PortletResponse) mPortletResponse).getNamespace() + s;
  }

To this:

  private static final String LIFERAY_NAMESPACE_PREFIX_HACK = "A";
  public String encodeNamespace(String s)
  {
    return (LIFERAY_NAMESPACE_PREFIX_HACK + (PortletResponse) mPortletResponse).getNamespace() + s;
  }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (PORTLETBRIDGE-112) Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet

Posted by "Michael Freedman (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/PORTLETBRIDGE-112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Freedman resolved PORTLETBRIDGE-112.
--------------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0
                   1.0.0

Fixed in both versions..  If the appropriate request attribute is detected then I append lfr_ to the namespace.  Can you test/verify?

> Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet
> --------------------------------------------------------------------------------------
>
>                 Key: PORTLETBRIDGE-112
>                 URL: https://issues.apache.org/jira/browse/PORTLETBRIDGE-112
>             Project: MyFaces Portlet Bridge
>          Issue Type: Improvement
>          Components: Impl
>    Affects Versions: 2.0.0-alpha
>            Reporter: Neil Griffin
>             Fix For: 1.0.0, 2.0.0
>
>
> Liferay Portal 5.2.3 (and newer) has a PortletInvokerImpl.isFacesPortlet() method that will return true if the value of the <portlet-class> from WEB-INF/portlet.xml for "javax.portlet.faces.GenericFacesPortlet". However, if someone needs to subclass javax.portlet.faces.GenericFacesPortlet and override the getBridgeClassName() method, then Liferay's PortletInvokerImpl.isFacesPortlet() will return false.
> The purpose of PortletInvokerImpl.isFacesPortlet() is really just for Liferay's PortletRequestImpl.init(HttpServletRequest, Portlet, InvokerPortlet, PortletContext, WindowState, PortletMode, PortletPreferences, long) method, which will strip-off the namespace from request parameters for all portlets except JSF portlets.
> This is somewhat of a hack, but in order to fake-out Liferay's PortletRequestImpl.init(...) method, I am recommending that you have the MyFaces Bridge's PortletExternalContextImpl.encodeNameSpace(String) method from this:
>   public String encodeNamespace(String s)
>   {
>     return ((PortletResponse) mPortletResponse).getNamespace() + s;
>   }
> To this:
>   private static final String LIFERAY_NAMESPACE_PREFIX_HACK = "A";
>   public String encodeNamespace(String s)
>   {
>     return (LIFERAY_NAMESPACE_PREFIX_HACK + (PortletResponse) mPortletResponse).getNamespace() + s;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PORTLETBRIDGE-112) Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet

Posted by "Sverker Abrahamsson (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/PORTLETBRIDGE-112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830496#action_12830496 ] 

Sverker Abrahamsson commented on PORTLETBRIDGE-112:
---------------------------------------------------

See my comment on http://issues.liferay.com/browse/LPS-3082 and http://issues.liferay.com/browse/LPS-3184. In short, I'm not sure this is a good idea.

> Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet
> --------------------------------------------------------------------------------------
>
>                 Key: PORTLETBRIDGE-112
>                 URL: https://issues.apache.org/jira/browse/PORTLETBRIDGE-112
>             Project: MyFaces Portlet Bridge
>          Issue Type: Improvement
>          Components: Impl
>    Affects Versions: 2.0.0-alpha
>            Reporter: Neil Griffin
>
> Liferay Portal 5.2.3 (and newer) has a PortletInvokerImpl.isFacesPortlet() method that will return true if the value of the <portlet-class> from WEB-INF/portlet.xml for "javax.portlet.faces.GenericFacesPortlet". However, if someone needs to subclass javax.portlet.faces.GenericFacesPortlet and override the getBridgeClassName() method, then Liferay's PortletInvokerImpl.isFacesPortlet() will return false.
> The purpose of PortletInvokerImpl.isFacesPortlet() is really just for Liferay's PortletRequestImpl.init(HttpServletRequest, Portlet, InvokerPortlet, PortletContext, WindowState, PortletMode, PortletPreferences, long) method, which will strip-off the namespace from request parameters for all portlets except JSF portlets.
> This is somewhat of a hack, but in order to fake-out Liferay's PortletRequestImpl.init(...) method, I am recommending that you have the MyFaces Bridge's PortletExternalContextImpl.encodeNameSpace(String) method from this:
>   public String encodeNamespace(String s)
>   {
>     return ((PortletResponse) mPortletResponse).getNamespace() + s;
>   }
> To this:
>   private static final String LIFERAY_NAMESPACE_PREFIX_HACK = "A";
>   public String encodeNamespace(String s)
>   {
>     return (LIFERAY_NAMESPACE_PREFIX_HACK + (PortletResponse) mPortletResponse).getNamespace() + s;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PORTLETBRIDGE-112) Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet

Posted by "Neil Griffin (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/PORTLETBRIDGE-112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840975#action_12840975 ] 

Neil Griffin commented on PORTLETBRIDGE-112:
--------------------------------------------

Yes, if portletRequest.getAttribute("THEME_DISPLAY") is not null, then you're running in Liferay's portlet container.

> Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet
> --------------------------------------------------------------------------------------
>
>                 Key: PORTLETBRIDGE-112
>                 URL: https://issues.apache.org/jira/browse/PORTLETBRIDGE-112
>             Project: MyFaces Portlet Bridge
>          Issue Type: Improvement
>          Components: Impl
>    Affects Versions: 2.0.0-alpha
>            Reporter: Neil Griffin
>
> Liferay Portal 5.2.3 (and newer) has a PortletInvokerImpl.isFacesPortlet() method that will return true if the value of the <portlet-class> from WEB-INF/portlet.xml for "javax.portlet.faces.GenericFacesPortlet". However, if someone needs to subclass javax.portlet.faces.GenericFacesPortlet and override the getBridgeClassName() method, then Liferay's PortletInvokerImpl.isFacesPortlet() will return false.
> The purpose of PortletInvokerImpl.isFacesPortlet() is really just for Liferay's PortletRequestImpl.init(HttpServletRequest, Portlet, InvokerPortlet, PortletContext, WindowState, PortletMode, PortletPreferences, long) method, which will strip-off the namespace from request parameters for all portlets except JSF portlets.
> This is somewhat of a hack, but in order to fake-out Liferay's PortletRequestImpl.init(...) method, I am recommending that you have the MyFaces Bridge's PortletExternalContextImpl.encodeNameSpace(String) method from this:
>   public String encodeNamespace(String s)
>   {
>     return ((PortletResponse) mPortletResponse).getNamespace() + s;
>   }
> To this:
>   private static final String LIFERAY_NAMESPACE_PREFIX_HACK = "A";
>   public String encodeNamespace(String s)
>   {
>     return (LIFERAY_NAMESPACE_PREFIX_HACK + (PortletResponse) mPortletResponse).getNamespace() + s;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PORTLETBRIDGE-112) Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet

Posted by "Neil Griffin (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/PORTLETBRIDGE-112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852849#action_12852849 ] 

Neil Griffin commented on PORTLETBRIDGE-112:
--------------------------------------------

This is something that would best be fixed in the Liferay portlet container itself. We can do this for Liferay 6, but Liferay 4.x and Liferay 5.x are not getting dot-releases anymore. My guess is that Liferay 5.x has the widest deployment, so that's why I recommended putting the hack in the bridge.

> Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet
> --------------------------------------------------------------------------------------
>
>                 Key: PORTLETBRIDGE-112
>                 URL: https://issues.apache.org/jira/browse/PORTLETBRIDGE-112
>             Project: MyFaces Portlet Bridge
>          Issue Type: Improvement
>          Components: Impl
>    Affects Versions: 2.0.0-alpha
>            Reporter: Neil Griffin
>
> Liferay Portal 5.2.3 (and newer) has a PortletInvokerImpl.isFacesPortlet() method that will return true if the value of the <portlet-class> from WEB-INF/portlet.xml for "javax.portlet.faces.GenericFacesPortlet". However, if someone needs to subclass javax.portlet.faces.GenericFacesPortlet and override the getBridgeClassName() method, then Liferay's PortletInvokerImpl.isFacesPortlet() will return false.
> The purpose of PortletInvokerImpl.isFacesPortlet() is really just for Liferay's PortletRequestImpl.init(HttpServletRequest, Portlet, InvokerPortlet, PortletContext, WindowState, PortletMode, PortletPreferences, long) method, which will strip-off the namespace from request parameters for all portlets except JSF portlets.
> This is somewhat of a hack, but in order to fake-out Liferay's PortletRequestImpl.init(...) method, I am recommending that you have the MyFaces Bridge's PortletExternalContextImpl.encodeNameSpace(String) method from this:
>   public String encodeNamespace(String s)
>   {
>     return ((PortletResponse) mPortletResponse).getNamespace() + s;
>   }
> To this:
>   private static final String LIFERAY_NAMESPACE_PREFIX_HACK = "A";
>   public String encodeNamespace(String s)
>   {
>     return (LIFERAY_NAMESPACE_PREFIX_HACK + (PortletResponse) mPortletResponse).getNamespace() + s;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PORTLETBRIDGE-112) Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet

Posted by "Neil Griffin (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/PORTLETBRIDGE-112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830294#action_12830294 ] 

Neil Griffin commented on PORTLETBRIDGE-112:
--------------------------------------------

See also: http://issues.liferay.com/browse/LPS-3082

> Improve compatibility with Liferay Portal for portlets that extend GenericFacesPortlet
> --------------------------------------------------------------------------------------
>
>                 Key: PORTLETBRIDGE-112
>                 URL: https://issues.apache.org/jira/browse/PORTLETBRIDGE-112
>             Project: MyFaces Portlet Bridge
>          Issue Type: Improvement
>          Components: Impl
>    Affects Versions: 2.0.0-alpha
>            Reporter: Neil Griffin
>
> Liferay Portal 5.2.3 (and newer) has a PortletInvokerImpl.isFacesPortlet() method that will return true if the value of the <portlet-class> from WEB-INF/portlet.xml for "javax.portlet.faces.GenericFacesPortlet". However, if someone needs to subclass javax.portlet.faces.GenericFacesPortlet and override the getBridgeClassName() method, then Liferay's PortletInvokerImpl.isFacesPortlet() will return false.
> The purpose of PortletInvokerImpl.isFacesPortlet() is really just for Liferay's PortletRequestImpl.init(HttpServletRequest, Portlet, InvokerPortlet, PortletContext, WindowState, PortletMode, PortletPreferences, long) method, which will strip-off the namespace from request parameters for all portlets except JSF portlets.
> This is somewhat of a hack, but in order to fake-out Liferay's PortletRequestImpl.init(...) method, I am recommending that you have the MyFaces Bridge's PortletExternalContextImpl.encodeNameSpace(String) method from this:
>   public String encodeNamespace(String s)
>   {
>     return ((PortletResponse) mPortletResponse).getNamespace() + s;
>   }
> To this:
>   private static final String LIFERAY_NAMESPACE_PREFIX_HACK = "A";
>   public String encodeNamespace(String s)
>   {
>     return (LIFERAY_NAMESPACE_PREFIX_HACK + (PortletResponse) mPortletResponse).getNamespace() + s;
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.