GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - uklance/tapestry-cometd: A push library for Tapestry5 based on CometD

BranchesTags
Open more actions menu

Latest commit

 

History

158 Commits
158 Commits

Folders and files

NameName
Last commit message
Last commit date
tapestry-cometd-demo
tapestry-cometd-demo
 
 
tapestry-cometd
tapestry-cometd
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
logo-m.jpg
logo-m.jpg
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Tapestry CometD

A push library for Tapestry5 based on CometD

Features:

  • Create push applications without writing a single line of Javascript
  • Fully configurable
  • Use Tapestry templates to format incoming messages
  • POJO messages (use strings or custom objects)
  • Built on top of the rock solid CometD library
  • Supports Jetty Continuations
  • Topic abstraction (on top of CometD channels)
  • Choice of client update strategies when a message arrives (append, prepend or replace)
  • Custom Authorizers
  • Custom Subscription Listeners
  • Push dynamic javascript to the client

Usage:

Page.tml

<html 
      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
      xmlns:p="tapestry:parameter">

	<t:zone t:id="formZone" id="formZone">
		<!-- type a chat message in this form -->
		<form t:id="ajaxForm" t:type="form" t:zone="formZone">
			Message: <input t:type="TextField" t:id="message" /><input type="submit" value="Send"/>
		</form>
	</t:zone>

	<!-- this PushTarget subscribes to the '/chatTopic' topic and appends received messages to itself -->
	<t:cometd.PushTarget topic="/chatTopic" event="chat" update="append" />

	<!-- this template is applied to each chat message when it is received -->
	<t:block t:id="messageBlock">
		<h2>${message}</h2>
	</t:block>
</html>

Page.java

public class PushDemo {
    @InjectComponent
	private Zone formZone;
	
	@Inject
	private Block messageBlock;

	@Property
	private String message;
	
	@Inject
	private PushManager pushManager;
	
	// this event is fired when a message is received on the 'chatTopic' topic
	Block onChat(String message) {
		this.message = message;
		return messageBlock;
	}

	// this event is fired when the form is posted
	Block onSuccess() {
		// broadcast the message on the 'chatTopic' topic
		pushManager.broadcast("/chatTopic", message);
		return formZone.getBody();
	}
}

Demo

See a live demo running here

Maven

<dependencies>
	<dependency>
		<groupId>org.lazan</groupId>
		<artifactId>tapestry-cometd</artifactId>
		<!-- 
			lookup latest version at 
			https://github.com/uklance/releases/tree/master/org/lazan/tapestry-cometd 
		-->
		<version>...</version> 
	</dependency>

	<dependency>
		<groupId>org.got5</groupId>
		<artifactId>tapestry5-jquery</artifactId>
		<version>3.0.0</version>
	</dependency>
</dependencies>

...

<repositories>
	<repository>
		<id>tapestry-cometd</id>
		<url>https://raw.github.com/uklance/releases/master</url>
	</repository>
	<repository>
		<id>devlab722-repo</id>
		<url>http://nexus.devlab722.net/nexus/content/repositories/releases</url>
		<snapshots>
			<enabled>false</enabled>
		</snapshots>
	</repository>
</repositories>

Links

  • Custom Authorizers
  • Custom Subscription Listeners
  • Topics
  • Pushing javascript to the client
  • Configuring the CometD Servlet
  • FAQ

About

A push library for Tapestry5 based on CometD

Topics

cometdtapestrywebsocket

Resources

Readme
Activity

Stars

17 stars

Watchers

5 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.