Archive for October 2008

There are 2 bugs in seam-gen of JBoss Seam 2.1.0.GA in the following 2 files:

view/view.xhtml.ftl – Line 100

property=parentParentPojo.indentifierProperty -> property=parentParentPojo.identifierProperty

view/edit.xhtml.ftl – Line 127

property=parentParentPojo.indentifierProperty -> property=parentParentPojo.identifierProperty

Once you have made the above changes, you will need to run seam delete-project and seam create-project before progressing further.

A copy of my presentation on JBoss Seam in PDF format is available here.

Feel free to mail me your feedback at ashish@ebizss.com.

JBoss have released 2.1.0.GA release of JBoss Seam. The highlights include identity management framework with ACL style permissions, an Excel reporting module, an embellished and more flexible seam-gen, first class support for Wicket, built-in support for URL rewriting and a technology preview of JAX-RS (REST) support through the RESTeasy project.

It is important to mention that Seam based web applications can be deployed to all major Application Servers such as WebSphere, WebLogic, OC4J and now Glassfish. It can also be deployed to Tomcat. Make sure you check out the examples.

Read more about the new release here.

Download it from here.

Check out a screenshot-by-screenshot example here.

What you will need to get the ANT svn task to work is:

JDK 1.5/1.6 – You can get that here.
ANT – You can get that here.
SVN client – You can get that here. You will need to register for this.
SvnAnt zip file – You can get that here.

Here is what to do:

Install JDK if you haven’t done so already.
Install ANT (simply unzip the ANT zip file into an appropriate place) if you haven’t done so already.
Install SVN Client.
Install SvnAnt (simply unzip the SvnAnt zip file into an appropriate place).

To use the ANT svn task:

build.properties:
# -----------------------------------------------------------------------------
# build.properties
# This file is referenced by the sample build.xml file.
# -----------------------------------------------------------------------------

svnant.version=1.0.0

# —————————————————————————–
# all jar needed
# —————————————————————————–
lib.dir=C:/svnant-1.0.0/lib
svnant.jar=${lib.dir}/svnant.jar
svnClientAdapter.jar=${lib.dir}/svnClientAdapter.jar
svnjavahl.jar=${lib.dir}/svnjavahl.jar

svnant.latest.url=http://subclipse.tigris.org/svn/subclipse/trunk/svnant/
svnant.this.url=http://subclipse.tigris.org/svn/subclipse/tags/svnant/${svnant.version}/

svnant.repository.user=user1
svnant.repository.passwd=”passwordUser1″

build.xml:
<?xml version="1.0"?>

<project name="Update" basedir="." default="update">
 
  <!--  all properties are in build.properties -->
  <property file="build.properties" />
  <path id="project.classpath">
    <pathelement location="${svnjavahl.jar}" />
    <pathelement location="${svnant.jar}" />
    <pathelement location="${svnClientAdapter.jar}" />
  </path>
  <property name="project.svn.url" value="SVN_URL_HERE" />
 
  <taskdef resource="svntask.properties" classpathref="project.classpath"/>
 
  <target name="update">
    <svn>
      <checkout url="${project.svn.url}" revision="HEAD" destPath="." />
    </svn>
  </target>

</project>

You can get detailed documentation on svn ANT task here.

To install subversion on Linux and make it available over Apache, I took the following steps:

Install subversion on Fedora

yum install subversion

Install mod_dav_svn

yum install mod_dav_svn

Create the SVN Repository

mkdir /svn/repos
svnadmin create /svn/repos/sandbox

Change ownership of the folder to Apache

chown -R apache.apache /svn

Create /svn/repos/sandbox/svnauth file


[/]
user1 = rw
user2 = r

Here, user user1 will have read-write access while user user2 will have read-only access to the entire repository.

Create /svn/repos/sandbox/svnpass file

htpasswd -bcm /svn/repos/sandbox/svnpass user1 passwordUser1
htpasswd -bm /svn/repos/sandbox/svnpass user2 passwordUser2

htpasswd has the following usage

Usage:
htpasswd [-cmdpsD] passwordfile username
htpasswd -b[cmdpsD] passwordfile username password
 
htpasswd -n[mdps] username
htpasswd -nb[mdps] username password
-c Create a new file.
-n Don't update file; display results on stdout.
-m Force MD5 encryption of the password.
-d Force CRYPT encryption of the password (default).
-p Do not encrypt the password (plaintext).
-s Force SHA encryption of the password.
-b Use the password from the command line rather than prompting for it.
-D Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.

Add the following to your apache config file

<Location /svn/sandbox>
DAV svn
SVNPath /svn/repos/sandbox
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /svn/repos/sandbox/svnpass
Require valid-user
AuthzSVNAccessFile /svn/repos/sandbox/svnauth
</Location>

Restart Apache

httpd restart

Now you can access the above repository using your browser. Simply visit http://www.yourserver.com/svn/sandbox. You will be asked for username and password. Use one of the user names and passwords you used above. For example, user1 and passwordUser1.

JBoss have released version 2.1.0.CR1 of JBoss Seam.

This includes a lot of bug fixes and new features. Notably, it now has support for Wicket.

Download it or read the release notes here.

RichFaces 3.2.2.GA has been released. This release includes a lot of new components and a few bug fixes.

You can download this from here.

I had the opportunity to talk on JBoss Seam at the UK Java User Group for Scotland (UK JUGS). Their events link is – http://ukjugs.org/display/main/Events

My presentation is available to download in PDF format – Introduction to JBoss Seam – Notes.pdf

You can get a glimpse of the demo that was a part of this presentation at – http://www.ebizss.com/wiki/index.php/HelloWorldSeam.