Saturday, December 09, 2006

Tomahawk Bridge 0.9 released

Tomahawk Bridge 0.9 was released! It supports Tomahawk 1.1.3 on any portal servers. Using this portlet filter with Faces Resonse Filter, you can use Upload component and some components that uses JavaScript and CSS.

MyFaces Bridge was deprecated by this release!

To use Tomahawk Bridge:
1) Add faces-response-filter-0.1.jar, portals-bridges-portletfilter-1.0.jar, tomahawk-bridge-0.9.jar, commons-fileupload-1.1.jar and commons-io-1.1.jar to /WEB-INF/lib
2) Modify portlet.xml

For example, if you use the following portlet.xml,

<portlet-app id="vfs-portlets" version="1.0">
<portlet id="VFSNavigator">
<description>VFS Navigator</description>
<portlet-name>VFSNavigator</portlet-name>
<display-name>VFS Navigator</display-name>
<portlet-class>
jp.sf.pal.vfs.portlets.VFSPortlet
</portlet-class>
<init-param>
<name>view-page</name>
<value>/jsp/ListView.jsp</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>VFS Navigator</title>
<short-title>VFS</short-title>
</portlet-info>
</portlet>
</portlet-app>

change it to:

<portlet-app id="vfs-portlets" version="1.0">
<portlet id="VFSNavigator">
<description>VFS Navigator</description>
<portlet-name>VFSNavigator</portlet-name>
<display-name>VFS Navigator</display-name>
<portlet-class>org.apache.portals.bridges.portletfilter.FilterPortlet</portlet-class>
<init-param>
<name>portlet-class</name>
<value>jp.sf.pal.vfs.portlets.VFSPortlet</value>
</init-param>
<init-param>
<name>portlet-filters</name>
<value>jp.sf.pal.facesresponse.FacesResponseFilter,jp.sf.pal.tomahawk.filter.ExtensionsPortletFilter</value>
</init-param>
<init-param>
<name>view-page</name>
<value>/jsp/ListView.jsp</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>VFS Navigator</title>
<short-title>VFS</short-title>
</portlet-info>
</portlet>
</portlet-app>

Note: you need to set "server" as javax.faces.STATE_SAVING_METHOD in web.xml. Currently, "client" is not supported.

For Portals Portlet Filter, please see Apache Portals Bridges.

Tohamawk Bridge depends on Faces Response Filter. Faces Response Filter provides a feature to rewrite JSF resonse. So, if you create a new other filter, such as Ajax4JSF filter, I think that you can use both Tomahawk and Ajax4JSF components.

Thanks!

25 Comments:

Anonymous Anonymous said...

Are these jar files posted in a Maven repository somewhere?

Thanks for the great work.

6:21 AM  
Anonymous shinsuke said...

I put them to http://pal.sourceforge.jp/maven/ and http://pal.sourceforge.jp/maven2/ . If you need more jar files, please let me know.

12:21 PM  
Anonymous Jim said...

Thanks for the maven post, it makes it a lot easier to build.

I noticed a CVS update that mentions a BufferedResponseStream problem. I am getting this every other call now that I am using these filters. Do you know the cause of this?

Thanks,

Jim

12:02 AM  
Anonymous shinsuke said...

Could you provide more infoļ¼Ÿ

11:27 AM  
Anonymous Jim said...

I need to do some more research before you waste any time since it is happening in one environment and not the other and they are almost identical.

My basic setup is the following:

JDK 1.5
JBoss 4.0.5.GA
MyFaces, Tomahawk
Facelets

3:31 AM  
Anonymous Jim said...

Did some more research on the BufferedResponseStream problem. It looks like it might be due to the Myfaces or Tomahawk snapshot that is used. That was the only difference between my two environments.

The one that is working pulled the snapshot in August while the one that did not work got the snapshot in December. Other than that all other jar files and versions are the same.

I am not sure why I am referring to the snapshots at this point so I will change to the latest production releases and see what happens.

10:01 AM  
Anonymous shinsuke said...

Thank you for the investigation. I have no problem on Teeda and Tomahawk snapshot environment. So, I think that it may be myfaces core issue. I'll check it after a new production release of myfaces core.

10:12 AM  
Anonymous Anonymous said...

I might missunderstand. The Tomahawk bridge should allow me to use Tomahawk components in a portal?

My environment JBoss4.0.5GA, JBoss Portal 2.4, MyFaces 1.1.4, Tomahawk 1.1.3, Seam 1.1.0 GA.


I get a NullPointerException:

02:14:20,343 INFO [STDOUT] 02:14:20,343 ERROR [[/testNavigation]] Exception in FacesServlet
java.lang.NullPointerException
at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:392)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:265)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:133)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:306)

I have in my portlet.xml:

portlet-class:
org.apache.portals.bridges.portletfilter.FilterPortlet

portlet-class as init-param
org.apache.myfaces.portlet.MyFacesGenericPortlet
portlet-filters as init-param:
jp.sf.pal.facesresponse.FacesResponseFilter,jp.sf.pal.tomahawk.filter.ExtensionsPortletFilter

and finally I set:

javax.faces.STATE_SAVING_METHOD to server
in my web.xml

Please help.

12:34 AM  
Anonymous shinsuke said...

Please check if there is FacesResponseFilter and TomahawkFilter in the stack trace.

6:53 AM  
Blogger NAG said...

Thank you for your nice work on this bridge. May I ask if there is documentation on using it? The post on the blog is fine but we need more insight. See... we are developing a real commercial portal with JSF and it's been a pain so far. Is there an official site for this bridge? is it going to be part of apache or do you plan to commercialize it (I hope not the latter). We would appreciate JavaDoc and any other documentation on it as soon as possible. I would also be interested for the licence and the source code (if you intent to deliver it opensource.

Thanks again

4:56 AM  
Anonymous shinsuke said...

Thanks for using it. Currently, a document is only this blog. I'll put javadoc and the like to PAL's site later(since I have much tasks for opensource, I'm not sure when I can).. For the license, it's Apache license. I would like to move it to Apache in the future..

7:18 AM  
Anonymous Anonymous said...

Hi Shinsuke,

I tried using Tomahawk Bridge 0.9. All things are fine except t:inputCalander in popup mode. I remember, it was working with Myfaces Bridge 0.8. Is there any special configuration required for it to work.

I see the following error message in Forefox Error console.

Error: frm1_3Aic1CalendarVar is not defined
Source File: http://localhost:9898/c/portal/layout?p_l_id=PRI.15.2&p_p_id=86&p_p_action=1&p_p_state=normal&p_p_col_id=&p_p_col_pos=0&p_p_col_count=0&#p_TMSViewPortlet_WAR_tmsviewnew
Line: 1

Do you have any clue on what is wrong?

Thanks,

Raj

7:19 PM  
Blogger NAG said...

Can you please check something strange? for some reason the tomahawk bridge seams to run the MyFacesGenericPortlet but not the portlet class that we have declared in the portlet.xml. Some how our declared portlet class is skipped. We need to have our own doView and processAction. Thanks for looking into this

6:22 PM  
Anonymous shinsuke said...

For t:inputCalander, I have no time to check it right now.. So, I'll check it later..

For MyFacesGenericPortlet issue, tomahawk bridge is just a portlet filter. Please see http://portals.apache.org/bridges/multiproject/portals-bridges-portletfilter/index.html

10:47 PM  
Anonymous Anonymous said...

t:InputCalendar is working for me now. it seems I need to include htm and head tag in the jsp page. However, it is not required for normal portlets

Raj

10:18 PM  
Anonymous Anonymous said...

Hi,

I believe I'm having the same problem as Jim above...

I'm getting the error:

java.lang.IllegalStateException: BufferedResponseStream is null.
at jp.sf.pal.facesresponse.io.BufferedResponseStreamFactory.render(BufferedResponseStreamFactory.java:121)
at jp.sf.pal.facesresponse.FacesResponseFilter.renderFilter(FacesResponseFilter.java:78)
at org.apache.portals.bridges.portletfilter.PortletFilterChain.renderFilter(PortletFilterChain.java:114)
at org.apache.portals.bridges.portletfilter.FilterPortlet.render(FilterPortlet.java:141)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:94)


My setup:

JDK 1.5
Liferay 4.2.1
MyFaces 1.1.5
Tomahawk 1.1.3

You mentioned that you'd take a look at this when the new production release of myfaces core came out.

Do you have any idea what might be causing this, and how I can get around it.

Great work,

Dave

12:43 AM  
Blogger Martin Grotzke said...

Hi,

I'm just starting with portlets and try to get a simple CRUD demo running.

I use the tomahawk-bridge-0.9.1.jar and faces-response-filter-0.2.jar.

I can invoke the first default view, but when I select an item and invoke the "edit" action on the backing bean, there's a NoSuchMethodError:

Nested Exception is java.lang.NoSuchMethodError: org.apache.commons.fileupload.FileUploadBase.isMultipartContent(Lorg/apache/commons/fileupload/RequestContext;)Z
at org.apache.commons.fileupload.portlet.PortletFileUpload.isMultipartContent(PortletFileUpload.java:65)
at jp.sf.pal.tomahawk.filter.ExtensionsPortletFilter.processActionFilter(ExtensionsPortletFilter.java:249)
at org.apache.portals.bridges.portletfilter.PortletFilterChain.processActionFilter(PortletFilterChain.java:143)
at jp.sf.pal.facesresponse.FacesResponseFilter.processActionFilter(FacesResponseFilter.java:102)
at org.apache.portals.bridges.portletfilter.PortletFilterChain.processActionFilter(PortletFilterChain.java:143)
at org.apache.portals.bridges.portletfilter.FilterPortlet.processAction(FilterPortlet.java:132)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

The portlet.xml is the following:
<portlet-app id="manage-persons-portlet" version="1.0">
<portlet id="hello_jsf_portlet">
<description>Person Manager (Description)</description>
<portlet-name>hello_jsf_portlet</portlet-name>
<display-name>Person Manager</display-name>
<expiration-cache>0</expiration-cache>
<portlet-class>org.apache.portals.bridges.portletfilter.FilterPortlet</portlet-class>
<init-param>
<name>portlet-class</name>
<value>org.apache.myfaces.portlet.MyFacesGenericPortlet</value>
</init-param>
<init-param>
<name>portlet-filters</name>
<value>jp.sf.pal.facesresponse.FacesResponseFilter,jp.sf.pal.tomahawk.filter.ExtensionsPortletFilter</value>
</init-param>
<init-param>
<name>default-view</name>
<value>/persons/listing_dataTable.jsf</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>Person Manager Info Title</title>
<short-title>Person Manager (short title)</short-title>
</portlet-info>
</portlet>
</portlet-app>

The portlet servlet in the web.xml is configured like this:
<servlet>
<servlet-name>hello_jsf_portlet</servlet-name>
<servlet-class>com.liferay.portal.servlet.PortletServlet</servlet-class>
<init-param>
<param-name>portlet-class</param-name>
<param-value>org.apache.portals.bridges.portletfilter.FilterPortlet</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>

Btw: commons-fileupload is 1.1.

Is this a problem with my configuration, or anything else? Is this the correct place to ask, or is the problem not related to pal?

If you need more information, please let me know!

Thanx a lot in advance,
cheers,
Martin

4:11 PM  
Blogger Shinsuke said...

I think that it's your commons-fileupload issue, such as a wrong version,...

12:31 AM  
Blogger Martin Grotzke said...

Too obvious :) I tried both commons-fileupload 1.1 and 1.2 and with both got the error - but I didn't look what's in WEB-INF/lib of the finally deployed and unpacked war: there was still a commons-fileupload-1.0.jar...

Btw: when is it planned to support myfaces 1.1.5? (I also ran into the problem with "BufferedResponseStream is null")

Thanx && cheers,
Martin

5:40 AM  
Blogger Alexander said...

I'm to in the need of MyFaces 1.1.5, the main reason being bugs in commandButtons not hitting the managed bean when inside of other components, like columns, table rows, etc. This button bugs are not in 1.1.5 ... Is there any hope here or should I look for other frameworks?

Thanks in advance!

2:50 AM  
Blogger Stewart said...

Looking at the standard (non-portlet) Tomahawk Extensions Filter, there are 3 init-params. Can I set these in the portlet.xml along with the portlet-filters init-param?
Extract from web.xml:

<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>100m</param-value>
</init-param>
<init-param>
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
</init-param>
<init-param>
<param-name>uploadRepositoryPath</param-name>
<param-value>C:/temp</param-value>
</init-param>
</filter>

8:23 PM  
Anonymous shinsuke said...

Try the following in portlet.xml:
<init-param>
<name>jp.sf.pal.tomahawk.filter.ExtensionsPortletFilter:uploadRepositoryPath</name>
<value>C:/temp</value>
</init-param>

5:18 PM  
Anonymous Simone said...

I'm trying to use tomahawk in a portlet deployed on Jboss Portal Server, because I need to use tomahawk upload file components. It worked fine, but when I added the Ajax support, using ajax4Jsf library it deesn't work anymore. The UploadedFile object is always null. I think beacause the ajax filter intercept the request. Is there a way to make ajax4jsf and tomahawk live together in a portlet?

Thanks in advance,
Simone

6:30 PM  
Anonymous vroyer said...

Hi,
I'm trying to run the PAL cms-portlet in the pluto portlet-container. It works fine with tomcat 5.5 but I've got the following error when running in weblogic 10.0.

Nested Exception is java.lang.IllegalStateException: getWriter can't be used after getOutputStream was invoked.

Removing the FaceResponseFilter v0.2 solve the issue, but CCS+javascript is lost in the rendering of the face imputHTML component.

Any idea to solve this issue ?

7:14 PM  
Anonymous Xp startup problems said...

Most of the persons are unaware of finer details of how to correct slow PC startup and make it work at a good speed and in an efficient manner.

4:46 PM  

Post a Comment

<< Home