JMaki with Tapestry 5

2008-08-25 Thread Prashanth Gali

Good Morning group,
I am trying to use JMaki with Tapestry 5 and was wondering if any brave soul
tried to incorporate JMaki with Tapestry 5.
Quick web search revealed that JMaki can be integrated with Tapestry 5, but
I havent seen any example or posts about it.
Please advice/guide me in the direction where I can use JMaki widgets in
Tapestry 5 pages.

Thank you in advance.
Prashanth
-- 
View this message in context: 
http://www.nabble.com/JMaki-with-Tapestry-5-tp19138328p19138328.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



more than 1 tapestry.app-package

2008-08-25 Thread jimmy6

1)how to configure more than 1 tapestry.app-package?
  param-nametapestry.app-package/param-name
param-valuet5demo/param-value

2) how to change pages,components,model?
-- 
View this message in context: 
http://www.nabble.com/more-than-1-tapestry.app-package-tp19138593p19138593.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Return page from ajax request

2008-08-25 Thread Markus Joschko
Despite the workarounds I think it would be much nicer if tapestry
could handle this automatically and don't force the developer to think
about that.
I created an improvement request
https://issues.apache.org/jira/browse/TAPESTRY-2618



On Mon, Aug 25, 2008 at 2:31 AM, Jun Tsai [EMAIL PROTECTED] wrote:
 Object onAction(){
JSONObject response = new JSONObject();
response.put(script, self.location='me';);
response.put(content, redirect .);

return response;

 }


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: prototype 1.6.0.2

2008-08-25 Thread Toby Hobson
ok thanks Howard

2008/8/24 Howard Lewis Ship [EMAIL PROTECTED]

 If you add an issue to JIRA, we can look into upgrading to 1.6.0.2.
 Hopefully 1.6.0.2 addresses the issue we originally had with Safari
 support.

 On Sun, Aug 24, 2008 at 6:54 AM, Toby Hobson [EMAIL PROTECTED]
 wrote:
  Hi Guys,
 
  Does anyone know what's happening with 1.6.0.2? I understand T5 uses
  1.6.0.1because there are some issues in
  1.6.0.2 but I was hoping to use the prototip tooltip library which needs
  1.6.0.2
 
  Thanks
 
  Toby
 



 --
 Howard M. Lewis Ship

 Creator Apache Tapestry and Apache HiveMind

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




T5+EJB3

2008-08-25 Thread Natia Gdzelishvili
Hello
I have a  stateful session bean
UserCreatorBean which implements UserCreatorLocale
on a tapestry page when submit is done  I want to call UserLocaleBeans's
some method, I am injecting bean with @EJB anotation but it is not injected
(null pointer exception when invoking bean's method).
How can i inject stateful bean in tapestry.
thank you in advance


Re: T5 : Expanding Messages Catalog for localization from arbitrary source

2008-08-25 Thread Inge Solvoll
Hi, Hannes!

I tried your implementation, and it worked right away, I just returned the
value TESTING TESTING from my DbMessages class that extends Abstract
Messages.

But, what I need is for the valueForKey(String key) method to be aware of
the languageId/customerId of the currently logged in user. In all my other
pages, I get this through injecting the request and getting my user object
from HttpSession. Alternatively this can be moved to an ASO, but I haven't
taken the time to do that yet.

I've tried injecting HttpServletRequest and ApplicationState on all the
classes listed in the implementation from Hannes, but none of them work
(only null values). How can I make information from the current user session
available to my AbstractMessages implementation?

Regards

Inge

On Wed, Apr 16, 2008 at 10:22 AM, Hannes Heijkenskjöld 
[EMAIL PROTECTED] wrote:

 Great!

 Glad I could help you. :-)

 /Hannes

 Michael Capper skrev:

  Thanks Hannes!

 I tried the route with the Decorator once, and ended up having to write
 some
 java-code into the interceptor via the BodyBuilder  'twas not nice.

 Your example worked great, i only had to pass some more Services
 (AssetSource to get the URLs, my ProjectContextProvider to get the
 ResourceBundles for my text) into the build-Method in AppModule, then i
 could return the value for a Message-Key from the bundles, or if not
 existant, from the fallbackMessages.

 Cheers,
 Mike


 Hannes Heijkenskjöld wrote:

 Hi

 I have recently wondered about the same, and have now built something
 that after much trial and error now works.

 Basically, I have created a Messages implementation that wraps both a
 tapestry Messages object and our own database messages. If a message is not
 found in our database, the default Messages object is queried.

 To get Tapestry to use my Messages implementation i had to decorate the
 ComponentMessagesSource (and ValidationMessagesSource), since it is not
 possible to replace the one in Tapestry. I think I read about decorating
 services here:
 http://tapestry.apache.org/tapestry5/tapestry-ioc/decorator.html and on
 the mailing list.

 My messages source service doesn't implement the ComponentMessagesSource
 interface. I use an interception object for that. Hopefully you can
 understand how it works from my example code below:

 public class CommonsMessages extends AbstractMessages {

 private Messages fallbackMessages;

 protected String valueForKey(final key) {
... logic to get key from db, use fallbackMessages as fallback...
 }

 }

 -

 public class CommonsMessagesSource {

 public Messages getMessages(Locale locale, Messages fallbackMessages)
 {
... code that creates a CommonsMessages object, with
 fallbackMessages ...
 }
 }

 

 // This is the decorating class
 public class CommonsComponentMessagesSourceInterceptor implements
 ComponentMessagesSource {

 private final CommonsMessagesSource service;
 private final ComponentMessagesSource delegate;

 public CommonsComponentMessagesSourceInterceptor
 (CommonsMessagesSource service, ComponentMessagesSource delegate)
 {
 this.service = service;
 this.delegate = delegate;
 }

 public Messages getMessages(ComponentModel componentModel, Locale
 locale) {

 return service.getMessages(locale,
 delegate.getMessages(componentModel, locale));
 }

 // Not sure about how I should handle this one
 public void addInvalidationListener(
 InvalidationListener invalidationlistener) {
 delegate.addInvalidationListener(invalidationlistener);
 }
 }

 ---

 In AppModule.java:

 // Method for instantiating and configuring the custom messages
 source
 public static CommonsMessagesSource buildCommonsMessagesSource()
 {
 CommonsMessagesSource messagesSource = new
 CommonsMessagesSource();
 return messagesSource;
 }

 // Method that decorates the default MessagesSource using the
 interceptor class
 @Match(ComponentMessagesSource)
 public static ComponentMessagesSource decorateComponentMessagesSource
  (Object delegate, CommonsMessagesSource service)
  {
  return new CommonsComponentMessagesSourceInterceptor(service,
 (ComponentMessagesSource)delegate);
  }

 This is how I got it to work, there may be other ways ofcourse. There
 might even be better ways :-)

 Cheers,
 /Hannes

 Michael Capper skrev:

 Summary: How do I include additional localization-key/values-pairs in my
 global messages-catalog, originating from some app_lang.properties or
 from
 a database?

 Hi,
 I'd like to extend the Hash-Table containing the message-keys and
 message-values used in my app. The app_en.properties provides the basic
 global localization data, but I need even more data, which is spead
 about
 in
 other .properties-files or even in a Database. What I'd like to do would
 be
 to read in the data somewhere, and pass it 

Re: T5 : Expanding Messages Catalog for localization from arbitrary source

2008-08-25 Thread Hannes Heijkenskjöld

Hi Inge,

glad to have been able to help you!

For your current problem, I can see two immediate solutions.

1. Store your user object as an ASO and inject ApplicationStateManager 
into your Messages implementation. Get the user object instance by 
calling applicationStateManager.get(UserObject.class).


2. Inject RequestGlobals in your Messages implementation. Then you can 
get the request by calling requestGlobals.getHTTPServletRequest().


I hope this helps

/Hannes

Inge Solvoll skrev:

Hi, Hannes!

I tried your implementation, and it worked right away, I just returned the
value TESTING TESTING from my DbMessages class that extends Abstract
Messages.

But, what I need is for the valueForKey(String key) method to be aware of
the languageId/customerId of the currently logged in user. In all my other
pages, I get this through injecting the request and getting my user object
from HttpSession. Alternatively this can be moved to an ASO, but I haven't
taken the time to do that yet.

I've tried injecting HttpServletRequest and ApplicationState on all the
classes listed in the implementation from Hannes, but none of them work
(only null values). How can I make information from the current user session
available to my AbstractMessages implementation?

Regards

Inge

On Wed, Apr 16, 2008 at 10:22 AM, Hannes Heijkenskjöld 
[EMAIL PROTECTED] wrote:


Great!

Glad I could help you. :-)

/Hannes

Michael Capper skrev:

 Thanks Hannes!

I tried the route with the Decorator once, and ended up having to write
some
java-code into the interceptor via the BodyBuilder  'twas not nice.

Your example worked great, i only had to pass some more Services
(AssetSource to get the URLs, my ProjectContextProvider to get the
ResourceBundles for my text) into the build-Method in AppModule, then i
could return the value for a Message-Key from the bundles, or if not
existant, from the fallbackMessages.

Cheers,
Mike


Hannes Heijkenskjöld wrote:


Hi

I have recently wondered about the same, and have now built something
that after much trial and error now works.

Basically, I have created a Messages implementation that wraps both a
tapestry Messages object and our own database messages. If a message is not
found in our database, the default Messages object is queried.

To get Tapestry to use my Messages implementation i had to decorate the
ComponentMessagesSource (and ValidationMessagesSource), since it is not
possible to replace the one in Tapestry. I think I read about decorating
services here:
http://tapestry.apache.org/tapestry5/tapestry-ioc/decorator.html and on
the mailing list.

My messages source service doesn't implement the ComponentMessagesSource
interface. I use an interception object for that. Hopefully you can
understand how it works from my example code below:

public class CommonsMessages extends AbstractMessages {

private Messages fallbackMessages;

protected String valueForKey(final key) {
   ... logic to get key from db, use fallbackMessages as fallback...
}

}

-

public class CommonsMessagesSource {

public Messages getMessages(Locale locale, Messages fallbackMessages)
{
   ... code that creates a CommonsMessages object, with
fallbackMessages ...
}
}



// This is the decorating class
public class CommonsComponentMessagesSourceInterceptor implements
ComponentMessagesSource {

private final CommonsMessagesSource service;
private final ComponentMessagesSource delegate;

public CommonsComponentMessagesSourceInterceptor
(CommonsMessagesSource service, ComponentMessagesSource delegate)
{
this.service = service;
this.delegate = delegate;
}

public Messages getMessages(ComponentModel componentModel, Locale
locale) {

return service.getMessages(locale,
delegate.getMessages(componentModel, locale));
}

// Not sure about how I should handle this one
public void addInvalidationListener(
InvalidationListener invalidationlistener) {
delegate.addInvalidationListener(invalidationlistener);
}
}

---

In AppModule.java:

// Method for instantiating and configuring the custom messages
source
public static CommonsMessagesSource buildCommonsMessagesSource()
{
CommonsMessagesSource messagesSource = new
CommonsMessagesSource();
return messagesSource;
}

// Method that decorates the default MessagesSource using the
interceptor class
@Match(ComponentMessagesSource)
public static ComponentMessagesSource decorateComponentMessagesSource
 (Object delegate, CommonsMessagesSource service)
 {
 return new CommonsComponentMessagesSourceInterceptor(service,
(ComponentMessagesSource)delegate);
 }

This is how I got it to work, there may be other ways ofcourse. There
might even be better ways :-)

Cheers,
/Hannes

Michael Capper skrev:


Summary: How do I include additional localization-key/values-pairs in my
global messages-catalog, 

Re: tomcat error filterStart

2008-08-25 Thread Mike Saavedra


Thanks Filip,

Yes, I've tried only components in the jar and all classes in the jar; 
as well as no classes in WEB-INF/classes in case of dupe problem. All 
have the same result as below. Does anyone know how to get more 
information from catalina.out? All it says is:


SEVERE: Error filterStart

Any help is appreciated,
Mike Saavedra


Filip S. Adamsen wrote:


Hi,

Have you tried packing everyting from ${app.root}/WEB-INF/classes/ 
into a JAR and put it in ${app.root}/WEB-INF/lib? That might help.


-Filip

On 2008-08-23 01:06, Mike Saavedra wrote:


I just want a basic webapp to run in tomcat 5.5.26. I install tomcat 
and drop in my file structure which looks like this:

${app.root}/
${app.root}/favicon.ico
${app.root}/Index.tml
${app.root}/WEB-INF
${app.root}/WEB-INF/web.xml
${app.root}/WEB-INF/classes
${app.root}/WEB-INF/classes/com
${app.root}/WEB-INF/classes/com/mycompany
${app.root}/WEB-INF/classes/com/mycompany/mypackage
${app.root}/WEB-INF/classes/com/mycompany/mypackage/pages
${app.root}/WEB-INF/classes/com/mycompany/mypackage/pages/Index.class
${app.root}/WEB-INF/classes/com/mycompany/mypackage/services
${app.root}/WEB-INF/classes/com/mycompany/mypackage/services/AppModule$1.class 

${app.root}/WEB-INF/classes/com/mycompany/mypackage/services/AppModule.class 


${app.root}/WEB-INF/classes/com/mycompany/mypackage/entities
${app.root}/WEB-INF/classes/com/mycompany/mypackage/entities/Room.class
${app.root}/WEB-INF/lib/*.jar

Because it's tomcat I have ${app.root}/WEB-INF/lib/mycomponents.jar 
for the Index.class along with the other jars. When I start up tomcat 
it starts, but my context fails to load with the following error:


Aug 22, 2008 4:10:52 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Aug 22, 2008 4:10:52 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/myapp] startup failed due to previous errors

My web.xml:
web-app
   display-nameTapestry 5 Application/display-name
   context-param
   param-nametapestry.app-package/param-name
   param-valuecom.mycompany.mypackage/param-value
   /context-param
   filter
   filter-nameapp/filter-name
   filter-classorg.apache.tapestry5.TapestryFilter/filter-class
   /filter
   filter-mapping
   filter-nameapp/filter-name
   url-pattern/*/url-pattern
   /filter-mapping
/web-app

 From what I've googled so far, it seems it could be having trouble 
locating TapestryFilter, so I put tapestry jars in 
${tomcat}/common/lib. Same thing. I at a loss here because this is 
very basic and should work. Can anyone see what I'm missing, or what 
might be the problem?


Many thanks,
Mike Saavedra

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5 : Let's write a book !

2008-08-25 Thread Alex Kotchnev
First of all, I apologize for the long post in advance, I couldn't figure
out how to make it shorter.

I've been thinking about how much I miss the unborn T5 in Action book. I
spoke to Howard a while back and he said that it's unlikely that a new
revision of the Tapestry In Action (from Manning) would happen :
understandably, he has the framework to worry about, not the books, and it's
unlikely that he'd have 1 year to take away from work and write a book.

Thus, I've been trying to figure out ways to substitute for the missing
manuscript. Here are my impressions so far:

* The T5 book from PacktPub is a nice intro, but it's out of date and it's
kinda shallow
* The wiki has some nice content on it, but it's disorganized and a little
too random: you may find something useful on a subject, and then,  you may
not
* The project docs are often quite useful and often times quite deep, but
they don't have enough examples to put things in context
* The tutorials are all focused around getting started, and don't have
enough substance
* Finally, the example apps (e.g. JumpStart, t5-acegi example, shams, etc)
are extremely useful; however, (by design) there's little narrative
surrounding them to explain how and why things work the way they do.

Thus, the  bottom line is that one has to hunt down 5 different resources
(possibly more) to pull together a coherent picture , especially when one
goes deeper than the getting started stage.

Now, I clearly don't know enough about T5 yet to write a book myself (as
much as that sounds appealing to the ego) and it's unlikely that I could
possibly dedicate the time and effort to do it all. So, I had the idea for a
while that it would be extremely cool and useful if a bunch of the people
interested in T5 could get together (incl. myself) and write a book on the
subject. Tim Sweetser jumped in with the idea on the IRC channel that we
could do a collaborative online book :  put together a rough outline of
the potential content (chapter and section-wise), then let users contribute
to the effort by filling in the blanks (with some editorial oversight). So,
if something like this were possible, a bunch of people can get their minds
together, each one contribute a chapter or two and kick off the effort. This
way, each one person can focus on a subset of the problem, describe it in
sufficient depth (e.g. research the areas that he/she is unfamiliar with),
and not weigh down anyone in particular with an enormous amount of effort
(such as writing a whole book).

Surveying the landscape, similar things already exist. Tim Sweetser
mentioned that Django did something like this. I know that Grails has quite
a thorough user manual that covers most of the important areas of the
framework. I also remember bumping into the PHP manual where people could
comment and add relevant examples and such. So, in conclusion, this is
possible, people have definitely done it, and it's HUGE for the community
around the project.

So, the next question is, how should something like this be done ?
* The Wiki seems like a no brainer to start with, add the TOC and then allow
people to contribute. The potential problem with it is that code and the
examples can easily become stale. I know that the examples of the Grails
user manual are somehow compiled and checked that they run before a new
version of the manual is published.
* Another option seems to be putting a bunch of Docbook files in SVN and
collaborating through SVN to move the book forward. The upside of doing
something like this is that it gives us an immediate perk of being able to
export a printable version of the book. Downside is that contributing to the
book is not all that easy (e.g. some DocBook knowledge needed, SVN access,
etc)
* Yet another option could possibly be Google Docs. The upside of this is
that the learning curve is about 0 and publishing it in some decent format
is easy. The downsides are that possibly can be a PITA to share the doc w/
the right people
* Tim mentioned that maybe some kind of CMS would be nice, but at the same
time, it might be a bit of an overkill.

So, in summary, here are a laundry list of requirements:
* The book should have thorough coverage of the different aspects of working
w/ T5 : from getting started to components and advanced topics (e.g. IoC
magic)
* The book should be easy to contribute to - comments, code examples
* It would be nice if there is a decent printable version
* It would be great if we can leverage some of the existing resources:  e.g.
wiki, example apps, tutorials, etc.
* It would be nice if we can come up with a way to keep the code in the book
in working order (e.g. if we reference some of the example apps, that could
do wonders in keeping a runnable version of the examples)
* There should be some structure in the book (e.g. more than just the flat
wiki namespace)
* There probably should be some editorial oversight to prevent one of the
known trolls from putting garbage in.


So, here come the 

Re: T5 : Let's write a book !

2008-08-25 Thread Howard Lewis Ship
It is certainly an interesting idea.

I think HIbernate follows a similar approach; they have a Wiki
(Confluence, perhaps) and they scrape it to get the packaged
documentation.

We could look into running a more involved Wiki, perhaps from
tapestry.formos.com.  Confluence would be reasonable, as I can get an
open-source project license for any of the Atlassian products.

The problem with this is oversight; writing a book in any format
consists of a lot of dull work.  In an open community its hard to
motivate people, without a direct stake, to do that kind of dull work.

On Mon, Aug 25, 2008 at 9:03 AM, Alex Kotchnev [EMAIL PROTECTED] wrote:
 First of all, I apologize for the long post in advance, I couldn't figure
 out how to make it shorter.

 I've been thinking about how much I miss the unborn T5 in Action book. I
 spoke to Howard a while back and he said that it's unlikely that a new
 revision of the Tapestry In Action (from Manning) would happen :
 understandably, he has the framework to worry about, not the books, and it's
 unlikely that he'd have 1 year to take away from work and write a book.

 Thus, I've been trying to figure out ways to substitute for the missing
 manuscript. Here are my impressions so far:

 * The T5 book from PacktPub is a nice intro, but it's out of date and it's
 kinda shallow
 * The wiki has some nice content on it, but it's disorganized and a little
 too random: you may find something useful on a subject, and then,  you may
 not
 * The project docs are often quite useful and often times quite deep, but
 they don't have enough examples to put things in context
 * The tutorials are all focused around getting started, and don't have
 enough substance
 * Finally, the example apps (e.g. JumpStart, t5-acegi example, shams, etc)
 are extremely useful; however, (by design) there's little narrative
 surrounding them to explain how and why things work the way they do.

 Thus, the  bottom line is that one has to hunt down 5 different resources
 (possibly more) to pull together a coherent picture , especially when one
 goes deeper than the getting started stage.

 Now, I clearly don't know enough about T5 yet to write a book myself (as
 much as that sounds appealing to the ego) and it's unlikely that I could
 possibly dedicate the time and effort to do it all. So, I had the idea for a
 while that it would be extremely cool and useful if a bunch of the people
 interested in T5 could get together (incl. myself) and write a book on the
 subject. Tim Sweetser jumped in with the idea on the IRC channel that we
 could do a collaborative online book :  put together a rough outline of
 the potential content (chapter and section-wise), then let users contribute
 to the effort by filling in the blanks (with some editorial oversight). So,
 if something like this were possible, a bunch of people can get their minds
 together, each one contribute a chapter or two and kick off the effort. This
 way, each one person can focus on a subset of the problem, describe it in
 sufficient depth (e.g. research the areas that he/she is unfamiliar with),
 and not weigh down anyone in particular with an enormous amount of effort
 (such as writing a whole book).

 Surveying the landscape, similar things already exist. Tim Sweetser
 mentioned that Django did something like this. I know that Grails has quite
 a thorough user manual that covers most of the important areas of the
 framework. I also remember bumping into the PHP manual where people could
 comment and add relevant examples and such. So, in conclusion, this is
 possible, people have definitely done it, and it's HUGE for the community
 around the project.

 So, the next question is, how should something like this be done ?
 * The Wiki seems like a no brainer to start with, add the TOC and then allow
 people to contribute. The potential problem with it is that code and the
 examples can easily become stale. I know that the examples of the Grails
 user manual are somehow compiled and checked that they run before a new
 version of the manual is published.
 * Another option seems to be putting a bunch of Docbook files in SVN and
 collaborating through SVN to move the book forward. The upside of doing
 something like this is that it gives us an immediate perk of being able to
 export a printable version of the book. Downside is that contributing to the
 book is not all that easy (e.g. some DocBook knowledge needed, SVN access,
 etc)
 * Yet another option could possibly be Google Docs. The upside of this is
 that the learning curve is about 0 and publishing it in some decent format
 is easy. The downsides are that possibly can be a PITA to share the doc w/
 the right people
 * Tim mentioned that maybe some kind of CMS would be nice, but at the same
 time, it might be a bit of an overkill.

 So, in summary, here are a laundry list of requirements:
 * The book should have thorough coverage of the different aspects of working
 w/ T5 : from getting started to 

Re: T5 : Let's write a book !

2008-08-25 Thread Hugo Palma
I agree that getting people to do boring tasks for free might be a 
challenge. But it's definitely worth a try.


I think DocBook Wiki(http://doc-book.sourceforge.net/homepage/) could 
help here.
You get the ease of use of a wiki and are still able to keep the content 
in docbook format so that it's easy to export to a printable version.


Howard Lewis Ship wrote:

It is certainly an interesting idea.

I think HIbernate follows a similar approach; they have a Wiki
(Confluence, perhaps) and they scrape it to get the packaged
documentation.

We could look into running a more involved Wiki, perhaps from
tapestry.formos.com.  Confluence would be reasonable, as I can get an
open-source project license for any of the Atlassian products.

The problem with this is oversight; writing a book in any format
consists of a lot of dull work.  In an open community its hard to
motivate people, without a direct stake, to do that kind of dull work.

On Mon, Aug 25, 2008 at 9:03 AM, Alex Kotchnev [EMAIL PROTECTED] wrote:
  

First of all, I apologize for the long post in advance, I couldn't figure
out how to make it shorter.

I've been thinking about how much I miss the unborn T5 in Action book. I
spoke to Howard a while back and he said that it's unlikely that a new
revision of the Tapestry In Action (from Manning) would happen :
understandably, he has the framework to worry about, not the books, and it's
unlikely that he'd have 1 year to take away from work and write a book.

Thus, I've been trying to figure out ways to substitute for the missing
manuscript. Here are my impressions so far:

* The T5 book from PacktPub is a nice intro, but it's out of date and it's
kinda shallow
* The wiki has some nice content on it, but it's disorganized and a little
too random: you may find something useful on a subject, and then,  you may
not
* The project docs are often quite useful and often times quite deep, but
they don't have enough examples to put things in context
* The tutorials are all focused around getting started, and don't have
enough substance
* Finally, the example apps (e.g. JumpStart, t5-acegi example, shams, etc)
are extremely useful; however, (by design) there's little narrative
surrounding them to explain how and why things work the way they do.

Thus, the  bottom line is that one has to hunt down 5 different resources
(possibly more) to pull together a coherent picture , especially when one
goes deeper than the getting started stage.

Now, I clearly don't know enough about T5 yet to write a book myself (as
much as that sounds appealing to the ego) and it's unlikely that I could
possibly dedicate the time and effort to do it all. So, I had the idea for a
while that it would be extremely cool and useful if a bunch of the people
interested in T5 could get together (incl. myself) and write a book on the
subject. Tim Sweetser jumped in with the idea on the IRC channel that we
could do a collaborative online book :  put together a rough outline of
the potential content (chapter and section-wise), then let users contribute
to the effort by filling in the blanks (with some editorial oversight). So,
if something like this were possible, a bunch of people can get their minds
together, each one contribute a chapter or two and kick off the effort. This
way, each one person can focus on a subset of the problem, describe it in
sufficient depth (e.g. research the areas that he/she is unfamiliar with),
and not weigh down anyone in particular with an enormous amount of effort
(such as writing a whole book).

Surveying the landscape, similar things already exist. Tim Sweetser
mentioned that Django did something like this. I know that Grails has quite
a thorough user manual that covers most of the important areas of the
framework. I also remember bumping into the PHP manual where people could
comment and add relevant examples and such. So, in conclusion, this is
possible, people have definitely done it, and it's HUGE for the community
around the project.

So, the next question is, how should something like this be done ?
* The Wiki seems like a no brainer to start with, add the TOC and then allow
people to contribute. The potential problem with it is that code and the
examples can easily become stale. I know that the examples of the Grails
user manual are somehow compiled and checked that they run before a new
version of the manual is published.
* Another option seems to be putting a bunch of Docbook files in SVN and
collaborating through SVN to move the book forward. The upside of doing
something like this is that it gives us an immediate perk of being able to
export a printable version of the book. Downside is that contributing to the
book is not all that easy (e.g. some DocBook knowledge needed, SVN access,
etc)
* Yet another option could possibly be Google Docs. The upside of this is
that the learning curve is about 0 and publishing it in some decent format
is easy. The downsides are that possibly can be a PITA to share the doc w/

T5: How to implement a simple API servlet?

2008-08-25 Thread immutability

Guys, I've been trying to search google and nabble for this, but just
couldn't find the answer, perhaps I'm just using the wrong keywords or
something... as I'm sure it will sound trivial to some of you.

Here's what I'm trying to achieve: I'd like to implement a simplistic API in
our webapplication using just a plain old servlet to handle all API method
calls. The idea is to just call this single servlet, passing in the required
set of parameters via GET/POST, and responding with a either an XML data
response (text/xml), or a binary stream (zipped data) depending on the
method called.

Now, I'm lost trying to find the best way how to mix this into the existing
Tapestry5 application. I have tried to just add the servlet/mapping into
web.xml but that doesn't work. I thought about extending TapestryFilter to
ignore the API servlet's path, but the doFilter method is final right? I
also thought about just getting the raw http request/response within a
tapestry page using injection, but that just doesn't feel right - it seems
better to bypass tapestry altogether for this purpose, or is it wrong?

Thanks for any ideas in advance!
Rado
-- 
View this message in context: 
http://www.nabble.com/T5%3A-How-to-implement-a-simple-API-servlet--tp19149751p19149751.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: How to implement a simple API servlet?

2008-08-25 Thread Howard Lewis Ship
I did some modest work like this many months back, where I had a page
as a kind of RESTful service endpoint.  I returned a StreamResponse
from onActivate().  The page didn't even have a template.  This is
not quite what T5 is intended to do, but you get the benefits of live
class reloading and IoC integration, so why not?

On Mon, Aug 25, 2008 at 12:10 PM, immutability [EMAIL PROTECTED] wrote:

 Guys, I've been trying to search google and nabble for this, but just
 couldn't find the answer, perhaps I'm just using the wrong keywords or
 something... as I'm sure it will sound trivial to some of you.

 Here's what I'm trying to achieve: I'd like to implement a simplistic API in
 our webapplication using just a plain old servlet to handle all API method
 calls. The idea is to just call this single servlet, passing in the required
 set of parameters via GET/POST, and responding with a either an XML data
 response (text/xml), or a binary stream (zipped data) depending on the
 method called.

 Now, I'm lost trying to find the best way how to mix this into the existing
 Tapestry5 application. I have tried to just add the servlet/mapping into
 web.xml but that doesn't work. I thought about extending TapestryFilter to
 ignore the API servlet's path, but the doFilter method is final right? I
 also thought about just getting the raw http request/response within a
 tapestry page using injection, but that just doesn't feel right - it seems
 better to bypass tapestry altogether for this purpose, or is it wrong?

 Thanks for any ideas in advance!
 Rado
 --
 View this message in context: 
 http://www.nabble.com/T5%3A-How-to-implement-a-simple-API-servlet--tp19149751p19149751.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: How to implement a simple API servlet?

2008-08-25 Thread Thiago H. de Paula Figueiredo
Em Mon, 25 Aug 2008 16:10:11 -0300, immutability [EMAIL PROTECTED]  
escreveu:


Here's what I'm trying to achieve: I'd like to implement a simplistic  
API in our webapplication using just a plain old servlet to handle all  
API method calls. The idea is to just call this single servlet, passing  
in the required set of parameters via GET/POST, and responding with a  
either an XML data

response (text/xml), or a binary stream (zipped data) depending on the
method called.


At least with GET, You could do this with a Tapestry page class returning  
a StreamResponse in its onActivate() method. Way easier than writing a  
servlet.
More information here:  
http://tapestry.apache.org/tapestry5/guide/pagenav.html (StreampResponse  
section)
One example here:  
http://wiki.apache.org/tapestry/Tapestry5HowToCreatePieChartsInAPage. The  
example generates images, but it can be used to generate any kind of  
response.


Now, I'm lost trying to find the best way how to mix this into the  
existing Tapestry5 application. I have tried to just add the  
servlet/mapping into
web.xml but that doesn't work. I thought about extending TapestryFilter  
to ignore the API servlet's path, but the doFilter method is final  
right?


You don't need to do this. Read the Ignored paths section of  
http://tapestry.formos.com/nightly/tapestry5/guide/conf.html. Short  
version: add this method to your AppModule class:


public static void  
contributeIgnoredPathsFilter(UnorderedCollectionString configuration) {

configuration.add(/pathToYourServlet/.*);
}

PS: the configuration page in the regular Tapestry site  
(http://tapestry.apache.org/tapestry5/guide/conf.html) is empty.


Thiago

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 : Let's write a book !

2008-08-25 Thread Toby Hobson
I'd be happy to help out

Toby

2008/8/25 marcelo_Java [EMAIL PROTECTED]


 I'm want to be part of this,

 I've use tapestry for over two years now and created many J2EE solutions
 with it.
 My most recently battle was when I wanted to create a CMS using a WYSIWYG
 editor called TinyMCE with tapestry and I was stuck until I discover the
 outputraw component.

 Regards,
 Marcelo Rodrigues



 Howard Lewis Ship wrote:
 
  It is certainly an interesting idea.
 
  I think HIbernate follows a similar approach; they have a Wiki
  (Confluence, perhaps) and they scrape it to get the packaged
  documentation.
 
  We could look into running a more involved Wiki, perhaps from
  tapestry.formos.com.  Confluence would be reasonable, as I can get an
  open-source project license for any of the Atlassian products.
 
  The problem with this is oversight; writing a book in any format
  consists of a lot of dull work.  In an open community its hard to
  motivate people, without a direct stake, to do that kind of dull work.
 
  On Mon, Aug 25, 2008 at 9:03 AM, Alex Kotchnev [EMAIL PROTECTED]
 wrote:
  First of all, I apologize for the long post in advance, I couldn't
 figure
  out how to make it shorter.
 
  I've been thinking about how much I miss the unborn T5 in Action book.
  I
  spoke to Howard a while back and he said that it's unlikely that a new
  revision of the Tapestry In Action (from Manning) would happen :
  understandably, he has the framework to worry about, not the books, and
  it's
  unlikely that he'd have 1 year to take away from work and write a book.
 
  Thus, I've been trying to figure out ways to substitute for the missing
  manuscript. Here are my impressions so far:
 
  * The T5 book from PacktPub is a nice intro, but it's out of date and
  it's
  kinda shallow
  * The wiki has some nice content on it, but it's disorganized and a
  little
  too random: you may find something useful on a subject, and then,  you
  may
  not
  * The project docs are often quite useful and often times quite deep,
 but
  they don't have enough examples to put things in context
  * The tutorials are all focused around getting started, and don't have
  enough substance
  * Finally, the example apps (e.g. JumpStart, t5-acegi example, shams,
  etc)
  are extremely useful; however, (by design) there's little narrative
  surrounding them to explain how and why things work the way they do.
 
  Thus, the  bottom line is that one has to hunt down 5 different
 resources
  (possibly more) to pull together a coherent picture , especially when
 one
  goes deeper than the getting started stage.
 
  Now, I clearly don't know enough about T5 yet to write a book myself (as
  much as that sounds appealing to the ego) and it's unlikely that I could
  possibly dedicate the time and effort to do it all. So, I had the idea
  for a
  while that it would be extremely cool and useful if a bunch of the
 people
  interested in T5 could get together (incl. myself) and write a book on
  the
  subject. Tim Sweetser jumped in with the idea on the IRC channel that we
  could do a collaborative online book :  put together a rough outline
 of
  the potential content (chapter and section-wise), then let users
  contribute
  to the effort by filling in the blanks (with some editorial oversight).
  So,
  if something like this were possible, a bunch of people can get their
  minds
  together, each one contribute a chapter or two and kick off the effort.
  This
  way, each one person can focus on a subset of the problem, describe it
 in
  sufficient depth (e.g. research the areas that he/she is unfamiliar
  with),
  and not weigh down anyone in particular with an enormous amount of
 effort
  (such as writing a whole book).
 
  Surveying the landscape, similar things already exist. Tim Sweetser
  mentioned that Django did something like this. I know that Grails has
  quite
  a thorough user manual that covers most of the important areas of the
  framework. I also remember bumping into the PHP manual where people
 could
  comment and add relevant examples and such. So, in conclusion, this is
  possible, people have definitely done it, and it's HUGE for the
 community
  around the project.
 
  So, the next question is, how should something like this be done ?
  * The Wiki seems like a no brainer to start with, add the TOC and then
  allow
  people to contribute. The potential problem with it is that code and the
  examples can easily become stale. I know that the examples of the Grails
  user manual are somehow compiled and checked that they run before a new
  version of the manual is published.
  * Another option seems to be putting a bunch of Docbook files in SVN and
  collaborating through SVN to move the book forward. The upside of doing
  something like this is that it gives us an immediate perk of being able
  to
  export a printable version of the book. Downside is that contributing to
  the
  book is not all that easy (e.g. some DocBook knowledge 

Re: T5 : Let's write a book !

2008-08-25 Thread Alex Kotchnev
This is great, we have at least a bunch of people who would like to
contribute. Any comments on the last couple of questions from my post :


   2. Is there an existing place where this effort can be channeled
 better,
   instead of creating something new ?


   I still don't know the answer to this question. One option would be to
try to enhance the existing docs, but it seems that the two will have a
slightly different purpose. The docs try to deliver as much punch as
possible within a couple of pages, whereas the book will probably have to be
a little bit more explanatory.


   3. If this could be a new effort (e.g. a project tapestry-doc,
 maybe??),
   what are any additional requirements for doing it (in addition to some
  of
   the ones listed above).


   Would it be an option to have an SVN component in the Tapestry
repository, or would this be harder than necessary (e.g. overhead of
Tapestry being an apache project) ? Any comments on using Google code for
this ( they already have a wiki and an issue tracker for each project) ?



   4. If this is to be done, what's the best way of doing it ? I'll
  research
   to
   see if I can find out how Django did their, but general feedback 
 ideas
   on
   the technicalities would be very useful. E.g. how do people
 collaborate
   best
   on writing a book ? Is there an existing service that might make this
   easier


   Has anyone written a book or collaborated with a couple of other people
in writing one (other than Howard :-) ). Do you know personally anyone who
has such experience ( I plan to ping Geertjan Wielenga from the NetBeans
community to see if he can give me some advice) ? Any ideas of how we can
handle the code in the book (to make sure it always works) ?

   Would the user list be the best place to keep the discussion going or
would this be an annoyance to everyone else ?

   I guess the easiest start would be to post some kind of outline of the
book table of contents on the T5 wiki. While we're coming up with that we
should probably figure out the answers to the questions above, as I don't
think the wiki is the ultimate place to keep this.

Cheers,

Alex Kotchnev


Re: T5 : Expanding Messages Catalog for localization from arbitrary source

2008-08-25 Thread Inge Solvoll
Ok, thanks, I'll try that! I already tried the following in my class that
extends AbstractMessages:

@Inject
private HttpServletRequest request;

@ApplicationState
private User user;

Which didn't work, both were null. But what your saying is that these
objects are not possible to inject in this scope, but RequestGlobals is, so
the following will work?

@Inject
private RequestGlobals requestGlobals

Regards
Inge

On Mon, Aug 25, 2008 at 3:57 PM, Hannes Heijkenskjöld 
[EMAIL PROTECTED] wrote:

 Hi Inge,

 glad to have been able to help you!

 For your current problem, I can see two immediate solutions.

 1. Store your user object as an ASO and inject ApplicationStateManager into
 your Messages implementation. Get the user object instance by calling
 applicationStateManager.get(UserObject.class).

 2. Inject RequestGlobals in your Messages implementation. Then you can get
 the request by calling requestGlobals.getHTTPServletRequest().

 I hope this helps

 /Hannes

 Inge Solvoll skrev:

  Hi, Hannes!

 I tried your implementation, and it worked right away, I just returned the
 value TESTING TESTING from my DbMessages class that extends Abstract
 Messages.

 But, what I need is for the valueForKey(String key) method to be aware of
 the languageId/customerId of the currently logged in user. In all my other
 pages, I get this through injecting the request and getting my user object
 from HttpSession. Alternatively this can be moved to an ASO, but I haven't
 taken the time to do that yet.

 I've tried injecting HttpServletRequest and ApplicationState on all the
 classes listed in the implementation from Hannes, but none of them work
 (only null values). How can I make information from the current user
 session
 available to my AbstractMessages implementation?

 Regards

 Inge

 On Wed, Apr 16, 2008 at 10:22 AM, Hannes Heijkenskjöld 
 [EMAIL PROTECTED] wrote:

  Great!

 Glad I could help you. :-)

 /Hannes

 Michael Capper skrev:

  Thanks Hannes!

 I tried the route with the Decorator once, and ended up having to write
 some
 java-code into the interceptor via the BodyBuilder  'twas not nice.

 Your example worked great, i only had to pass some more Services
 (AssetSource to get the URLs, my ProjectContextProvider to get the
 ResourceBundles for my text) into the build-Method in AppModule, then i
 could return the value for a Message-Key from the bundles, or if not
 existant, from the fallbackMessages.

 Cheers,
 Mike


 Hannes Heijkenskjöld wrote:

  Hi

 I have recently wondered about the same, and have now built something
 that after much trial and error now works.

 Basically, I have created a Messages implementation that wraps both a
 tapestry Messages object and our own database messages. If a message is
 not
 found in our database, the default Messages object is queried.

 To get Tapestry to use my Messages implementation i had to decorate the
 ComponentMessagesSource (and ValidationMessagesSource), since it is not
 possible to replace the one in Tapestry. I think I read about
 decorating
 services here:
 http://tapestry.apache.org/tapestry5/tapestry-ioc/decorator.html and
 on
 the mailing list.

 My messages source service doesn't implement the
 ComponentMessagesSource
 interface. I use an interception object for that. Hopefully you can
 understand how it works from my example code below:

 public class CommonsMessages extends AbstractMessages {

private Messages fallbackMessages;

protected String valueForKey(final key) {
   ... logic to get key from db, use fallbackMessages as fallback...
}

 }

 -

 public class CommonsMessagesSource {

public Messages getMessages(Locale locale, Messages
 fallbackMessages)
 {
   ... code that creates a CommonsMessages object, with
 fallbackMessages ...
}
 }

 

 // This is the decorating class
 public class CommonsComponentMessagesSourceInterceptor implements
ComponentMessagesSource {

private final CommonsMessagesSource service;
private final ComponentMessagesSource delegate;

public CommonsComponentMessagesSourceInterceptor
(CommonsMessagesSource service, ComponentMessagesSource
 delegate)
{
this.service = service;
this.delegate = delegate;
}

public Messages getMessages(ComponentModel componentModel, Locale
 locale) {

return service.getMessages(locale,
delegate.getMessages(componentModel, locale));
}

// Not sure about how I should handle this one
public void addInvalidationListener(
InvalidationListener invalidationlistener) {
delegate.addInvalidationListener(invalidationlistener);
}
 }

 ---

 In AppModule.java:

// Method for instantiating and configuring the custom messages
 source
public static CommonsMessagesSource buildCommonsMessagesSource()
{
CommonsMessagesSource messagesSource = new
 CommonsMessagesSource();
return messagesSource;
}

// Method that decorates the default 

[T4.1] Interacting with Tap form from separate widget

2008-08-25 Thread Jim

Hello,

I have a complex JavaScript input-widget, and I want to tie its value 
into a Tapestry form.  I made a @Hidden component, gave it an ID, and 
used JavaScript to set its value based on my widget.  My tapestry 
listener kept getting the string true, regardless of the value being 
set to the @Hidden, presumably because I was not prepending the value 
with S.  Is there a clean way to cooperate with a Tapestry form, i.e. 
through an API?  Was looking for something in the dojo-based library 
Tapestry uses, something like tapestry.html.setStringValue(), but 
couldn't find anything.


I'm fine resorting to cycle.getParameter(..), but wanted to check.

Thanks,
Jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] Announce - TreeGrid component

2008-08-25 Thread Weisu

Hi Gabriel, I am trying to use your treegrid component in T5.0.14. Do you
have a simple example how to use it in T5?
Thanks in advance!
Weisu.

Gabriel Landais wrote:
 
 Hi,
  I've just released an early version of a tree grid component. It is 
 available via SVN on Google Code 
 (http://code.google.com/p/tapestry5-treegrid/source).
  The code is based upon sstree, and as an early release, code is ugly 
 and without comment yet...
 
  Gabriel
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-T5--Announce---TreeGrid-component-tp14617758p19154603.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]