Showing posts with label portlet. Show all posts
Showing posts with label portlet. Show all posts

Tuesday, July 8, 2008

JBoss Portal 2.7 Alpha released

We have just released the alpha version of the upcoming of JBoss Portal 2.7 release that brings the Portlet 2.0 features to our mainstream product JBoss Portal.


The JBoss Portlet Container technology is included in this release and provides an out of the box support for the JSR 286 features such as:
  • Portlet eventing
  • Public pararemers
  • Resource serving
  • Portlet filters
Our admin  tool has been upgraded as well to support JSR 286.



Enjoy the release, you can get the files from the download page as usual!

Monday, July 7, 2008

JSF in a portlet has never been this easy!

We just released JBoss Portlet Bridge Beta3 along with some good supporting documentation and example projects. See the documentation for full details.

The majority of the code written for this release is internal to the portlet bridge project (refactoring, 301 spec updates and enhancements, bug fixes...). The next release (Beta 4 - early Sept) will be huge for the portlet bridge for the following reasons:
  • The EG is currently discussing a lot of significant clarifications and improvements. For example, working with the JSF 2.0 EG to allow certain needs and working on Portlet 2.0 areas of the spec.
  • There is currently a lot of discussion about navigation between portlet modes. Once this is nailed down in the spec, we will implement it.
  • The Portlet 1.0 version should be getting close to public review.
Other than the spec related reasons for release schedule, we must work in unison with the latest Seam and RichFaces relases, make sure that we squash any bugs concerning the 3 integration points, handle features/improvements/refactorings, and try to test and give feedback to the 301 EG. And, of course we can't forget about JBoss Portal 2.7+!

There are soo many cool things going on right now within the JBoss Portal project, I would like to tell you about all of them but then this post wouldn't be about JBPB anymore. Just stay tuned to this blog...

With that said, here are a few tips for JSF portlet developers that concern this release:
  • Namespacing
    In situations where you need to use the id of an element in your JSF/xhtml markup, you would normally see something like 'form1:myBtn' in the rendered markup. But now with the bridge namespacing you will see something similar to:

    jbpns_2fdefault_2fNews_2fStories_2fStoryTemplateWindow12snpbj:_viewRoot:form1:myBtn

    To overcome this, you can use the following expression in your Facelets page to prepend the namespace to your javascript code:

    document.getElementById('#{facesContext.externalContext.response.namespace}the_rest_of_JSF_ID

    since this uses the portletResponse, once you try to view this page on the servlet application side, you will get an exception. To avoid this, you need to check for the type of response in your backing bean and assign a new "safe" namespace variable for the UI.

  • Excluding Attributes from the Bridge Request Scope
    When your application uses request attributes on a per request basis and you do not want that particular attribute to be managed in the extended bridge request scope, you must use the following configuration in your faces-config.xml. Below you will see that any attribute namespaced as foo.bar or any attribute beginning with foo.baz(wildcard) will be excluded from the bridge request scope and only be used per that application's request.

    <application>
    <application-extension>
    <bridge:excluded-attributes>
    <bridge:excluded-attribute>foo.bar</bridge:excluded-attribute>
    <bridge:excluded-attribute>foo.baz.*</bridge:excluded-attribute>
    </bridge:excluded-attributes>
    </application-extension>
    </application>

    Or you can use the javax.portlet.faces.annotation.ExcludeFromManagedRequestScope annotation to accomplish the same thing.
For more information on this release or to find out more about the project, visit the project page.

Friday, June 13, 2008

JBoss Portlet Container 2.0 GA Release

The JBoss Portal team is very proud to announce the release of the JBoss Portlet Container 2.0 product.

The release is a fully compliant implementation of the Portlet 2 (JSR286) specification, which was released yesterday.

JBoss Portlet Container 2.0 comes with a lightweight portal based on JSP tags and comes bundled with a few demonstration portlets. The goal of that lightweight portal is to provide developers with an easy way to showcase and test their portlet applications. It should work well with other JSP taglibs and templating frameworks.

It provides advanced functionalities:
  • Administration application which provides an overview of the deployed applications / portlets / filters and management of their life cycle. Failed portlets or filters can be restarted or stopped when needed.
  • Event debugger which should prove very userful to understand complex event interactions.
  • Event flood detection to prevent events from running wild.
  • Management of life cycle dependencies between portlet filters and portlet container: if a portlet filter fails and is stopped then all the portlet containers dependent on that filter will also be stopped (otherwise it would obviously result in an incorrect application).
  • Optimized event payload marshalling: when an event with an object payload is fired from application A to application B, the event will be unmarshalled/marshalled between the two applications classloaders (otherwise it would result in a class cast exception) unless the event class is shared at the server level, in which case the event can be safely transported across application borders.


The next major release of our mainstream portal product JBoss Portal 2.7 will bundle the JBoss Portlet Container.

You can download the release from our project download page.

Tuesday, June 10, 2008

JBoss Portal @ Rotterdam JBug

The Rotterdam JBug is happening June 20th, Thomas and myself will be there to talk about Portlet 2.0 and the upcoming JBoss Portal 2.7 release. We'll give also a quick overview of the future releases.

The Benelux JBoss User Group is organizing an event on Friday June 20th 2008. There will be plenty of presentations:
  • JBoss Portal - Julien Viet and Thomas Heute - JBoss
  • Hibernate Search - Emmanuel Bernard - JBoss
  • Woman in IT - (special guest presentation) Clara Ko and Linda van der Pal - jduchess.org
  • JBoss Drools - Kris Verlaenen - JBoss
Here is more information, it's free of course but you need to register.

Sunday, June 1, 2008

Can the Servlet 3.0 improve the development of Portlets?

I recently looked at the Java 3.0 API slides for JavaOne in order to catch up with what the expert group will provide in the next release of the spec. As a portlet container architect it is important to provide feedback to the expert group.

One of the challenge of developping and maintaining a portlet container is the capability to detect deployment of portlets and create associated portlet containers. Portlet are plain java classes in a war file, the main problem is to have the portlet container to be aware of the war file deployment life cycle in order to create / destroy the associated containers.

Another challenge is to have the capability to request dispatch to a war file from another a serviced request. This can only be done if a special servlet is added to the portlet application war file. So when a portlet application is deployed, the resulting web application must contain the special portlet container servlet. It is pretty much similar to:

public void service(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException
{
// We access the context of the portlet application foo
ServletContext fooCtx = getServletContext().getContext("/foo");

// We obtain access to a servlet that will execute the portlet container
// It is important to request dispatch in order to do important stuff such
// as using objects from the foo application such as the http session or
// to have the thread context classloader of the foo application
RequestDispatcher rd = fooCtx.getRequestDispatched("/bar");

// We do an include but it should not modify the response (of course it depends on the implementation of
// the container / portal ...)
rd.include(req, resp);
}


We are able to provide solutions with different strategies, thanks to a framework that abstracts the various operations required by the portlet container and we have a couple of implementations.

We have one strategy that contains tomcat specific code and is able to detect application life cycle and modify it in a fully transparent manner. This is great for the developer as it does not require *any* modification of the portlet application, but this comes at the price of having code depending on tomcat, which is fine because tomcat is open source and we can integrate with it.

We also have a generic strategy that requires the portlet application developer to modify its war file and update the web.xml file to add a special servlet that will do all the magic. This is fine for development but this is a bit problematic when you download a thirdparty portlet application and deploy it because this forces you to edit the war file and modify it before deployment. Here is an example of what needs to be added to the war file:


<web-app>
...
<servlet>
<servlet-name>BootstrapServlet</servlet-name>
<servlet-class>org.jboss.portal.web.impl.generic.GenericBootstrapServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
...
<servlet-mapping>
<servlet-name>BootstrapServlet</servlet-name>
<url-pattern>/jbossportlet</url-pattern>
</servlet-mapping>
...
</web-app>


The nirvana is the fully transparent deployment of a portlet appliction and we are not yet there with the Servlet 3.0 spec... But the good news is that we are not far!

First the expert groups recognizes the need of the capability to modify of servlet context by providing runtime operations that will allow the addition of new servlets and create mappings dynamically:


...
servletContext.addServlet("BootstrapServlet", "The bootstrap servlet", "org.jboss.portal.web.impl.generic.GenericBootstrapServlet", null, -1);
servletContext.addServletMapping("BoostrapServlet", new String[]{"/jbossportlet"});
...


That would allow to replace the bootstrap servlet with a servlet context listener, which improves a bit the generic solution but is not yet fully transparent.

The second new feature that improves the generic solution is the modularization of web.xml, a new form a pluggability that allow to define servlets outside of web.xml in XML fragments. It is designed for frameworks. That should allow the packaging of the bootstrap servlet context listener (since now the listener could inject the servlet) in an xml fragment outside of web.xml and would allow to minimize the amount of work to do. Such xml fragments are located in the META-INF directory of any jar file bundled with the web application.

So what would become our generic implementation ? It would come as a jar file that would contain only the web xml fragment (because any portlet container classes have to be shared between all web applications...) that would be bundled in the WEB-INF/lib of the portlet application.

So we have a better generic solution now but it is not yet perfect. The expert group recognize there is a need for the various frameworks out there (even if the portlet container stuff is a special kind of framework, because of its cross context nature). When the Portlet expert group will work on a new revision of the spec, it would be great to have a solution to this problem so the Portlet spec could leverage it to provide a portable universal solution.

Personally I have a couple of suggestions in mind, I will try to blog them in the near future and maybe we could work out something with the Servlet expert group.

Thursday, April 10, 2008

JBoss Portlet Bridge Beta2 Released

Supports:
  • JBoss Portal 2.6.4
  • Seam 2.0.2.CR1
  • RichFaces 3.2.0.GA (with exception of upload component)
  • JSF 1.2
This release of the bridge has quite a few bug fixes and enhancements:
  • Portlet EL Variable support
  • New SeamIdentity Bridge Extension: instant SSO between your Seam application and your JBoss Portal server by a simple dependency in your pom
  • RichFaces Maven Archetype
  • Removal of PortalStateManager configuration
  • More documentation

EL Variable Support

portletConfig: object of type javax.portlet.PortletConfig

sessionPortletScope: mutable Map containing PortletSession attribute/values at PORTLET_SCOPE.

sessionApplicationScope: mutable Map containing PortletSession attribute/values at APPLICATION_SCOPE.

portletPreferenceValue: immutable Map containing the set of portlet preferences where the key is the name of the preference and the value is the first portlet preference value from the (potential) set of values.

portletPreferenceValues: immutable Map containing the set portlet preferences where the key is the name of the preference and the values are the set of this portlet preference's values.


SeamIdentity Bridge ExtensionJust add the following dependency to your JBoss Seam (Maven) project for SSO between JBoss Portal and Seam applications.
<dependency>
<groupid>org.jboss.portletbridge.extension.seam</groupid>
<artifactid>PortalIdentity</artifactid>
<version>1.0.0.B2</version>
</dependency>
RichFaces Maven Archetype
This is the new Beta2 release of the RichFaces archetype - only a few settings are different from the previous snapshot release.
mvn archetype:create
-DarchetypeGroupId=org.jboss.portletbridge.archetypes
-DarchetypeArtifactId=richfaces-basic
-DarchetypeVersion=1.0.0.B2
-DgroupId=org.whatever.project
-DartifactId=myprojectname
-DremoteRepositories=http://repository.jboss.org/maven2/

Removal of PortalStateManager configuration
The following is no longer needed in the faces-config.xml
 <state-manager>
org.jboss.portletbridge.application.PortalStateManager
</state-manager>
Visit the Portlet Bridge project page for more details.

Monday, March 31, 2008

JBoss Portlet Container 2.0 Candidate Release 2

We have just released the candidate release 2 of the JBoss Portlet Container project.

 Since the candidate release 1 we added an administration portlet that can manage the life cycle of the deployed applications and containers.



We have also added a very useful event debugger that can help developers to understand the event flow distributed among the different portlets during the interactions an event phase.


You can download the release from our project download page.

Friday, March 28, 2008

JBoss Portal 2.7 status

I want to give our community an overview of the JBoss Portal 2.7 development status.

The good news is that the JBoss Portal 2.7 branch reached what I call the Milestone 1 which consist in the integration of the JBoss Portlet Container 2.0 with the same level of functionality than the current 2.6 product. Thomas and Chris were the main drivers in that effort and did a very good job.

We are heading now toward the Milestone 2 with the following simple goals:

Integrate the controller module of the JBoss Portlet Container: it allows to perform complex event interactions between portlets. Actually this is the integration point that the JBoss Portlet Container provides to the portal in order to integrate its event routing and transforming logic. There is a very simple implementation in the JBoss Portlet Container simple portal that uses a matching event routing algorithm, simple yet sufficient for the simple portal, right?

Provide JSR 286 Portlet runtime meta data overview through the administration portlet. The administrator is able to know about the coordination capabilities offered by a portlet such as the event it produces and the event it consumes. 

I will talk briefly about the Milestone 3 and will probably give more update about it when Milestone 2 will be reached:
  • Define the coordination feature support, the event routing models and the portlet parameter sharing model
  • Support for new JSR 286 state in portal URLs, mostly about support of public navigational state changes in the URLs
  • Resource serving support
That's it for now, the entire team is focusing on reaching Milestone 2 very soon!!!!



Wednesday, March 12, 2008

RichFaces Portlet Archetype

I just finished creating a Maven archetype for the RichFaces portlet using the JBoss Portlet Bridge. An archetype basically gives you a empty project shell with all of the proper config files and package names that are custom to your project. It comes packaged with a simple demo of the RichFaces ajax repeater code.

From the command line run:
mvn archetype:create -DarchetypeGroupId=org.jboss.portletbridge.archetypes -DarchetypeArtifactId=richfaces-basic
-DarchetypeVersion=1.0.0-SNAPSHOT -DgroupId=org.whatever.project -DartifactId=myprojectname
-DremoteRepositories=http://snapshots.jboss.org/maven2/
Navigate to the newly created project folder and run mvn install - now you are ready to deploy the war file located in the target directory.

Monday, March 10, 2008

The Rise of the Portlet Containers

So now that the Portlet 2.0 spec is approved, it is very interesting to watch the evolution of the OSS market since the Portlet 1.0 spec.

The most noticeable change is the projectization of the portlet container technology. (I will not use the word productization because some of the projects release a complete product and some just make a dump of the source code of the project).  4 years ago the only standalone portlet container was Pluto (the Reference Implementation) and today there is an avalanche of at least 4 portlet container projects (including our JBoss Portlet Container product).

So the question is why do we have so many open source portlet container projects ? because a portlet container is an important piece of a portal and every one wants to develop its own portlet container ?

I think it answers partially the question. If you look a bit more closer at the portlet container technology, then you will see that there is an obvious lack of standard for embedding a portlet container in a portal, i.e a portal needs to chose a portlet container and use its proprietary API to interact with the container. Indeed the portlet specification does not specify that contract because this is the scope of the WSRP spec. As of today if a portal wants to reuse a portlet container in a portable manner, that portal needs to talk WSRP and nobody wants to do that!

So the rationalization of the market could drive to the adoption of a portal spec. It would provide the minimum basis to create a "Portal" profile in Java EE (which is today an hot topic!). Without a portal spec, I don't see any chance to have the portlet container technology part of Java EE.

Thursday, March 6, 2008

JBoss Portlet Container 2.0 Candidate Release 1

I just released the first candidate release of our portlet container product with a few additional features since the beta:
  • documentation : a product would not be a product without a documentation. The documentation has improved since the beta and now we have a complete section on the portal taglib and much more.
  • optimized event payload marshalling : when an event with an object payload is fired from application A to application B, the event will be unmarshalled/marshalled between the 2 applications classloaders (otherwise it would result in a class cast exception) unless the event class is shared at the server level (optimization).
  • life cycle dependencies between portlet filter and portlet container : if a portlet filter fails and is stopped then all the portlet container dependent on that filter will also be stopped (otherwise it would result obviously in an incorrect application).
  • administration application which provides an overview of the deployed applications / portlets / filters and management of their life cycle. So it is possible to restart a failed filter or portlet, or stop them when necessary.
  • event flood detection : in order to prevent event flood situations
The next release candidate release will probably be done once the public final draft of the spec is available on the JCP site and it should be a certified release.

We should add an event debugger that would help portlet developers to get the reporting of the event phase for debugging purpose. What a great addition to the product!

We'll blog soon about the integration roadmap of the portlet container product in our next release of the mainstream branch: JBoss Portal 2.7!!!!

Wednesday, March 5, 2008

Portlet 2.0 specification is approved

The spec has been approved on Monday, congratulations to the Expert Group led by Stefan Hepper!!!

You can expect the public final draft to follow soon and we'll do a release of our new product JBoss Portlet Container very soon!!!

Portlet 2 talk at OpenExpo in Bern

Next week I'll talk at the OpenExpo conference in Bern about the Portlet 2.0 specification.

You can get free passes on the OpenExpo website and my slot is on Thursday 13 at 11:50 am.

See you there!

Friday, February 22, 2008

JBoss World slides available

The JBoss World web site now provides the slides of the talks that were given there. You can now get our slides about JBoss Portal and Portlet 2.0 presentations.

Enjoy!

Tuesday, February 19, 2008

JBoss Microcontainer usage in JBoss Portlet Container

I planned to rewrite the life cycle support in our JBoss Portlet Container product a couple of months ago, I have started that task for a couple of days. The main reason is the addition of portlet filters which introduce a life cycle of the different container objects a bit more complex than what it used to be in the past.

 The current code only manages the portlet application and portlet container with a trivial one to many relationships between application and container.

 The rewrite will introduce the portlet filter object having a one to many relationship with the application and also a one to many relationship with a subset of the containers according to what the application developer describes in the portlet descriptor file.

 So far we have not used directly any state machine framework to manage that. The main reason is that we use JBoss MC in the JBoss Portlet Container product and we use the good old JBoss Microkernel in JBoss AS 4.2.

 One could argue that I should write my own stuff to manage that. Indeed even if it is not very hard to do and that a set of good test cases would help to achieve something reliable it would miss one crucial feature which is the interaction with the environment. Indeed we need to be able to make a portlet container or a portlet application able to depend on some service for instance and have that dependency managed by the hosting environment.

 Another motivation for the rewrite is to expose outside of the container a set of managed object that represent the applications, the containers exposing only a subset of the concerns:
  • Life cycle management wired to the MC and not directly to the container obviously
  • Expose runtime meta data like portlet info
 In the implementation using JBoss MC, I have been able to simplify a couple of stuff thanks to an interesting feature called deployment callback. It allows to install/uninstall (a special kind of injection but with no managed dependency) all the beans (that's how JBoss MC names its POJO citizens) having a certain class. So this feature allowed me to remove a bunch of wiring code and simplify my stuff.

 The documentation is very good although it is missing some parts, but it's ok as I don't need those part (yet... Mark and Ales if you read me :-) ).

 The integration of our build with Maven improves also a lot about my understanding of JBoss MC, since Idea is able to download sources which helps to understand the kernel API stuff.

 Once I am done with that, I should work on getting the CC/PP portlet feature implemented and than I'll try to upgrade the JBoss MC version to the one matching JBoss AS 5 Beta 4. I'll try to keep you informed about that.

Friday, February 15, 2008

JBoss Portlet Container 2.0 Beta 1 release!

I gave my talk this morning at JBoss World about the new features of the Portlet 2.0 specification. It was also the occasion to present a new product called "JBoss Portlet Container" and I must tell you that I am very proud of this new product.

First of all, this is our implementation of the Portlet 2.0 standard. As I said in my talk, it's 97% feature implemented but 100% useful feature implemented :-) . The remaining features will follow soon (actually only CC/PP that I did not add because I need to check the licensing issues and also try to provide a lightweight CC/PP impl).

 It is also our first product release that is not dependant on JBoss Application Server. This first release deploys in Tomcat 6 and  JBoss Application Server 4.2 and we are looking forward to support more container in the future (btw if you are interested by adding support of a container, just drop me a line).

 It comes bundled with a lightweight portal based on JSP tags. The goal of that portal is to provide to developers an easy way to demonstrate and test their portlet applications. It should combine well with other JSP taglibs and templating frameworks.

 Finally, I want to personally thank all the persons involved in that effort (Chris, Wesley and Bolek) and need to tell you that this product release would not have been done without their dedication.

Thursday, February 14, 2008

JBoss Portlet Bridge 1.0.0 Beta Released!

Thanks to the collaboration of the JBoss RichFaces, Seam and Portal teams, we are happy to announce an initial beta release of JBoss Portlet Bridge.
The JBoss Portlet Bridge is an implementation of the JSR-301 specification to support JSF within a portlet and with added enhancements to support other web frameworks. Currently the bridge supports any combination of JSF, Seam, and RichFaces to run inside a portlet.

The following is supported with JBoss Portlet Bridge 1.0.0.B1 Download
  • You can download the portlet bridge binaries here, which contain the required jars along with a deployable EAR file. The EAR is the Seam Booking Demo which uses both RichFaces and Seam.

Deploy

  • copy the ear file from example/seamEar.ear to JBoss_Home/server/default/deploy and start the server.

Test Drive

  • You should see a SeamBooking tab with the official JBoss Seam Booking Demo.
Setup and Configuration
  • Check out the configuration examples here.
Live Demo
  • The Seam Booking and RichFaces component demos can be viewed here.
All information to get up and running with configuration options for any combination of the frameworks mentioned above can be found on the wiki.

JBoss World day 1

Yesterday was the first JBoss World day.

I had the chance to go on stage during the keynote, invited by our CTO Sacha Labourey to make a little (but working) demo of JBoss Portal 2.6.4. My goal was to show to the audience the current JBoss Portal product and to get the following message out:

  • JBoss Portal 2.6.4 just released
  • JBoss Portlet Container 2.0 Beta, an implementation of the Portlet 2.0 spec (will be released tomorrow, more to come, stay tuned)
  • JBoss Portlet Bridge to make the integration of JSF/RF/Seam apps in JBoss Portal
Right now I am sitting at Thomas session about JBoss Portal. 

My talk is tomorrow morning at 9 AM and you don't want to miss it if you are present and want to hear about Portlet 2.0. I hope to see you there!

Friday, February 8, 2008

See you at JBoss World

A few of us will represent the JBoss Portal team at the upcoming JBoss World next week. Thomas and I will be on stage to talk about portal technology and Sohil will talk about his favorite pet named SSO.

I will present and demo the new features of the upcoming Portlet 2.0 specification. I intent to cover the major new features of the spec and will explain how they can be leveraged for building applications with concrete use cases. I will also detail the integration of the spec in our mainstream JBoss Portal 2.x product.

Thomas will present and demo a brand new spin-off project showing integration of in-house technologies. He will also explain the key concepts of JBoss Portal.

As in each JBoss World conference we will unveil surprises for you and be available to talk with you during the whole event. We will probably wear the new T-shirts we designed for JavaPolis last year with the new logos, so it should not be hard to recognize us.

See you there...

Friday, January 11, 2008

How to access the Portlet Mode from a JSF Portlet

We at JBoss a division of Red Hat use Hudson as a Continuous Integration tool. So I thought why not write a portlet that integrates with Hudson. The portlet can be downloaded from Portlet Swap. I ended up using the RI JSF implementation and JSF-Portlet bridge. It took me a while to figure out how to access some portal/portlet related objects in managed bean so I thought I should share what I found out.

To get the portlet mode in JSF's managed bean, you need to do
Object reqObj = FacesContext.getCurrentInstance().getExternalContext().getRequest();
if  (reqObj instanceof PortletRequest)
{
request = (PortletRequest)reqObj;
return request.getPortletMode();
}


You can get PortletPreferences similary by using request.getPreferences().

To get init parameters that you have specified in portlet.xml, you use
Map applicationMap = FacesContext.getCurrentInstance().getExternalContext().getApplicationMap();
if (null != applicationMap)
{
PortletConfig config = (PortletConfig)applicationMap.get("javax.portlet.PortletConfig");
return config.getInitParameter(param);
}