Hi i am completely new to portlets and portals. I have had a brief(very brief) look at the jsr for portlets, installed liferay played around with its default portlets and set myself up an eclipse working environment in the hope of developing my own little portlet module.
I have to create a portal similar to igoogle, and the tabs system in chrome I am not 开发者_开发知识库sure where to start with and I am reasonably comfortable with Java and have done some other J2EE apps, but dont really know how everything fits together in portal/portlet architecture (what files where etc) so any assistance you guys could lend would be greatly appreciated.You will first need to decide which technologies to use for the portlet.
The portlet specification assume usage of vanilla JSP / Servlet. You can however use other frameworks such as JSF, Struts, Spring, etc. using the corresponding "glue". There are examples for the various technologies in the sample portlets.
For JSF, this glue is the JSR-301 Portlet Bridge for JSF, then you can use other JSF component suites.
I'm currently working on a portlet for Liferay based on JSF and RichFaces, and that seems to works more or less. No major glitches so far.
I don't know if the other component suites are well supported in Liferay portlet environment. Also, I don't think JSF 2.0 and Portlet spec 2.0 are mature enough. So we decided to stick to JSF 1.x and Portlet 1.0.
If you're committed to Liferay, the place to start is the Liferay SDK. They recently released a set of Eclipse plugins (Liferay IDE) which seem to automate much of the packaging for their toolkits (still ANT based - no good Maven resources that I'm aware of - current work has been proposed, but still seems broken/incomplete)
For some samples of portlets you can look at: https://lportal.svn.sourceforge.net/svnroot/lportal/plugins/trunk
I would warn you, Liferay portlets != JSR-168/286 - they have some extensions, and conventions beyond what's in the spec, and some of the platform's handlings default to different values than you might expect (e.g. preferences are shared across multiple users by default). Having said that, the same is true of most/all portlet containers.
I guess you have come across Liferay Portal Server as an open source free portal server to start experimenting with the portlet stuff.
As of working with portlets, the latest version of the portlets spec is JSR 286 (v2.0). As such, all the portlets which are created using Struts, Spring, JSF, basic portlets would follow this specification as the underlying principle. The new specification provides new features (public render parameters, events for inter-portlet communication) and new portlet lifecycles phases (resource, event) and other functionality than what was provided with portlets based on JSR 168.
However the following are to be observed for the relevant framework:
Struts does support JSR 168 portlets (v1.0) and not JSR 286 as of today. This is accomplished using the Struts portlet bridge.
JSF provides support for both JSR 168 and 286 and this is also accomplished using the JSF Portlet bridge (http://jcp.org/en/jsr/detail?id=301).
Spring portlet framework is based on the spring framework. They are pretty easy to work with. If in case, you have experience with Spring framework already then this one would be very easy to follow and start with. The latest version in Spring is v3.1. This support JSR 286 and backward compatible.
Most of the features that work are basically covered by the frameworks/bridges except for few which are Portal server configuration dependant. For the features that work based on the Portal Server( e.g. Liferay, WebSphere Portal, etc.) you would need to go the server documentation in order to see what needs to be declared in portlet.xml and other configuration files as would be mentioned by and for the server.
I would also recommend the book "Portlets In Action" by Ashish Sarin which explains things from the ground up.
All the best.
精彩评论