Work is currently underway on a plugin for Eclipse which will allow easy creation of portlet projects. see this forum for details: http://www.jboss.com/index.html?module=bb&op=viewforum&f=239
I develop big portlet applications as JSF web application. This is very easy with eclipse and it's tomcat plugin. Then I deploy this webapp as portlet into jboss portal. The advantage is, that your portlet can run as web app. The disadvantage is, that you can't use all features of JSR 168 like different portlet modes and such stuff.
Small portlets I develop usually as JSR 168 compatible portlets also using eclipse with an ant buildfile that deploys the portlet app to jboss portal.
please gruenewa, if you have information about building portlets with JSF please post ;)
So if you have a running MyFaces web application you should simply add a 'portlet.xml' to the WEB-INF folder. This should specify the correct portlet-class: MyFacesGenericPortlet
<?xml version="1.0" encoding="UTF-8"?> <portlet-app id="librarian" version="1.0"> <portlet> <portlet-name>LibrarianPortlet</portlet-name> <display-name>Librarian Portlet</display-name> <description>Librarian Portlet</description> <portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class> <expiration-cache>-1</expiration-cache> <init-param> <name>default-view</name> <value>/welcome.jsp</value> </init-param> <supports> <mime-type>text/html</mime-type> <portlet-mode>VIEW</portlet-mode> </supports> <supported-locale>en</supported-locale> <resource-bundle>portlet-info</resource-bundle> <portlet-info> <title>Librarian Portlet</title> <short-title>Librarian</short-title> <keywords>JSF, Portlet</keywords> </portlet-info> </portlet> </portlet-app>
To deploy the app in JBossPortal you have also to add the JBossPortal deployment descriptors 'jboss-app.xml','jboss-portlet.xml' to the WEB-INF folder, as if you would do it when writing a normal portlet.
This way you can run your app as simple web application (very useful during application development) or as portlet.
In addition to JSF, you can also use Tapestry 4.0 to effectively build portlets. This provides the same benefits as JSF, in terms of deploying a project both as a web application and as a portlet.
One benefit of Tapestry is its non-JSP view structure. This can also be achieved with JSF by using Facelets (a project at java.net). I also find Tapestry error-handling to be very precise, as well as HTML view templates that can be designed using most web designer tools.
Both JSF and Tapestry are viable portlet development frameworks.
I am a little confused by the term 'portlet framework'. I am a newbie to portlet and I beg to be excused for my naivette.
In order to build Portlets, are we talking of a Framework (for example, Struts or Webwork). I associate with these Frameworks especially because i have worked with them in the past.
Now are we talking of some other Framework exclusively to build Portlets? Or is it that I can develop Portlets using Struts or Webwork as well.
Please explain. I am very grateful to the wise persons here who kindle some interest in me.
what is the best IDE to develop portlets?
I use Eclipse, (run packaging with Jboss IDE Eclipse)
Pray, could you explain how you use Eclipse to develop portlets. I am very curious and interested to know.
(pardon for my English, I'm Spanish)
Yes, I use Eclipse Ide to develop my portlets.
These are my steps:
1 - I create a new project. (I will base on the portlet HellowPortlet example http://labs.jboss.com/portal/index.html?ctrl:id=page.default.downloads&project=portletswap&category=.portlets.samples )
2 - I create this directory structure in Eclipse:
3- Next, mount all libraries (lib directory)
4- Next, press "build path -> use as source folder"
in the "src" folder .
5- Next, in the properties of the proyect, enable the "pakaging configurations"
6- Add this structure to pakaging configuration:
7- Start Jboss server with Eclipse Ide (debug mode)
8- Select the root directoy of the proyect and press run pakaging
9- Select helloworldportlet.ear and press deployment->depoly to and select the jboss server session started.
10- we finish, very easy http://localhost:8080/portal
If there is some problem tell it to me.
masternet, exelente explicacion,
if you could add the same explanaition with jsf it will be very usefull. also ajax :P