equanda-t5navigation

This is a module which acts as a navigation service, gives conversations support (I would call these mini-conversations) and helps control persisted properties in pages.

Each navigation context is a mini-conversation, which stores for persisted context. These can be chained together to allow starting a new navigation context, or return to a previous page with correct state. The tail of this chain can also be obtained to easily build a breadcrumbs component. When the same page occurs more than once in a navigation chain, the mini conversations assure that each page instance has its own persistent data.

When changing page, you can either stay within the current navigation context (in which case you don't have to do anything), start a new navigation chain or add a link in the current navigation chain.

A demonstration of these features can be found at the equanda tapestry5 components demo.

Note that this module uses internal classes from tapestry, the current version works for tapestry 5.1.0.0. If you want this module to work in the GA version of tapestry 5 (5.0.18), you should use 0.9.3.

Interactions

There are three main interactions when using this module.
The examples here assume you have an actionlink in your template. We show the event code.
The first two cases don't need any code if you use the pagelink component.

Go to another page, creating a new navigation context, allowing return (chained)


@Inject
private ComponentResources resources;

@Inject
private NavigationManager navigationManager;

@InjectPage
private PageB pageB;

Object onActionFromPageBNavigation()
{
navigationManager.beginNavigation( resources.createPageLink( resources.getPageName(), false ),
"title for return link" );
return pageB;
}

This can also be done shorter if your page class implements "PageWithTitle".


@Inject
private ComponentResources resources;

@Inject
private NavigationManager navigationManager;

@InjectPage
private PageB pageB;

public String getTitle() {
return "title for return link";
}

Object onActionFromPageBNavigation()
{
navigationManager.beginNavigation( resources );
return pageB;
}

Go to another page, creating a new navigation context, not chained


@Inject
private NavigationManager navigationManager;

@InjectPage
private PageB pageB;

Object onActionFromPageBNavigation()
{
navigationManager.beginNavigation( false );
return pageB;
}

Return to the previous navigation context


@Inject
private NavigationManager navigationManager;

Object onActionFromReturn()
{
return navigationManager.endNavigation();
}

Usage

A list of available versions of the library can be found at http://maven.progs.be/m2repo/org/equanda/equanda-tapestry5/.
You should normally use the most recent version.

Or you can include it in your maven build using the following settings


<dependency>
<groupId>org.equanda</groupId>
<artifactId>equanda-t5navigation</artifactId>
<version>0.9.4</version>
</dependency>

For this to work, you need to also include the PROGS maven repository.


<repositories>
<repository>
<id>progs</id>
<url>http://maven.progs.be/m2repo</url>
</repository>
</repositories>
  • 1. equanda-t5navigation
  • 1.1. Interactions
  • 1.1.1. Go to another page, creating a new navigation context, allowing return (chained)
  • 1.1.2. Go to another page, creating a new navigation context, not chained
  • 1.1.3. Return to the previous navigation context
  • 1.2. Usage