掲示板

Portlets with Wicket in Liferay

15年前 に Michael Weber によって更新されました。

Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Hi!

I'm trying to develop a portlet using the wicket Framework.
I have already found several posts in this forum dealing with this problem, but nearly all posts are kind of out of date.

What ist the actual status concerning wicket portlets in Liferay?
Is there any example or tutorial how to use wicket portlets in Liferay?

According to this HowTo everything I'm still missing is an implementation of the Apache Portals Bridges PortletResourceURLFactory interface.
Is there any implementation in Liferay already?

As far as I can see, there's an open issue at:
http://support.liferay.com/browse/LEP-3873
But I think there is nearly no progress, isn't it?

Thank you in advance for any help or hint!
Regards,
Michael Weber
thumbnail
15年前 に Rob Sonke によって更新されました。

RE: Portlets with Wicket in Liferay

Expert 投稿: 275 参加年月日: 07/08/26 最新の投稿
Ah nice, somebody else using Wicket in combination with Liferay emoticon. I think I'm able to write several pages about this subject but that's not very useful for you. The story about the liferayresourceurlfactory is also a bit outdated, since the portlet 2 standard you don't need that one anymore.

I'll give a short overview of the current status:
- you can run wicket portlets on liferay since version 5
- you'll need the portlet 2.0 patch (search wicket mailinglist and jira)
- if you want to use wicket ajax things, you're stucked at liferay 5.0.1 for now since 5.1 has some changes in request dispatching (we're still working on how to solve this). Probably some things in wicket has to be changed to, as mentioned on the wicket mailinglist before.

That's in short what you can do and cannot do. There's a lot more to tell about but that's not really useful for now.

So I suggest, download 5.0.1. Apply the patch on wicket and add the wicket jars to liferay and start developing portlets.
15年前 に Janne A Kario によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 10 参加年月日: 07/04/16 最新の投稿
Rob Sonke:
- if you want to use wicket ajax things, you're stucked at liferay 5.0.1 for now since 5.1 has some changes in request dispatching (we're still working on how to solve this). Probably some things in wicket has to be changed to, as mentioned on the wicket mailinglist before.
.


This is great piece of information. I have my wicket portlets working on 5.1.2 with the portlet 2.0 wicket patch but I never managed to get the ajax stuff working. I'm not going to need the ajax stuff so I was more than content with being able to use wicket even without ajax.

j
thumbnail
15年前 に Rob Sonke によって更新されました。

RE: Portlets with Wicket in Liferay

Expert 投稿: 275 参加年月日: 07/08/26 最新の投稿
Happy to clarify that. Problem is that we still don't know which of the two is not following the portlet standards. Maybe both implementations are correct but sometimes the portlet specs can be understood in multiple ways.
thumbnail
15年前 に Jonas Yuan によって更新されました。

RE: Portlets with Wicket in Liferay

Liferay Master 投稿: 993 参加年月日: 07/04/27 最新の投稿
Hi Michael, Janne and Rob,

About Liferay Widget portlet 133 ....

Here is code for usage of widget portlet 133 and article template calls ( they are working fine in my test: 5.2.* - see attached image - abstracted from Liferay DEV Book):
----------------------------------
<a style='text-decoration: none ' href='javascript:Liferay.PortletSharing.showWidgetInfo("$request.render-url")'>&nbsp; <img src="/cms_services/images/button/btnSendMsg.gif" alt="Print" width="105" height="20" />
</a>
-------------------------------

showWidgetInfo: function(widgetURL) {
var popup = Liferay.Popup(
{
width: 550,
modal: true,
title: Liferay.Language.get('add-to-any-website')
}
);

var portletURL = Liferay.PortletURL.createResourceURL();

portletURL.setPortletId(133);

portletURL.setParameter("widgetURL", widgetURL);

jQuery.ajax(
{
url: portletURL.toString(),
success: function(message) {
popup.html(message);
}
}
);
--------------------------
Good Luck!

Jonas Yuan

Liferay Book: Liferay Portal Enterprise Intranets
thumbnail
15年前 に Rob Sonke によって更新されました。

RE: Portlets with Wicket in Liferay

Expert 投稿: 275 参加年月日: 07/08/26 最新の投稿
I think the name is a bit misleading but wicket != widget emoticon
thumbnail
15年前 に Jonas Yuan によって更新されました。

RE: Portlets with Wicket in Liferay

Liferay Master 投稿: 993 参加年月日: 07/04/27 最新の投稿
Oh, oops,

I am confused by the name. Thank you!

Apache Wicket is a Java web application framework that takes simplicity, separation of concerns and ease of development to a whole new level. JSR-286 Portlets should be developed in Wicket Framework smoothly, as well as that of other frameworks, such as Spring MVC, JSF, etc.

Happy New Year!

Jonas Yuan
15年前 に Michael Weber によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Hi!

At first: Thank you very much!

Rob Sonke:
So I suggest, download 5.0.1. Apply the patch on wicket and add the wicket jars to liferay and start developing portlets.


I already applied the patch and tried developing portlets using liferay 5.1.2 (I don't need AJAX at the moment).
I tried several times to deploy my portlets, but it didn't work. Maybe my problem was that I always tried to use the liferayresourceurlfactory.
I'll try again without liferayresourceurlfactory and report my porgress or/and further problems. ;-)

Regards,
Michael
thumbnail
15年前 に Jonas Yuan によって更新されました。

RE: Portlets with Wicket in Liferay

Liferay Master 投稿: 993 参加年月日: 07/04/27 最新の投稿
Hi

Here is an update on this issue.

Look into http://issues.apache.org/jira/browse/WICKET-1620

With that the PortletResourceUrlFactory shouldn't really be necessary any more.

Thanks

Jonas Yuan
15年前 に Sauli Ketola によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 17 参加年月日: 08/05/14 最新の投稿
With a previous version of the portlet 2.0 patch I was able to get wicket portlets to run in 5.0.1 (see: Wicket Portlets with Liferay 5)

Now I tried with Liferay 5.1.2). I built wicket (+ the wicket examples) with the latest patch and when running the Linkomatic Example some of the links give me this error:

ERROR - [default]                  - Servlet.service() for servlet default threw exception
java.lang.ClassCastException: com.liferay.portlet.PortletServletResponse cannot be cast to javax.portlet.StateAwareResponse
	at org.apache.wicket.protocol.http.portlet.StateAwareSevletResponseWrapper.<init>(StateAwareSevletResponseWrapper.java:46)
	at org.apache.wicket.protocol.http.portlet.PortletActionServletResponseWrapper.<init>(PortletActionServletResponseWrapper.java:42)
	at org.apache.wicket.protocol.http.portlet.WicketFilterPortletHelper.setupFilter(WicketFilterPortletHelper.java:151)
	at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:229)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
	at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:302)
	at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:107)
	at org.apache.wicket.protocol.http.portlet.WicketPortlet.processRequest(WicketPortlet.java:646)
	at org.apache.wicket.protocol.http.portlet.WicketPortlet.processAction(WicketPortlet.java:552)
	at com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter(FilterChainImpl.java:93)
	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:57)
	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:96)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
	at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:575)
	at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:618)
	at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:354)
	at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:622)
	at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:407)
	at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:189)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
	at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:164)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:443)
	at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:708)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:399)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
	at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:144)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:117)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:71)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.servlet.filters.compression.CompressionFilter.processFilter(CompressionFilter.java:141)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:71)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:282)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:71)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:74)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.servlet.filters.layoutcache.LayoutCacheFilter.processFilter(LayoutCacheFilter.java:432)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:71)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:199)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:71)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.servlet.filters.sso.opensso.OpenSSOFilter.processFilter(OpenSSOFilter.java:73)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:71)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:186)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:132)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:74)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	at java.lang.Thread.run(Thread.java:619)
</init></init>
15年前 に Thijs Vonk によって更新されました。

RE: Portlets with Wicket in Liferay

Junior Member 投稿: 31 参加年月日: 07/09/09 最新の投稿
See my last comment in
https://issues.apache.org/jira/browse/WICKET-1620?focusedCommentId=12662351#action_12662351


But then your still going to run into a problem that ajax doesn't work...
15年前 に Sauli Ketola によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 17 参加年月日: 08/05/14 最新の投稿
Thijs Vonk:
See my last comment in
https://issues.apache.org/jira/browse/WICKET-1620?focusedCommentId=12662351#action_12662351


But then your still going to run into a problem that ajax doesn't work...


Thanks. That solved that problem.

I continued to test with the Linkomatic Example and now all the links work except the ones that open in a pop up window. The generated url is different for those. Any idea why?

Here's an example:

Normal action url:
http://localhost:8080/group/test/4?p_p_id=LinkomaticApplication_WAR_wicketexamples14SNAPSHOT&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_LinkomaticApplication_WAR_wicketexamples14SNAPSHOT__wu=%2Flinkomatic%2F%3Fwicket%3Ainterface%3D%3A0%3AactionLink%3A%3AILinkListener%3A%3A

Pop-up url:
http://localhost:8080/group/test/4?p_p_id=LinkomaticApplication_WAR_wicketexamples14SNAPSHOT&p_p_lifecycle=2&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_LinkomaticApplication_WAR_wicketexamples14SNAPSHOT__wuview=%2Flinkomatic%2F%3Fwicket%3AbookmarkablePage%3Dpopuppagemap%3Aorg.apache.wicket.examples.linkomatic.Popup&_LinkomaticApplication_WAR_wicketexamples14SNAPSHOT__wuview=%2Flinkomatic%2F%3Fwicket%3Ainterface%3D%3A0%3A%3A%3A%3A
15年前 に Sauli Ketola によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 17 参加年月日: 08/05/14 最新の投稿
I've been testing more now and I understood that p_p_lifecycle=2 means resource request. So those don't seem to work. There's resource request related problems also with the Images example. That example gives this error:

ERROR - RequestCycle               - URL path must start with a '/' or include '://'
java.lang.IllegalArgumentException: URL path must start with a '/' or include '://'
at com.liferay.portlet.PortletResponseImpl.encodeURL(PortletResponseImpl.java:338)
.
.
15年前 に Janne A Kario によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 10 参加年月日: 07/04/16 最新の投稿
Michael Weber:
Hi!

I already applied the patch and tried developing portlets using liferay 5.1.2 (I don't need AJAX at the moment).
I tried several times to deploy my portlets, but it didn't work. Maybe my problem was that I always tried to use the liferayresourceurlfactory.
I'll try again without liferayresourceurlfactory and report my porgress or/and further problems. ;-)


I too had some issues at the beginning. The Wicket portlet stuff relies on WicketFilter. However I could not get WicketFilter to work with Liferay. Liferay does not seem to pick up HTTP servlet filters and when I tried to access the portlet I would get "The requested resource (...) is not available" error messages. After introducing wicket both as a WicketFilter and WicketPortlet I could get my portlet working.

j
15年前 に Michael Weber によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Hallo!

Now I spent some days trying to publish a portlet in Liferay using Wicket but I still can't succeed.
I already did the following steps:

1. I downloaded the latest build of Wicket (1.4-SNAPSHOT) and applied the latest patch for portlet 2.0 support (WICKET-1620-portlet2.0-tight.patch).

2. Afterwards it took me about a day to build the wicket JARs. For me, it seems as if there was an error in the latest wicket trunk. But I'm relativly new to maven, therefore it is maybe my fault.
The following dependency in "...\wicket-extensions\pom.xml" couldn't be found by maven:
<dependency>
  <groupid>org.apache.wicket</groupid>
  <artifactid>wicket</artifactid>
  <classifier>tests</classifier>
  <scope>test</scope>
</dependency>

But as I don't need (at least I think so) the "wicket-extensions"-JAR so far and as the portlet patch didn't change anything in "...\wicket-extensions", I just decided to skip it and use the wicket-extension-JAR of wicket-1.4RC1.

3. I tried to code a simple "Hello World" using Wicket, i.e. I used the NetBeans-Plugin for Wicket to do so and added all things I thought that would be necessary for creating a portlet.
But when I try to upload my portlet in Liferay (5.1.2 with Tomcat 6.0) I always get an error in the console. In my experience with portlets (without Wicket) thats always a sign that either the web.xml or the portlet.xml is not correct. But I can't find any mistake.

Can you please help me?
It would help if anyone knows/has a simple example I can have a look at to compare it with my code? The example coming with the wicket-portlet-patch is a bit too confusing for me at the moment . I already compared it to my code, but I could'n figure out any significant differences.

Here is my web.xml:
<!--?xml version="1.0" encoding="UTF-8"?-->
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>Alliance Manager</display-name>
    <filter>
        <filter-name>AllianceManager</filter-name>
        <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
        <init-param>
            <param-name>applicationClassName</param-name>
            <param-value>eu.spike.allianceManager.Application</param-value>
        </init-param>
        <init-param>
            <param-name>detectPortletContext</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>AllianceManager</filter-name>
        <url-pattern>/wicket/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <session-config><session-timeout>
        30
    </session-timeout></session-config>
    <welcome-file-list>
        <welcome-file />
    </welcome-file-list>
</web-app>


And here my portlet.xml:
<!--?xml version="1.0" encoding="UTF-8" ?-->
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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" version="2.0">
  <portlet>
    <description>The Alliance Manager ...</description>
    <portlet-name>AllianceManager</portlet-name>
    <display-name>AllianceManager</display-name>
    <portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</portlet-class>
    <init-param>
        <name>wicketFilterPath</name>
        <value>/wicket/*</value>
    </init-param>
    <supports>
        <mime-type>text/html</mime-type>
        <portlet-mode>VIEW</portlet-mode>
        <portlet-mode>EDIT</portlet-mode>
    </supports>
    <portlet-info>
        <title>AllianceManager</title>
        <short-title>AllianceManager</short-title>
    </portlet-info>
  </portlet>
</portlet-app>


If you need the rest of my code, you can find the entire sample attached (I used NetBeans).
I'm available for any further questions or information.

Thank you very much!
Michael Weber
15年前 に Janne A Kario によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 10 参加年月日: 07/04/16 最新の投稿
Michael Weber:

But when I try to upload my portlet in Liferay (5.1.2 with Tomcat 6.0) I always get an error in the console.


What error message?

j
15年前 に Michael Weber によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Thanks Janne for your answer.

You find a screenshot of my error message attached.

But I think it's not very usefull.
I know, that it is possible to make Tomcate produce better error messages, but I never succeeded to tell Tomcate to do so.

Thanks a lot,
Michael Weber
15年前 に Michael Weber によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Hi!

I still can't figure out my problem.
Maybe someone knows or can send me a simple example that uses Wicket in Liferay.
That would realy be great.

Thanks in advance,
Michael
thumbnail
15年前 に Rob Sonke によって更新されました。

RE: Portlets with Wicket in Liferay

Expert 投稿: 275 参加年月日: 07/08/26 最新の投稿
Could you check the catalina log and localhost logs from tomcat? That normally contains more then just the ListenerStart error.
15年前 に Michael Weber によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Here tha catalina log:
05.01.2009 19:05:07 org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/AllianceManager]
05.01.2009 19:05:07 org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "com.liferay.portal.kernel.servlet.PortletContextListener" is already configured for this context. The duplicate definition has been ignored.
05.01.2009 19:05:07 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: Error listenerStart
05.01.2009 19:05:07 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: Context [/AllianceManager] startup failed due to previous errors
05.01.2009 19:14:01 org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080


The localhost log from Tomcat is empty. How can I start logging in this file?

Thanks!
Michael
thumbnail
15年前 に Rob Sonke によって更新されました。

RE: Portlets with Wicket in Liferay

Expert 投稿: 275 参加年月日: 07/08/26 最新の投稿
Could you check if you have log4j and/or slf4j on your classpath?
15年前 に Michael Weber によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Rob Sonke:
Could you check if you have log4j and/or slf4j on your classpath?


Hi Rob,

I have the "log4j-1.2.15.jar" and the "slf4j-log4j12-1.5.6.jar" in my "liferay\lib\"-directory.
I just copied them into there without doing anything more. Wasn't that right?

Thanks,
Michael
thumbnail
15年前 に Rob Sonke によって更新されました。

RE: Portlets with Wicket in Liferay

Expert 投稿: 275 参加年月日: 07/08/26 最新の投稿
Yes that looks fine. No idea what's happening then, you should try to debug more why it's not starting.
thumbnail
15年前 に Rob Sonke によって更新されました。

RE: Portlets with Wicket in Liferay

Expert 投稿: 275 参加年月日: 07/08/26 最新の投稿
Another one popped up in my mind: portals-bridges-common jar. Is that one on your classpath too?
15年前 に Michael Weber によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Rob Sonke:
Another one popped up in my mind: portals-bridges-common jar. Is that one on your classpath too?


Hey Rob,

You are right. I don't have this "portals-bridges-common" jar.
But I have never heard or read about this jar. What do I need it for? And where can I get it (Couldn't find such a file in context of liferay or wicket)?
As you told me that I won't need a "liferayresourceurlfactory" any more, I thought that I wouldn't need anything like a "portals-bridge"-jar, too.

Thanks very much for your help,
Michael
thumbnail
15年前 に Rob Sonke によって更新されました。

RE: Portlets with Wicket in Liferay

Expert 投稿: 275 参加年月日: 07/08/26 最新の投稿
You can download it over here:
http://portals.apache.org/bridges/download.html
15年前 に Michael Weber によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Ok, I put the "portals-bridges-common"-jar in my class path, but deploying my portlet still doesn't work.
Any further ideas?

Thanks in advance,
Michael
15年前 に Michael Weber によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Hi!

I got it running now.
To be honest I'm not quite sure why it didn't work and why it works now. I played around with some parameters and made all steps again.
Suddently it worked.

But now I have a new problem:
I added a stylesheet (CSS) to my wicket application. But in Liferay this stylesheet is ignored. Why?
Is there any possibility to use special stylesheets in a wicket portlet?

Thanks a lot for all your help in the past and the future, ;-)
Michael
15年前 に Sauli Ketola によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 17 参加年月日: 08/05/14 最新の投稿
Michael Weber:
Hi!

I got it running now.
To be honest I'm not quite sure why it didn't work and why it works now. I played around with some parameters and made all steps again.
Suddently it worked.

But now I have a new problem:
I added a stylesheet (CSS) to my wicket application. But in Liferay this stylesheet is ignored. Why?
Is there any possibility to use special stylesheets in a wicket portlet?

Thanks a lot for all your help in the past and the future, ;-)
Michael



Which version of liferay are you using?
15年前 に Michael Weber によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Sauli Ketola:
Which version of liferay are you using?


I'm using Liferay 5.1.2!
Not even a reference (maybe with a wrong path) to my css-file is shown when my portlet is open in Liferay.

Any ideas?
Thanks,
Michael
thumbnail
15年前 に Rob Sonke によって更新されました。

RE: Portlets with Wicket in Liferay

Expert 投稿: 275 参加年月日: 07/08/26 最新の投稿
Small but promising note. A colleague of mine (Thijs) has made a breakthrough with the current trunk (almost 5.2) from liferay and wicket 1.4 with the portlet patch. He was able to let the ajax stuff work!

Next week, we'll try to upgrade to 5.2 and share our experiences here.
15年前 に Michael Weber によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 23 参加年月日: 08/09/19 最新の投稿
Hi once again,

until today I made a lot of progress ==> Thanks to you all!
But I still have my stylesheet-problem:

On my main page I want to reference to a stylsheet. Therefore I added the following in "Homepage.java":
add(new StyleSheetReference("stylesheet", HomePage.class, "style.css"));

In my "Homepage.html" I added:

  <link wicket:id="stylesheet" rel="Stylesheet" type="text/css">


If I start my wicket app as an webapplication in Tomcat (6.0) it works perfektly. But if I start my app in Liferay (5.1.2) as a portlet, my stylesheet is ignored. My homepage looks as if there. In the code of the webside there is the following link:
<link wicket:id="stylesheet" rel="stylesheet" type="text/css" href="http://localhost:8080/user/joebloggs/3?p_p_id=AllianceManager_WAR_AllianceManager&amp;p_p_lifecycle=0&amp;p_p_state=normal&amp;p_p_mode=view&amp;p_p_col_id=column-1&amp;p_p_col_count=1&amp;_AllianceManager_WAR_AllianceManager__wuview=%2Fwicket%2F%2FAllianceManager%2Fwicket%2Fps%3AAllianceManager_WAR_AllianceManager_LAYOUT_10709%2Fresources%2Feu.Spike.BasePage%2Fstyle.css">

If I try to open this link directly in my browser, the following error occures:
The requested resource (/AllianceManager/wicket//AllianceManager/wicket/ps:AllianceManager_WAR_AllianceManager_LAYOUT_10709/resources/eu.Spike.BasePage/style.css) is not available 


If I try to put the stylesheet path in my "Homepage.html":

  <link wicket:id="stylesheet" rel="Stylesheet" type="text/css" href="style.css">

And the following in my "Homepage.java":
import org.apache.wicket.markup.html.WebMarkupContainer;
...
add(new WebMarkupContainer("stylesheet"));

Liferay searches the "style.css" in "http://localhost:8080/user/joebloggs/style.css". And, of course, Liferay can't find the "style.css" there and throws the follwing error if I try to open that link directly:
The requested resource was not found.
http://localhost:8080/user/joebloggs/style22.css


If I put the style information directly into my "Homepage.html"-head, everything works fine.

Any idea or hint what might not work or what I did wrong?

Thank you very much,
Michael
thumbnail
15年前 に Rob Sonke によって更新されました。

RE: Portlets with Wicket in Liferay

Expert 投稿: 275 参加年月日: 07/08/26 最新の投稿
I'm not completely sure but I think that's part of the problems we had too (serving resources is quite identical to ajax stuff). Have some patience and try the new wicket patch (including new changes from Thijs) with liferay 5.2, that will solve the problem.
15年前 に Sauli Ketola によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 17 参加年月日: 08/05/14 最新の投稿
I'm still having problems with resource requests. I'm now using wicket-1.4-rc2 with Liferay 5.2.1.
I understood that wicket-1.4-rc2 contains the portlet 2.0 support. But is the liferay part http://issues.liferay.com/browse/LEP-6519 fixed really in 5.2.1 or just in 5.1.4 branch?
15年前 に Thijs Vonk によって更新されました。

RE: Portlets with Wicket in Liferay

Junior Member 投稿: 31 参加年月日: 07/09/09 最新の投稿
This is an issue with Liferay (see http://issues.liferay.com/browse/LPS-1911)
You can probably fix it by making sure that portlet-name (in portlet.xml) and the wicketfilter mapping url-pattern are identical (portlet.xml & web.xml)
15年前 に Sauli Ketola によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 17 参加年月日: 08/05/14 最新の投稿
Thijs Vonk:
This is an issue with Liferay (see http://issues.liferay.com/browse/LPS-1911)
You can probably fix it by making sure that portlet-name (in portlet.xml) and the wicketfilter mapping url-pattern are identical (portlet.xml & web.xml)


Thanks, but tried that and it gave me error: "The requested resource (/wicket-examples-1.4-rc2/linkomatic/invoke) is not available" on the portlet.
Then I tried to also switch the servlet-mapping to be identical but that resulted in an endless loop in the server.

But it seems based on that jira issue that someone has got liferay 5.2 and wicket to work. The servlet configuration isn't visible in that but it would be nice to know how it was done. (I sent an email to Ivan Cheung, lets hope he could shed some light on this)
15年前 に Thijs Vonk によって更新されました。

RE: Portlets with Wicket in Liferay

Junior Member 投稿: 31 参加年月日: 07/09/09 最新の投稿
I am running wicket portlets in a Liferay 5.2.1 portal. So it does work

Are you using liferay-portlet.xml and liferay-plugin-package.xml files?
* Try if it works when you delete those.

Maybe the problem is with the bundled examples (multiple wicket applications in one configuration)
* Try running a separate portlet (not the full portlet examples)
(use a wicket-qiuckstart and add a portlet.xml to it)
15年前 に Sauli Ketola によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 17 参加年月日: 08/05/14 最新の投稿
Thijs Vonk:
I am running wicket portlets in a Liferay 5.2.1 portal.


What server are you running under liferay (I've tried the tomcat 6 and 5.5 bundles)? Also I would appreciate if you could paste your configurations here. Especially the servlet configuration as that was also missing from the jira example.
15年前 に Thijs Vonk によって更新されました。

RE: Portlets with Wicket in Liferay

Junior Member 投稿: 31 参加年月日: 07/09/09 最新の投稿
tomcat 6 bundle
These are my web.xml and portlet.xml files

No servlet configuration
15年前 に Sauli Ketola によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 17 参加年月日: 08/05/14 最新の投稿
Thijs Vonk:
tomcat 6 bundle
These are my web.xml and portlet.xml files
No servlet configuration

Thanks a million, now I got it working!
The problem was that in addition to the portlet name modification I had to change the filter mapping from

<filter-mapping>	
<filter-name>CaptchaApplication</filter-name>	
<url-pattern>/captcha/*</url-pattern>	
<dispatcher>REQUEST</dispatcher>	
<dispatcher>INCLUDE</dispatcher>	
</filter-mapping>

to

<filter-mapping>	
<filter-name>CaptchaApplication</filter-name>	
<url-pattern>/captcha/*</url-pattern>	
<dispatcher>REQUEST</dispatcher>	
<dispatcher>INCLUDE</dispatcher>	
<dispatcher>FORWARD</dispatcher>	
</filter-mapping>
thumbnail
12年前 に Fuad Efendi によって更新されました。

RE: Portlets with Wicket in Liferay

Regular Member 投稿: 180 参加年月日: 07/04/05 最新の投稿
Rob Sonke:
Small but promising note. A colleague of mine (Thijs) has made a breakthrough with the current trunk (almost 5.2) from liferay and wicket 1.4 with the portlet patch. He was able to let the ajax stuff work!

Next week, we'll try to upgrade to 5.2 and share our experiences here.



Hi Rob,


Any chance to get Wicket 1.4.17 working with Liferay 6.1.x (trunk)? Liferay 6.1 introduced liferay-web.xml and something else; I am still tying to locate the problem (it seems Wicket's internal "redirect" never gets called)

Thanks,
Fuad
thumbnail
12年前 に Fuad Efendi によって更新されました。

RE: Portlets with Wicket in Liferay

Regular Member 投稿: 180 参加年月日: 07/04/05 最新の投稿
Fuad Efendi:
Rob Sonke:
Small but promising note. A colleague of mine (Thijs) has made a breakthrough with the current trunk (almost 5.2) from liferay and wicket 1.4 with the portlet patch. He was able to let the ajax stuff work!

Next week, we'll try to upgrade to 5.2 and share our experiences here.



Hi Rob,


Any chance to get Wicket 1.4.17 working with Liferay 6.1.x (trunk)? Liferay 6.1 introduced liferay-web.xml and something else; I am still tying to locate the problem (it seems Wicket's internal "redirect" never gets called)

Thanks,
Fuad



I found a fix for recent trunk version, Liferay Portal 6.1.0 / 6.1.x
(version 6.0.6 and 6.0.x all have memory leaks issues)
http://issues.liferay.com/browse/LPS-17526

It works absolutely fine with modified trunk version and modified Apache Wicket 1.4.17

---
Fuad Efendi
http://www.tokenizer.ca
thumbnail
8年前 に Konstantinos Karavitis によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 3 参加年月日: 14/10/17 最新の投稿
Apache wicket 7.3.0-SNAPSHOT supports portlets in liferay 6.1 and liferay 6.2.
You can download the wicket portlet examples project from here
https://github.com/kkaravitis/core/tree/master/portlet-parent/wicketstuff-portlet-examples
thumbnail
8年前 に Fuad Efendi によって更新されました。

RE: Portlets with Wicket in Liferay

Regular Member 投稿: 180 参加年月日: 07/04/05 最新の投稿
Konstantinos Karavitis:
Apache wicket 7.3.0-SNAPSHOT supports portlets in liferay 6.1 and liferay 6.2.
You can download the wicket portlet examples project from here
https://github.com/kkaravitis/core/tree/master/portlet-parent/wicketstuff-portlet-examples



This is really great, thank you!!!
thumbnail
8年前 に Konstantinos Karavitis によって更新されました。

RE: Portlets with Wicket in Liferay

New Member 投稿: 3 参加年月日: 14/10/17 最新の投稿
Thank you too!

I made this fix today in wicketstuff
https://github.com/wicketstuff/core/issues/482

So if you want to test again please get the latest snapshot of wicketstuff core project.