You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Barry Books <tr...@gmail.com> on 2011/10/30 16:53:35 UTC

[ANN] Tapestry Bootstrap Module

I'm working on a couple of projects that will use Twitter Bootstrap
http://twitter.github.com/bootstrap/ templates so I decided to create
a Tapestry Module for this. The project is on GitHub
https://github.com/trsvax/tapestry-bootstrap and I've been working on
it about a week. It contains wrappers for the various Bootstrap items
such as alerts, popups etc.

Perhaps the most interesting component is the MediaGrid. The idea is
to create a component that supports pagination as well as javascript
scrolling on demand. It's somewhat like the Tapestry Grid but built in
a completely different way. It uses a subcomponents controlled through
the environment setup by a mixin. The presentation is in the
components and the mixin is the controller. There are interfaces
between the parts and each one is pluggable. The components receive
the parameters like this:

@Parameter(value="prop:alert?.type",defaultPrefix="literal")
private String type;
	
@SuppressWarnings("unused")
@Environmental(false)
@Property
private AlertEnvironment alert;

and the controller looks something like this
https://github.com/trsvax/tapestry-bootstrap/blob/master/src/main/java/com/trsvax/bootstrap/mixins/Pager.java

There is also a javascript mixin
https://github.com/trsvax/tapestry-bootstrap/blob/master/src/main/java/com/trsvax/bootstrap/mixins/InfiniteScroll.java
that hides the pagination component and adds items to the grid
dynamically as the user scrolls.

I've been trying for a while to figure out a way to set component
parameter defaults without success and this is the first
implementation I'm happy with. I've also included a mixin to push
objects into the environment
https://github.com/trsvax/tapestry-bootstrap/blob/master/src/main/java/com/trsvax/bootstrap/mixins/PushEnvironment.java

There is an example page that uses most of the components.

https://github.com/trsvax/tapestry-bootstrap/blob/master/src/test/resources/com/trsvax/bootstrap/pages/Index.tml

and can be run with mvn jetty:run

I would say the current code is mostly usable but the Media Grid needs
some work. Since that's the main reason I created the module it will
be improved shortly.

I've already had some very useful feedback and would appreciate more.
Code is also welcome.

Lastly I've created a blog to chronicle this project. It also used
Bootstrap and is written in Tapestry.

http://trsvax.com/blog/

Thanks
Barry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [ANN] Tapestry Bootstrap Module

Posted by Donyee <xy...@gmail.com>.
Great Idea!

2011/10/30 Barry Books <tr...@gmail.com>

> I'm working on a couple of projects that will use Twitter Bootstrap
> http://twitter.github.com/bootstrap/ templates so I decided to create
> a Tapestry Module for this. The project is on GitHub
> https://github.com/trsvax/tapestry-bootstrap and I've been working on
> it about a week. It contains wrappers for the various Bootstrap items
> such as alerts, popups etc.
>
> Perhaps the most interesting component is the MediaGrid. The idea is
> to create a component that supports pagination as well as javascript
> scrolling on demand. It's somewhat like the Tapestry Grid but built in
> a completely different way. It uses a subcomponents controlled through
> the environment setup by a mixin. The presentation is in the
> components and the mixin is the controller. There are interfaces
> between the parts and each one is pluggable. The components receive
> the parameters like this:
>
> @Parameter(value="prop:alert?.type",defaultPrefix="literal")
> private String type;
>
> @SuppressWarnings("unused")
> @Environmental(false)
> @Property
> private AlertEnvironment alert;
>
> and the controller looks something like this
>
> https://github.com/trsvax/tapestry-bootstrap/blob/master/src/main/java/com/trsvax/bootstrap/mixins/Pager.java
>
> There is also a javascript mixin
>
> https://github.com/trsvax/tapestry-bootstrap/blob/master/src/main/java/com/trsvax/bootstrap/mixins/InfiniteScroll.java
> that hides the pagination component and adds items to the grid
> dynamically as the user scrolls.
>
> I've been trying for a while to figure out a way to set component
> parameter defaults without success and this is the first
> implementation I'm happy with. I've also included a mixin to push
> objects into the environment
>
> https://github.com/trsvax/tapestry-bootstrap/blob/master/src/main/java/com/trsvax/bootstrap/mixins/PushEnvironment.java
>
> There is an example page that uses most of the components.
>
>
> https://github.com/trsvax/tapestry-bootstrap/blob/master/src/test/resources/com/trsvax/bootstrap/pages/Index.tml
>
> and can be run with mvn jetty:run
>
> I would say the current code is mostly usable but the Media Grid needs
> some work. Since that's the main reason I created the module it will
> be improved shortly.
>
> I've already had some very useful feedback and would appreciate more.
> Code is also welcome.
>
> Lastly I've created a blog to chronicle this project. It also used
> Bootstrap and is written in Tapestry.
>
> http://trsvax.com/blog/
>
> Thanks
> Barry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Yet Another Java EE Developer!