J4Fry and Portlets

19 views
Skip to first unread message

Gan...@j4fry.org

unread,
Feb 3, 2009, 3:01:13 AM2/3/09
to j4fry
This thread was moved from our old sourceforge forum:

Hi, is it possible to use the J4Fry Ajax Solution in JSR168 Portlets?

Thanks
Jörg


RE: J4Fry and Portlets
By: ganesh (ganeshpuriProject Admin) - 2008-06-26 06:24
Hi Joerg,

Yes, the AJAX tag is designed to run in portlet containers
though I have to admit that we have limited experience using it there.
If you do make a try, it would be helpful if you told us how well it
worked. I will be happy to try and reproduce problems you encounter
with this combination and I will assist you in solving them.

Regards,
Ganesh

RE: J4Fry and Portlets
By: Joerg Schaefer (joergschaefer) - 2008-06-26 11:38
Hello Ganesh,
i've tried it in a lifery portlet, but if the portlet is loading
the following error comes up.

java.lang.NullPointerException
at org.j4fry.jsf.listener.ResourcePhaseListener.beforePhase
(ResourcePhaseListener.java:50)
at
org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore
(PhaseListenerManager.java:73)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase
(LifecycleImpl.java:85)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute
(LifecycleImpl.java:70)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.processAction
(MyFacesGenericPortlet.java:246)
at
com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter
(FilterChainImpl.java:93)
at com.liferay.portal.kernel.servlet.PortletServlet.service
(PortletServlet.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke
(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude
(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include
(ApplicationDispatcher.java:472)
at com.liferay.portlet.InvokerPortlet.invoke(InvokerPortlet.java:
550)
at com.liferay.portlet.InvokerPortlet.processAction
(InvokerPortlet.java:310)
at com.liferay.portal.action.LayoutAction.processPortletRequest
(LayoutAction.java:589)
at com.liferay.portal.action.LayoutAction.processLayout
(LayoutAction.java:386)
at com.liferay.portal.action.LayoutAction.execute
(LayoutAction.java:186)
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:163)
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:409)
at com.liferay.portal.servlet.MainServlet.service
(MainServlet.java:638)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter
(BaseFilter.java:98)
at
com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter
(VirtualHostFilter.java:149)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter
(BaseFilter.java:98)
at
com.liferay.portal.servlet.filters.sessionid.SessionIdFilter.doFilter
(SessionIdFilter.java:81)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke
(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest
(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward
(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward
(ApplicationDispatcher.java:302)
at com.liferay.portal.servlet.FriendlyURLServlet.service
(FriendlyURLServlet.java:138)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter
(BaseFilter.java:98)
at com.liferay.portal.servlet.filters.strip.StripFilter.doFilter
(StripFilter.java:91)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter
(BaseFilter.java:98)
at
com.liferay.portal.servlet.filters.compression.CompressionFilter.doFilter
(CompressionFilter.java:111)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter
(BaseFilter.java:98)
at
com.liferay.portal.servlet.filters.secure.SecureFilter.doFilter
(SecureFilter.java:205)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter
(BaseFilter.java:98)
at
com.liferay.portal.servlet.filters.doubleclick.DoubleClickFilter.doFilter
(DoubleClickFilter.java:134)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter
(BaseFilter.java:98)
at
com.liferay.portal.servlet.filters.layoutcache.LayoutCacheFilter.doFilter
(LayoutCacheFilter.java:191)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter
(BaseFilter.java:98)
at
com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.doFilter
(AutoLoginFilter.java:142)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter
(BaseFilter.java:98)
at
com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter
(VirtualHostFilter.java:173)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter
(BaseFilter.java:98)
at
com.liferay.portal.servlet.filters.sessionid.SessionIdFilter.doFilter
(SessionIdFilter.java:81)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run
(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)

Can you fix this bug???

Regards,
Joerg

RE: J4Fry and Portlets
By: ganesh (ganeshpuriProject Admin) - 2008-06-30 19:30
Hi Jörg,

I've downloaded and started Liferay (Bundled with
tomcat6). Now how do I add JSF capabilities and which is your example
application?

Regards,
Ganesh

RE: J4Fry and Portlets
By: Joerg Schaefer (joergschaefer) - 2008-07-04 09:41
Hi Ganesh,
that sounds great. I'm very happy, if the J4Fry Ajax Compontents
work with Liferay.
I've tested many other component-libraries (ICEFaces, RichFaces,
Trinidad), but all i need is exactly a little library like J4Fry Ajax
Components. Not more.
Ganesh, i found also a library named jsf-extensions on
https://jsf-extensions.dev.java.net/. At first sight, i think the
functionality is similar to J4Fry. Isn't it?

Thanks,
Jörg

RE: J4Fry and Portlets
By: Joerg Schaefer (joergschaefer) - 2008-07-02 17:13
Hi Ganesh,
i will send you an example portlet to Gan...@j4fry.org. I hope
that is ok?
So you have to put the .war-file into the Liferay deploy-folder.
Liferay deploys them automatically.
After that you can place the portlet on a Portal Site with the
portal function "add application". (Category sample -> J4Fry)
My sample application is very simple.
I have only two controls. One input-field and one command-
button.
I have only inserted the taglib description and then the error
above occurs.

Ganesh if you want to debug the portlet, there a few steps to
do.
1. download the liferay SDK. With this SDK you can develop
portlets and themes for liferay
2. you must configure your IDE to start Liferay in debug mode.
(I use MyEclipse).

So, i think for the fist step it is sufficiant to test with the
sample portlet, which i send to you.

Regards,
Jörg



Portlet example
By: ganesh (ganeshpuriProject Admin) - 2008-07-04 04:50
Hi Jörg,

Thank you for sending the example. It's running fine after
I've removed a minor bug in the J4FryResourcePhaseListener. Still
adding AJAX to the input field doesn' t work, but I will fix this over
the weekend. We're about to release j4fry-components-1.2_02 and I will
try get the fixes into the release.

Regards,
Ganesh

Fixes for Portlet example
By: ganesh (ganeshpuriProject Admin) - 2008-07-07 19:52
Hi Jörg,

Here http://www.j4fry.org/resources/J4Fry-portlet.war is a
new version of the J4Fry Portlet with a small working AJAX feature. It
needs some fixes in the j4fry-components.jar, so I'm including the
release candidate 3 version of 1.2_02. The resources need to be in a
separate folder for portlets because they cannot be delivered from the
classpath. The web.xml has got a (yet) undocumented context-param
org.j4fry.RESOURCE_PATH to enable acces to the J4Fry resources. Please
try it out and tell me if it works for you too. I'm testing on a
Tomcat 6 Liferay bundle.

Regards,
Ganesh

RE: J4Fry and Portlets
By: Joerg Schaefer (joergschaefer) - 2008-07-10 06:54
Hi Ganesh,
the example doesn't work (i can't deploy it). If i try to deploy
the current war-file i get the following error:

10.07.2008 08:43:14 org.apache.catalina.core.StandardContext
start
SCHWERWIEGEND: Error listenerStart
10.07.2008 08:43:14 org.apache.catalina.core.StandardContext
start
SCHWERWIEGEND: Context [/J4Fry-portlet] startup failed due to
previous errors

I have deployed the previous release with the rc3 version of
j4fry-components.jar successfully. But if i insert something into the
textfield i get a javascript errormessage.

Ganesh if you deploy a new version of the portlet please delete
the old one first.

Regards,
Jörg

Corrected AJAX Example
By: ganesh (ganeshpuriProject Admin) - 2008-07-13 16:21
Hi Jörg,

Sorry for sending an example that doesn't work. I rezipped
the unpacked war from liferays webapps folder and didn't realize that
liferay manipulates its contents while deploying ...

In your example there where broken versions of json and
ezmorph, probably this is still your problem. I've packed the AJAX
example again and put it for download at http://j4fry.org/resources/J4Fry_portlet.war.
This time it's been tested on an freshly installed liferay-portal-
tomcat-6.0-5.0.1. Your example has been changed in the following
places:
The view.jsp has got a little AJAX feature: Just try
typing some text in the text field.
The web.xml has got a new context-param.
There is a new folder J4Fry_resources.
The libraries ezmorph and json have been replaced by non-
corrupt versions.
Finally, the j4fry-components is in 1.2_02 final now.

I used auto-deployment through the liferay -> deploy
folder, but I still needed to restart liferay to make the portlet
available.

Regards,
Ganesh

RE: J4Fry and Portlets
By: Joerg Schaefer (joergschaefer) - 2008-07-14 06:32
Hi Ganesh,
hm... the problem still occurs.
I have also installed a new, fresh version of the liferay tomcat
bundle.
Ok, the deployment of the portlet was successfully.
But if i place the portlet on a portal-site and then insert a
letter into the textfield a javascript-error came up.
I will send you a screenshot to your mail account.

regards,
Jörg



Searching for the bug
By: ganesh (ganeshpuriProject Admin) - 2008-07-14 19:21
Hi,

1. Do you see any exception on your console log?

2. From the line of the exception in your screenshot it is
possible that you are running an older version of the script. Did you
maybe deploy an earlier version before? On my machine liferay
sometimes didn't clean up correctly. Could you send me a zip of your
webapps/J4Fry_portlet folder to compare with mine?

3. Which is the exact version of liferay you are using?
Mine is liferay-portal-tomcat-6.0-5.0.1.

Regards,
Ganesh

RE: J4Fry and Portlets
By: Joerg Schaefer (joergschaefer) - 2008-07-15 14:36
Hi Ganesh,
no there are no exceptions in the logfiles.
I've tested the example portlet with a new liferay installation.
There were no deployments before.
I will send you the deployed folder from my webapp folder.
I'm using the the following bundle: liferay-portal-
tomcat-6.0-5.0.1

Thanks

Jörg

Still Searching ...
By: ganesh (ganeshpuriProject Admin) - 2008-07-15 18:51
Hi,

If I exchange my J4Fry_portlet folder against yours, clean
temp and restart, everythings still works fine. How do you start
Liferay? Is it running in an IDE? Maybe you can try starting with
startup.bat? Which Java are you using? I've got JAVA_HOME=C:\Programme
\Java\jdk1.6.0. I've tested on FF2 and IE6, which Browser do you use?

Regards,
Ganesh

helpless ...
By: Joerg Schaefer (joergschaefer) - 2008-07-16 07:42
Hi Ganesh,
that is really confusing.
I did all the things you have mentioned.
- I have installed a new downloaded version of liferay. (liferay-
portal-tomcat-6.0-5.0.1)
- I'm starting the portal with startup.bat
- I'm using jdk1.5.0_12.
- Firefox 2.0.0.15
- IE 6.0.29

After deploying the portlet i have cleaned up the tomcat work
and temp directory, also the browser cache.

But the error still occurs.
I will send you the exactly two javascript errors, which came up
after inserting a letter into the input field.
The two javascript errors occurs every time, if i insert a
letter into the input field.

Jörg



RE: helpless ...
By: ganesh (ganeshpuriProject Admin) - 2008-07-16 17:23
Hi,

Yes, it is. We must be close to the solution ...
Please send me the output of >set from your DOS shell.
You're running XP?
Please send me the the complete log of liferay from start
to the occurance of the problem.
Which folder is liferay installed to?

Regards,
Ganesh

RE: J4Fry and Portlets
By: Joerg Schaefer (joergschaefer) - 2008-07-17 08:08
Hi,
i make a test on our production enviroment, a windows 2003
server. And it works there (same liferay bundle 5.0.1 and jdk1.5).
But on my development enviroment it doesn't work.
Yes i have windows XP.
I have installed liferay on C:\liferay-portal-tomcat-6.0-5.0.1
I send you the output of set and the logs to your mail account.

Thanks,
Jörg




now it should work
By: ganesh (ganeshpuriProject Admin) - 2008-07-20 09:05
Hi Jörg,

The console log with the AJAX log showed me the problem:
there was a confusion with JSON sending the AJAX fields in a different
order. I've uploaded a new http://j4fry.org/resources/J4Fry_portlet.war
that contains a j4fry-components-1.2_03 beta3 and a new J4fry-resouces/
j4fry_async.fry. They should do the trick on your development
machine.

Regards,
Ganesh

RE: J4Fry and Portlets
By: Joerg Schaefer (joergschaefer) - 2008-07-20 12:16
Hello Ganesh,
thanks, but i can not unzip the war-file!!!

regards

Jörg

RE: J4Fry and Portlets
By: ganesh (ganeshpuriProject Admin) - 2008-07-21 06:06
Hi,

I posted the wrong URL. The correct one is:
http://www.j4fry.org/resources/J4Fry-portlet.war

Regards,
Ganesh

RE: J4Fry and Portlets
By: Joerg Schaefer (joergschaefer) - 2008-07-21 16:30
Hi Ganesh,
thank you very much. For this configuration it works.
So i've tried to use it in a portlet with JSF1.2 RI and
Facelets.
It doesn't work. I've looked at the generated HTML-source and i
think i found the problem:
There is no resolution for the <fry:ajax/>-Tag.
The generate HTML-Source contains the <fry:ajax/>-Tag and
nothing like <script... and so on.
Have you any ideas?

Jörg

J4Fry, JSF 1.2, Facelets and Portlets
By: ganesh (ganeshpuriProject Admin) - 2008-07-21 19:19
Hi,

Wow, this is great news! We have got running applications
with 1.2 + Facelets, so getting it started together with Portlets
should be no big deal.

Did you define the HTML namespace for J4fry? Should be
similar to:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:fry="http://j4fry.org/jsf">

If this doesn't help: Can you please prepare a second
portlet with the described 1.2/Facelets configuration, so I have the
same base as you to start with?

Regards,
Ganesh

RE: J4Fry and Portlets
By: Joerg Schaefer (joergschaefer) - 2008-07-23 15:02
Hi Ganesh,
after testing many hours i found the problem.
I exchanged the jsf-facelets.jar with the facelets version
1.1.14. And it works.
Now i develop a pageable table with JSF and J4FryAjax and the
paging is done with ajax.
But everytime i start the application, the first request isn't
an ajax request.
If i press the button a second one (and all following times), it
works.

Regards Jörg


AJAX paging button
By: ganesh (ganeshpuriProject Admin) - 2008-07-24 05:24
Hi,

Good to hear that the Facelets/Portlet combination works
now.
Please post the paging example so I can try and reprdoce
the problem.

Regards,
Ganesh
Reply all
Reply to author
Forward
0 new messages