Archive for the ‘Tapestry’ Category

com.erinors.tapestry:tapdoc-project

Saturday, October 13th, 2007

Just trying to build Trials 1.1.1. Of course, Maven has not completed its job:

Project ID: com.erinors.tapestry:tapdoc-maven-plugin:maven-plugin:0.7.0-20070512.100908-1

Reason: Cannot find parent: com.erinors.tapestry:tapdoc-project for project: com.erinors.tapestry:tapdoc-maven-plugin:maven-plugin:0.7.0-20070512.100908-1

org.apache.maven.plugins:maven-idea-plugin:maven-plugin:2.0

Friday, October 12th, 2007

Maven is such a pain and a timekiller once in a while. This time, I have downloaded the trials examples from svn and wanted to compile the Roster demo. However, Maven is refusing to download it……and manual installation didn’t help either.

[INFO] Scanning for projects…
[INFO] Searching repository for plugin with prefix: ‘idea’.
Downloading: http://webobjects.mdimension.com/maven2/releases/org/apache/maven/p
lugins/maven-idea-plugin/2.0/maven-idea-plugin-2.0.jar
[WARNING] Unable to get resource from repository tapestry-snapshots (http://peop
le.apache.org/~hlship/tapestry-snapshot-repository/)
Downloading: http://repository.codehaus.org//org/apache/maven/plugins/maven-idea
-plugin/2.0/maven-idea-plugin-2.0.jar
[WARNING] Unable to get resource from repository codehaus (http://repository.cod
ehaus.org/)
Downloading: http://www.ibiblio.org/maven2/org/apache/maven/plugins/maven-idea-p
lugin/2.0/maven-idea-plugin-2.0.jar
[INFO] ————————————————————————
[ERROR] BUILD ERROR
[INFO] ————————————————————————
[INFO] Failed to resolve artifact.

Anyway, I have decided to delete the repository and start again!

Extending the Trails default pages using the HibernatePersistenceServiceImpl

Friday, October 12th, 2007

Unfortunately Trails is not very well documented yet (even the JavaDocs!). So I have to find my way by searching through posts on the Trails mailing-list or using the buggy JadClipse Plugin.

Anyway, if you want to have a custom page that can display a single entity, have a look at this example:

public abstract class ViewBlogPage extends TrailsPage
implements IExternalPage, PageBeginRenderListener
{

public void activateExternalPage(Object args[], IRequestCycle cycle)
{
String blogURL = (String)args[0];

HibernatePersistenceServiceImpl service = (HibernatePersistenceServiceImpl)this.getPersistenceService();
service.getSessionFactory().getCurrentSession().createCriteria(Blog.class);