【问题标题】:Navigation after IPC in LiferayLiferay中IPC后的导航
【发布时间】:2015-01-29 20:32:44
【问题描述】:

我们希望在接收到 IPC 事件后在 Liferay 中导航到另一个 portlet。 因此,我们从一个 portlet 发送事件,实现第二个从 MVCPortlet 扩展的 Portlet,并接收带有一些信息的事件! 所以我们想在 Liferay 中导航到第二个 portlet。

我们收到事件的方法是这样的

@ProcessEvent(qname = "{http://liferay.com}empinfo")
public void handleProcessempinfoEvent(final javax.portlet.EventRequest request, final javax.portlet.EventResponse response) throws javax.portlet.PortletException, java.io.IOException

我们还覆盖了来自 com.liferay.util.bridges.mvc.MVCPortlet 的方法,但在发送事件后没有调用任何方法。

有没有办法在 liferay (6.1.2) 中导航?

谢谢蒂姆

【问题讨论】:

    标签: jsf liferay ipc liferay-6 portlet


    【解决方案1】:

    事件是否已处理? “导航到第二个 portlet”是什么意思?事件 - 默认情况下 - 仅分发到出现在同一页面上的 portlet。如果您想在不同页面上的 portlet 上接收事件,则必须显式配置 Liferay 以将事件分发到同一站点中的所有页面。请注意,这可能会影响您的表现。此外 - 一旦您导航到另一个页面 - 默认情况下,该页面上的 portlet 的状态将被重置。

    检查以下(和相关的)portal.properties:

    #
    # Set this property to specify how events are distributed. If the value is
    # "layout-set", then events will be distributed to all portlets contained in
    # a layout set. If the value is "layout", then events will be distributed to
    # all portlets that are present in a layout.
    #
    portlet.event.distribution=layout
    
    #
    # Set this property to specify how public render parameters are distributed.
    # If the value is "layout-set", then public render parameters will be
    # distributed to all portlets contained in a layout set. This will only work
    # correctly if the property "layout.default.p_l_reset" is set to false. If
    # the value is "layout", then public render parameters will be distributed
    # to all portlets that are present in a layout.
    #
    portlet.public.render.parameter.distribution=layout
    
    #
    # Set the default value for the "p_l_reset" parameter. If set to true,
    # render parameters are cleared when different pages are hit. This is not
    # the behavior promoted by the portlet specification, but is the one that
    # most end users seem to prefer.
    #
    layout.default.p_l_reset=true
    

    如果您打算导航到不同的页面,您还必须注意这不在 portlet API 中。因此,您必须确定如何找到相关页面、其 URL 以及如何重定向。在动作处理 portlet 中添加更多逻辑并在那里进行重定向可能更容易:至少您将只处理一个动作。每个动作可能会处理多个事件 - 因此未定义如果它们冲突将触发哪个潜在重定向。如果它来自 EventHandler,我会认为真正的重定向(任何方式)是相当意外的行为,但从 ActionHandler 可以理解。

    【讨论】:

      猜你喜欢
      • 2011-07-20
      • 1970-01-01
      • 2011-07-25
      • 1970-01-01
      • 1970-01-01
      • 2017-03-23
      • 2015-06-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多