GateIn 3.2 has been in the making for a long time, and while it includes many fixes, and new features, we’ve also been working on features beyond 3.2 version.
With JBoss AS7 approaching the final release, we’ve dedicated some extra focus here at GateIn project to getting the portal running on the latest and greatest application server out there.
JBoss AS7 internals are very different from 5 and 6 series, which requires us to develop a specific integration layer. We were thinking of starting with something small first with some quick proof of concept that we can build upon for full GateIn integration.
GateIn itself is built from components layered upon one another. There are two components at the very bottom that provide web container integration layer, and the ability to run portlets. On top of these come many modules that provide GateIn specific services and functionality - both UI, and integration capabilities.
For starters, we got Web Container Integration (WCI) and Portlet Container (PC) components working on JBoss AS7 with portal UI provided by a rudimentary portal called SimplePortal (part of PC component) to prove that the integration works properly.
SimplePortal is not in active development any more, and comes from the times when JBoss Portal ruled the day. That’s the reason it uses JBoss Portal esthetics, however, we do not have any plans to revive JBoss Portal.
For the impatient who want to see it run before diving into the code, here is a SimplePortal + JBoss AS 7.0.0.CR1 binary download package.
Keep in mind that demo pages, using sample portlets are far from slick, or working with user experience in mind. These are technical demos to demonstate how some things work or don’t work depending on the exact markup used for page composition. Some pages specifically demonstrate how things don’t work. The only way to appreciate the demo pages is therefore to play with pc/portal *.jsp pages, and pc/samples portlets. Actually, some of the portlets don’t really work as they should - like Google Map Portlet, which generates broken urls, or Google Weather Portlet which has no images. Then there are examples of page composition that prevents events from working properly - like the way Remote Control Portlet is embedded in Demo Portlets page makes it not to work, while it works properly in Demo2 page. Similarly, adding items to the cart works in Demo1 page, but doesn’t work in Demo5 which uses page composition that’s incompatible with propagating events. These are all old demo pages, and portlets, and it’s not worth spending time to fix them at this point.
See at the end of this blog for instructions on starting up the portal, and don’t get scared of deliberate exception thrown on startup.
Now, if you’re made of the right stuff, you don’t care too much about the ready-made binary download above, and want to build it all from scratch.
So, let's build and deploy this micro portal to the latest release of JBoss AS7 (7.0.0.CR1 at the moment of writing).
For our purposes we branched off WCI, and PC trunk in order to be able to do the necessary modifications. Note that if you rely on the same SNAPSHOT versions in any of your GateIn Portal builds, you may have to rebuild the original trunk versions before running your other build to prevent it from picking up these versions here.
First step is to check out the sources:
{code}svn co http://anonsvn.jboss.org/repos/gatein/sandbox/as7_support/tags/blog as7_support
{code}
Then we build WCI, and PC components:
{code}cd as7_support
cd wci
mvn -s ../settings.xml install -Dmaven.test.skip
{code}
(make sure you’re using a recent version of Maven 3)
{code}cd ..
cd pc
mvn -s ../settings.xml install -Pportal -DskipTests
{code}
Now we build AS7 integration modules, and package them with JBoss AS7:
{code}cd jboss-as7-integration
mvn -s ../../settings.xml install -Ppkg-jbossas7,download -Dexo.projects.directory.dependencies=SERVERS_DIR
{code}
(this command automatically downloads jboss-7.0.0.CR1 build and unpacks it into SERVERS_DIR. If you already have this JBoss AS7 build in SERVERS_DIR you can omit 'download' profile)
Finally, we run the JBoss AS7 with SimplePortal, and sample portlets deployed:
{code}cd pkg
cd target
cd jboss-7.0.0.CR1
cd bin
./standalone.sh (or just 'standalone' on Windows)
{code}
You should see exactly one stacktrace deliberately thrown by FailDuringInitPortlet.
You’ll also notice that this micro portal starts up really fast - in a matter of seconds - thanks to its minimum footprint, and the new super fast JBoss AS7.
Goto: http://localhost:8080/simple-portal
Click around, and see how everything works (again, keep in mind that some portlets deliberately don't work, and that it’s portlets / page markup problem, and not portal problem).
Also bear in mind that SimplePortal only provides page composition while delegating JSR-168/286 portlet support to PC component. So, what we have here is a fully spec compliant portlet container running in JBoss AS7, which you can use to develop portlets that don't rely on specific portal implementation APIs, or you can use it for simple jsp based web pages that need to include portlets.
Have fun with it, and look forward to full GateIn - JBoss AS7 integration coming your way soon.