掲示板

Wicket portlets breaking in 6.0.4

13年前 に Tor Iver Wilhelmsen によって更新されました。

Wicket portlets breaking in 6.0.4

Junior Member 投稿: 60 参加年月日: 08/12/03 最新の投稿
We have some Wicket 1.4 portlets that work fine in Liferay 5.2.3, but when deployed on 6.0.4 they fail.

Stepping through code I see that on 5.2.3, clicking a link (or submitting a form) in the portlet triggers an action request followed by a render request (as expected), while on 6.0.4 there is only a render request. Apparently, the Wicket portlet assumes a lone render request is for a "fresh" render and creates a new Page, thus losing the state.

Was there a change in the implementation that can cause this? I notice that the "p_p_url_type" parameter is no longer added to a portlet link by Liferay, but trying to add it manually has no effect.

Is there some change that can have caused this? And is there a quick fix? Or do I need to patch some Wicket classes to make them work under Liferay 6.0.x?
thumbnail
13年前 に Gabriel Landon によって更新されました。

RE: Wicket portlets breaking in 6.0.4

New Member 投稿: 10 参加年月日: 10/09/30 最新の投稿
Hi,

Did you find a way to solve this?

I'm using liferay 6.0.5 and I have the same kind of behavior.

When I have several portlets in a page, when I click a link in one of the portlet all the other "wicket" portlets are recreate instead of being refresh.

The behavior change when I click on a link inside a wicket portlet, then this portlet is correctly refresh (and not recreate) by the other.

Regards,

Gabriel.
thumbnail
13年前 に Thiago Leão Moreira によって更新されました。

RE: Wicket portlets breaking in 6.0.4

Liferay Legend 投稿: 1449 参加年月日: 07/10/10 最新の投稿
I'm playing around with Wicket 1.4.8 and Liferay trunk and the portlets are working fine.
thumbnail
13年前 に Gabriel Landon によって更新されました。

RE: Wicket portlets breaking in 6.0.4

New Member 投稿: 10 参加年月日: 10/09/30 最新の投稿
Hi Thiago,

I'm also using wicket 1.4.8 (I've been working with wicket for 3 years now, but only for web application, not portlet).
I've created portlets base upon the "portlet in action" examples.

Where can I have the latest snaphot or nighly build of liferay so I can try my wicket portlets with it?

regards,

Gabriel.
thumbnail
13年前 に Thiago Leão Moreira によって更新されました。

RE: Wicket portlets breaking in 6.0.4

Liferay Legend 投稿: 1449 参加年月日: 07/10/10 最新の投稿
Hey Gabriel,

You can find the nightly files at http://releases.liferay.com/portal/nightly

Hope this helps
thumbnail
13年前 に Gabriel Landon によって更新されました。

RE: Wicket portlets breaking in 6.0.4

New Member 投稿: 10 参加年月日: 10/09/30 最新の投稿
Thiago,

Thank you for your help.
I've download the latest nightly build, but unfortunately I still have the same problem.

I've attached a quickstart to reproduce the problem.

In my demo project there are 2 very simple portlets which display the number of clicks.

-Put one "Hello world" porlet and one "Home" portlet on a page
-click several times on the "ajax click" of the "hello world" portlet.
-click several times on the "ajax click" of the "Home" portlet.
-click one time on the "click" of the "home" portlet
-The "hello world" portlet is recreate (all datas are lost) instead of being refresh.
-click one time on the "click" of the "Hello world" portlet
-The "home" portlet is refresh (correct behaviour).


Please, can you point me what I'm doing wrong?
Or do you have a quickstart I could use.

Regards,

Gabriel.

添付ファイル:

thumbnail
13年前 に Gabriel Landon によって更新されました。

RE: Wicket portlets breaking in 6.0.4

New Member 投稿: 10 参加年月日: 10/09/30 最新の投稿
Please, can anyone help me on this?

Can someone point me what I'm doing wrong and why my wicket portlets are recreate and not refresh by default?
Those are very simple portlets.

I've searched into "Portlet in action" and "Liferay in action" and search many forums (wicket and liferay) without success.

Regards,

Gabriel.
10年前 に Thomas Storm によって更新されました。

RE: Wicket portlets breaking in 6.0.4

New Member 投稿: 1 参加年月日: 13/07/10 最新の投稿
Hi Gabriel,

I know this thread is ancient, but anyway -- we're running into the same problem. Did you have any success in this?

Best,
Thomas
thumbnail
10年前 に Gabriel Landon によって更新されました。

RE: Wicket portlets breaking in 6.0.4

New Member 投稿: 10 参加年月日: 10/09/30 最新の投稿
Hi Thomas,

I do have solve this problem as I've developped many portlets with wicket 1.4 and liferay 6.0 but it was almost 3 years ago!
Now I'm using wicket 1.5 and liferay 6.1.

I'm not quite sure what was the problem at his time.
I guess it was about the name of the porlet (and urls) that must be the same in your web.xml, porlet.xml and liferay-portlet.xml

Examples :
-Web.xml :
<!-- Profilage -->
<filter>
<filter-name>ProfilageApplication</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>detectPortletContext</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>pf.edt.liferay.portlet.profilage.ProfilageApplication</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>ProfilageApplication</filter-name>
<url-pattern>/profilage/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>

-portlet.xml :
<portlet>
<portlet-name>profilage</portlet-name>
<display-name>profilage de l'utilisateur</display-name>
<portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</portlet-class>
<init-param>
<name>wicketFilterPath</name>
<value>/profilage</value>
</init-param>

<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
<title>Profilage</title>
<short-title>Profilage</short-title>
<keywords>Profilage</keywords>
</portlet-info>
...
</portlet>

-liferay-portlet.xml :

<portlet>
<portlet-name>profilage</portlet-name>
<icon>/icon.png</icon>
<instanceable>true</instanceable>
</portlet>

Hope this help.

Gabriel.
thumbnail
13年前 に Sergej Logis によって更新されました。

RE: Wicket portlets breaking in 6.0.4

New Member 投稿: 19 参加年月日: 10/10/27 最新の投稿
Thiago Leão Moreira:
I'm playing around with Wicket 1.4.8 and Liferay trunk and the portlets are working fine.


Hello Thiago! (and HI to others too!)
It seems you have some experience regarding Wicket + Liferay, so, maybe you will be able to help me a bit, I hope emoticon
I'm currently in R&D of Wicket-based portlets for Liferay. More or less everything seems to be OK, except the fact that I can't find a way to register more than 1 portlet per Wicket application.
Wicket portlets in Liferay [somehow] have limitation, that portlet name should be the same as Wicket filter path. In this case everything seems to work as expected, notably AJAX support. But if I change portlet name (or filter path) - I'm getting in trouble with broken AJAX support (at best). To be more precise, I'm getting following error on any AJAX request (monitored via Firefox javascript console): The requested resource (/forms-portlet/wicketFilter/) is not available, where "forms-portlet" is context of my Wicket portlet web application and "/wicketFilter" is path on which Wicket filter is configured in web.xml (as opposed to "/wicketPortlet" in working configuration below).

This is my configuration which works:
portlet.xml
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemalocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd 
      http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
   <portlet>
      <description>Wicket Portlet</description>
      <portlet-name>[b]wicketPortlet[/b]</portlet-name>
      <display-name>wicketPortlet</display-name>
      <portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</portlet-class>
      <init-param>
         <name>wicketFilterPath</name>
         <value>/[b]wicketPortlet[/b]</value>
      </init-param>
      <supports>
         <mime-type>text/html</mime-type>
         <portlet-mode>VIEW</portlet-mode>
         <portlet-mode>EDIT</portlet-mode>
      </supports>
      <supports>
         <mime-type>text/xml</mime-type>
         <portlet-mode>VIEW</portlet-mode>
         <portlet-mode>EDIT</portlet-mode>
      </supports>
      <supported-locale>en</supported-locale>
      <resource-bundle>Language</resource-bundle>
   </portlet>
</portlet-app>

and web.xml
   ...
   <filter>
      <filter-name>wicketApplication</filter-name>
      <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
      <init-param>
         <param-name>applicationFactoryClassName</param-name>
         <param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
      </init-param>
      <init-param>
         <param-name>applicationBean</param-name>
         <param-value>wicketApplication</param-value>
      </init-param>
   </filter>
   <filter-mapping>
      <filter-name>wicketApplication</filter-name>
      <url-pattern>/[b]wicketPortlet[/b]/*</url-pattern>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      <dispatcher>FORWARD</dispatcher>
   </filter-mapping>
   [i]<!-- These are added by Liferay upon deployment -->   
   <servlet>
      <servlet-name>wicketPortlet</servlet-name>
      <servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
      <init-param>
         <param-name>portlet-class</param-name>
         <param-value>org.apache.wicket.protocol.http.portlet.WicketPortlet</param-value>
      </init-param>
      <load-on-startup>0</load-on-startup>
   </servlet>
   <servlet-mapping>
      <servlet-name>wicketPortlet</servlet-name>
      <url-pattern>/wicketPortlet/*</url-pattern>
   </servlet-mapping> [/i]
   ...   

Please note, that portlet name and Wicket filter path are the same. As I told before, the problem with such configuration is that I cannot register more that one portlet per Wicket filter (and Wicket filter = Wicket application), and that's exactly what I'm trying to achieve (2+ portlets running in the same Wicket application context).

Please, if you (or anybody else reading this) have something to suggest or somehow guide me in correct direction - I will be very grateful for your help!

Thanks in advance!

P.S. I'm currently using 1.4.10 version of Wicket framework.