Valtech UK

Archive for the “JEE” Category

Embedded Glassfish for Integration Tests

This post was originally published here by Valtech UK consultant Mashooq Badar.

Sun Glassfish server can be run in embeded mode, very useful for automated integration tests. Here’s how: Maven Dependencies: <dependency> <groupId>org.glassfish.distributions</groupId> <artifactId>web-all</artifactId> <version>10.0-build-20080430</version> <scope>test</scope> </dependency> <dependency> <groupId>org.glassfish.embedded</groupId> <artifactId>gf-embedded-api</artifactId> <version>1.0-alpha-4</version> <scope>test</scope> </dependency> If you are not using maven then add the above libs to you classpath. Getting the server started in simple final URI APP_URI= UriBuilder.fromUri(“http://localhost/”).port(8888).path(“myapp”).build(); [...]

Creating custom layouts in JBoss Portal

This post was originally published here by Valtech UK consultant Mashooq Badar.

The layout of a portlet is handled by a set of JSP in the portal-core web-app which is part of the jboss-portal.sar. In the web-inf direcotry have a look at portal-layouts.xml to see how various layouts are configured. The following is a snippet (self explainatory): <layouts> <layout> <name>rbs-1column</name> <uri>/layouts/mylayout/index.jsp</uri> <uri state=”maximized”>/layouts/mylayout/maximized.jsp</uri> <regions> <region name=”regionBody”/> </regions> [...]