Re: date field as 3 drop down fields

2013-04-17 Thread Bård Magnus Kvalheim
True that - learned the hard way :(

Using a threadlocal is quite convenient as well.
http://stackoverflow.com/questions/817856/when-and-how-should-i-use-a-threadlocal-variable
http://docs.oracle.com/javase/7/docs/api/java/lang/ThreadLocal.html



On Thu, Apr 18, 2013 at 12:15 AM, Lance Java wrote:

> Unfortunately, java.text.SimpleDateFormat is not thread safe so can't be
> declared as static. You'll need to use a local variable each time to be
> thread safe unfortunately.
> On 17 Apr 2013 05:06, "Jeshurun Daniel"  wrote:
>
> > One more time with the links
> >
> >
> http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Date-Field-with-day-month-year-and-datepicker-component-td4618810.html
> >
> >
> http://blog.jeshurun.ca/technology/tapestry-5-datefield-as-3-select-dropdowns
> >
> >
> >
> >
> > 
> >  From: Jeshurun Daniel 
> > To: Tapestry users 
> > Sent: Tuesday, April 16, 2013 9:58:58 PM
> > Subject: Re: date field as 3 drop down fields
> >
> >
> >
> > I had the same requirement today and found a version here in the mailing
> > lists, but had some problems with it when used inside a loop.
> >
> > So I rolled my own and posted the code here. It hasn't been tested
> > thoroughly, please feel free to suggest improvements to the code.
> >
> > 
> >
> > From: "captain_rhino" 
> > To: users@tapestry.apache.org
> > Sent: Tuesday, 6 December, 2011 3:25:48 AM
> > Subject: date field as 3 drop down fields
> >
> > I am looking to implement a date field as 3 separate drop downs lists of
> > day,
> > month and year in T5.   Has anyone already developed a component that
> does
> > this?
> >
> > --
> > View this message in context:
> >
> http://tapestry.1045711.n5.nabble.com/date-field-as-3-drop-down-fields-tp5051531p5051531.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
>


Re: date field as 3 drop down fields

2013-04-17 Thread Lance Java
Unfortunately, java.text.SimpleDateFormat is not thread safe so can't be
declared as static. You'll need to use a local variable each time to be
thread safe unfortunately.
On 17 Apr 2013 05:06, "Jeshurun Daniel"  wrote:

> One more time with the links
>
> http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Date-Field-with-day-month-year-and-datepicker-component-td4618810.html
>
> http://blog.jeshurun.ca/technology/tapestry-5-datefield-as-3-select-dropdowns
>
>
>
>
> 
>  From: Jeshurun Daniel 
> To: Tapestry users 
> Sent: Tuesday, April 16, 2013 9:58:58 PM
> Subject: Re: date field as 3 drop down fields
>
>
>
> I had the same requirement today and found a version here in the mailing
> lists, but had some problems with it when used inside a loop.
>
> So I rolled my own and posted the code here. It hasn't been tested
> thoroughly, please feel free to suggest improvements to the code.
>
> 
>
> From: "captain_rhino" 
> To: users@tapestry.apache.org
> Sent: Tuesday, 6 December, 2011 3:25:48 AM
> Subject: date field as 3 drop down fields
>
> I am looking to implement a date field as 3 separate drop downs lists of
> day,
> month and year in T5.   Has anyone already developed a component that does
> this?
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/date-field-as-3-drop-down-fields-tp5051531p5051531.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org


returning StreamPageContent causes ajax error

2013-04-17 Thread Bryan Lewis
Recently I started using the StreamPageContent feature to show the user an
error message without losing the original page's address.  For example:

Object onActivate(Policy p)
{
if (p == null) {
return new StreamPageContent(ErrorPage.class, "Invalid item");
}
}

My page layout contains a search component using a zone, merely to allow
displaying a "no results found" message without having to redraw the entire
page:


  ${error}
  ...


A problem occurred today when the two messages happened together, an
invalid item (because it had been deleted while the user was sitting in the
page) and a no-results search.  This caused an ajax dump on the page (which
the user described as "a bunch of weird colored boxes all over the place"
:-)  and an exception in the log:

org.apache.tapestry5.runtime.ComponentEventException: A component event
handler method returned the value
org.apache.tapestry5.services.StreamPageContent@6e65603b. Return type
org.apache.tapestry5.services.StreamPageContent can not be handled.
availableValues: AvailableValues[Configured return types: java.lang.Class,
java.lang.String,
org.apache.tapestry5.Link,
org.apache.tapestry5.StreamResponse,
org.apache.tapestry5.ajax.MultiZoneUpdate,
org.apache.tapestry5.json.JSONArray,
org.apache.tapestry5.json.JSONObject,
org.apache.tapestry5.runtime.Component,
org.apache.tapestry5.runtime.RenderCommand,
org.apache.tapestry5.services.HttpError]


I can't find a work-around for me to catch this situation.  Maybe
StreamPageContent should be added to the set of configured return types?

Thanks.


Re: Selective caching of resources

2013-04-17 Thread Nenad Nikolic
Thank you for the quick response! I was considering such an approach,
implementing a separate dispatcher at first but figured it would just be
too much work and tapestry already provides the features and infrastructure
i need for delivering assets. I seems that i wasn't looking at the problem
i need to solve good enough.

But still, if it would be possible to somehow override the
SRSCachingInterceptor's implementation of isCachable i think i would
actually have a valid solution.
I could have a special handling for the resources with the custom extension
and just not cache them.

Is it possible to do this? Am i missing something in thinking this?

Thanks again.



On Wed, Apr 17, 2013 at 7:05 PM, Howard Lewis Ship  wrote:

> Generally speaking, assets are expected to be static (that is, unchanging)
> and global, which is why there's so much caching going on.
>
> I would say that you should implement your own Dispatcher (contributed to
> the MasterDispatcher) service and just take control of this, using the same
> techniques you might use to server content out of a database. It ends up
> being more like a servlet at that point (Dispatcher is very similar to
> HttpServlet) and you have control over everything that happens: you control
> the cache, the URL format, the works.  With a little bit of effort, you can
> probably leverage some of the features of Tapestry's asset pipeline
> (minimization, CSS rewriting in 5.4, etc.), by making your data implement
> StreamableResource.
>
>
> On Wed, Apr 17, 2013 at 5:33 PM, Nenad Nikolic  >wrote:
>
> > Hello, i'm struggling with delivering a transformed resource for each
> > request.
> >
> > Here is exactly what i mean:
> >
> > There are two requests expected to hit the app.
> > 1) a request containing a unique identifier and some other values as
> > request parameters.
> > This request will hit a dispatcher which will store the data into
> > hazelcast, and render a response which will contain urls to two assets
> (one
> > js one css) with a request parameter (the unique identifier).
> > Here is how an example response looks like:
> >
> > 
> > 
> > 
> >
> >
> http://localhost:8080/app/assets/1.0.0-SNAPSHOT/ccdd/template.nmjs?trid=unique_identifier
> > 
> > 
> > 
> > 
> >
> >
> http://localhost:8080/app/assets/1.0.0-SNAPSHOT/ccdd/template.nmcss?trid=unique_identifier
> > 
> > 
> > 
> >
> > This is a machine-to-machine request. The system that made the request
> will
> > give the asset urls to the client when rendering a webpage.
> >
> > 2) the second request is the one coming from the client. It is a request
> > for the actuall assets. It should return the asset but replace the
> > placeholders within the asset with values from hazelcast.
> > I currently have an AssetHandler mapped to the "ccdd" path.
> > In the AssetHandler i get the request parameter and get the values from
> the
> > hazelcast map. Then the values are stored on the environment stack for my
> > ResourceTransformer to access. This whole thing is working and i get a
> > properly transformed asset for the first request.
> >
> > My problem is that when the unique identifier changes the resource is not
> > transformed again.
> >
> > So my questions are:
> >
> > Is it possible to cache resources selectively?
> > Am i doing this in a completely shitty way?
> >
> > I hope that my explanation is understandable. Thx in advance for any
> > responses!
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>


Re: Selective caching of resources

2013-04-17 Thread Howard Lewis Ship
Generally speaking, assets are expected to be static (that is, unchanging)
and global, which is why there's so much caching going on.

I would say that you should implement your own Dispatcher (contributed to
the MasterDispatcher) service and just take control of this, using the same
techniques you might use to server content out of a database. It ends up
being more like a servlet at that point (Dispatcher is very similar to
HttpServlet) and you have control over everything that happens: you control
the cache, the URL format, the works.  With a little bit of effort, you can
probably leverage some of the features of Tapestry's asset pipeline
(minimization, CSS rewriting in 5.4, etc.), by making your data implement
StreamableResource.


On Wed, Apr 17, 2013 at 5:33 PM, Nenad Nikolic wrote:

> Hello, i'm struggling with delivering a transformed resource for each
> request.
>
> Here is exactly what i mean:
>
> There are two requests expected to hit the app.
> 1) a request containing a unique identifier and some other values as
> request parameters.
> This request will hit a dispatcher which will store the data into
> hazelcast, and render a response which will contain urls to two assets (one
> js one css) with a request parameter (the unique identifier).
> Here is how an example response looks like:
>
> 
> 
> 
>
> http://localhost:8080/app/assets/1.0.0-SNAPSHOT/ccdd/template.nmjs?trid=unique_identifier
> 
> 
> 
> 
>
> http://localhost:8080/app/assets/1.0.0-SNAPSHOT/ccdd/template.nmcss?trid=unique_identifier
> 
> 
> 
>
> This is a machine-to-machine request. The system that made the request will
> give the asset urls to the client when rendering a webpage.
>
> 2) the second request is the one coming from the client. It is a request
> for the actuall assets. It should return the asset but replace the
> placeholders within the asset with values from hazelcast.
> I currently have an AssetHandler mapped to the "ccdd" path.
> In the AssetHandler i get the request parameter and get the values from the
> hazelcast map. Then the values are stored on the environment stack for my
> ResourceTransformer to access. This whole thing is working and i get a
> properly transformed asset for the first request.
>
> My problem is that when the unique identifier changes the resource is not
> transformed again.
>
> So my questions are:
>
> Is it possible to cache resources selectively?
> Am i doing this in a completely shitty way?
>
> I hope that my explanation is understandable. Thx in advance for any
> responses!
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com


Selective caching of resources

2013-04-17 Thread Nenad Nikolic
Hello, i'm struggling with delivering a transformed resource for each
request.

Here is exactly what i mean:

There are two requests expected to hit the app.
1) a request containing a unique identifier and some other values as
request parameters.
This request will hit a dispatcher which will store the data into
hazelcast, and render a response which will contain urls to two assets (one
js one css) with a request parameter (the unique identifier).
Here is how an example response looks like:




http://localhost:8080/app/assets/1.0.0-SNAPSHOT/ccdd/template.nmjs?trid=unique_identifier




http://localhost:8080/app/assets/1.0.0-SNAPSHOT/ccdd/template.nmcss?trid=unique_identifier




This is a machine-to-machine request. The system that made the request will
give the asset urls to the client when rendering a webpage.

2) the second request is the one coming from the client. It is a request
for the actuall assets. It should return the asset but replace the
placeholders within the asset with values from hazelcast.
I currently have an AssetHandler mapped to the "ccdd" path.
In the AssetHandler i get the request parameter and get the values from the
hazelcast map. Then the values are stored on the environment stack for my
ResourceTransformer to access. This whole thing is working and i get a
properly transformed asset for the first request.

My problem is that when the unique identifier changes the resource is not
transformed again.

So my questions are:

Is it possible to cache resources selectively?
Am i doing this in a completely shitty way?

I hope that my explanation is understandable. Thx in advance for any
responses!


Re: Tapestry 5.4-alpha-3

2013-04-17 Thread Charlouze
I'm 100% sure that my app is not in production mode and my file is not
packaged in a JAR file.

As I said, it works well when I use the css file without the stack using
@import.


2013/4/17 Howard Lewis Ship 

> It is supposed to clear its cache if there's a change to the file.  I've
> tested that manually but don't know if there's an automated test for that.
>
> There's no chance you are running in production mode, or have the file in
> question packaged in a JAR file?  Live reload is only for files on the file
> system itself.
>
>
> On Wed, Apr 17, 2013 at 3:25 PM, Charlouze  wrote:
>
> > I explore the code of the ExtensibleJavaScriptStack class and it
> calculates
> > the asset link on first use. Maybe I can disable the checksum in URL ?
> >
> >
> > 2013/4/17 Charlouze 
> >
> > > I build my app with eclipse 3.7.2. I use the m2e plugin (1.1.0) and the
> > > m2e-wtp (0.15.3) to configure my eclipse project. I'm running the app
> > using
> > > the run jetty run plugin (1.3.3). The selected jetty version is 8.1.2.
> > >
> > > I just made a small test project (only an index page with nothing but a
> > > title and the styles.css file). I figured out where the problem is: if
> I
> > > load my styles.css through an ExtensibleJavaScriptStack it does'nt
> work,
> > > the address is not changing when I add some css rules to the file. If I
> > use
> > > @Import(stylesheet = { "context:/css/styles.css" }) on my index page,
> it
> > > works well.
> > >
> > > Should I file a bug on jira ?
> > >
> > >
> > > 2013/4/17 Howard Lewis Ship 
> > >
> > >> When you refresh your page, it *should* be building a new URL to the
> > >> updated asset.  The particulars matter here ... how exactly are you
> > >> building & running the app?
> > >>
> > >>
> > >> On Wed, Apr 17, 2013 at 9:31 AM, Charlouze  wrote:
> > >>
> > >> > Hey everyone,
> > >> >
> > >> > I have some trouble with the 5.4-alpha-3. When I add some stuff to
> my
> > >> > styles.css file, it get another address to access it (that is
> > perfectly
> > >> > normal according to the new asset feature). The problem is that if I
> > >> don't
> > >> > restart my application my pages tries to load my styles.css file
> from
> > >> the
> > >> > old address. I probably miss somthing.
> > >> >
> > >> > For your information, I'm am in development mode. I use eclipse and
> > the
> > >> run
> > >> > jetty run plugin.
> > >> >
> > >> > Charles.
> > >> >
> > >> >
> > >> > 2013/4/12 François Facon 
> > >> >
> > >> > > By the way, tapestry5-portlet is also ready to be used with 5.4.
> But
> > >> I am
> > >> > > still looking for a way to run integration tests inside Pluto with
> > >> > Gradle.
> > >> > > Perhaps the use of Arquillian with Pluto under gradle is the
> > solution.
> > >> > >
> > >> > >
> > >> > >
> > >> > > 2013/4/12 Howard Lewis Ship 
> > >> > >
> > >> > > > That's great news!
> > >> > > >
> > >> > > >
> > >> > > > On Fri, Apr 12, 2013 at 12:35 PM, François Facon <
> > >> > > francois.fa...@atos.net
> > >> > > > >wrote:
> > >> > > >
> > >> > > > > Thanks to Emmanuel, tapestry-jquery is already working fine
> with
> > >> 5.4.
> > >> > > > >
> > >> > > > >
> > >> > > > >
> > >> > > > > 2013/4/12 Howard Lewis Ship 
> > >> > > > >
> > >> > > > > > We don't control the tapestry-jquery library; I actually
> > haven't
> > >> > > looked
> > >> > > > > at
> > >> > > > > > it. I suspect it will need to be reworked significantly for
> > 5.4.
> > >> > > > > >
> > >> > > > > >
> > >> > > > > > On Fri, Apr 12, 2013 at 9:40 AM, George Christman
> > >> > > > > > wrote:
> > >> > > > > >
> > >> > > > > > > I'm just curious if Tapestry5.4 will just be integrating
> the
> > >> > > > > > > Tapestry-Jquery library?
> > >> > > > > > >
> > >> > > > > > > On Sun, Apr 7, 2013 at 10:29 AM, hantsy <
> > han...@yahoo.com.cn>
> > >> > > wrote:
> > >> > > > > > > >
> > >> > > > > > > > Created a new thread for it. Thanks
> > >> > > > > > > >
> > >> > > > > > > > On 4/7/2013 22:16, Bob Harner wrote:
> > >> > > > > > > >> Hantsy, you might want to start a separate thread. Your
> > >> > question
> > >> > > > > isn't
> > >> > > > > > > >> about 5.4-alpha-3 at all.
> > >> > > > > > > >>
> > >> > > > > > > >> On Sun, Apr 7, 2013 at 9:23 AM, hantsy <
> > >> han...@yahoo.com.cn>
> > >> > > > wrote:
> > >> > > > > > > >>
> > >> > > > > > > >>> I want to know if Tapestry has plan to integrate with
> > Java
> > >> > EE,
> > >> > > > such
> > >> > > > > > as
> > >> > > > > > > >>> how to use CDI with Tapestry, I know Tapestry has its
> DI
> > >> > > > container,
> > >> > > > > > it
> > >> > > > > > > >>> can be replaced with CDI?
> > >> > > > > > > >>>
> > >> > > > > > > >>> I have used Tapestry4 before, and know little about
> the
> > >> > newest
> > >> > > > > > > Tapestry 5.
> > >> > > > > > > >>>
> > >> > > > > > > >>>
> > >> > > > > > > >>> Hantsy
> > >> > > > > > > >>> On 4/7/2013 09:11, Saeed wrote:
> > >> > > > > > >  Great news! jQuery finally. Well done sire!
> > >> > > > > > > 
> > >> > > > > > > 

Re: Tapestry 5.4-alpha-3

2013-04-17 Thread Howard Lewis Ship
It is supposed to clear its cache if there's a change to the file.  I've
tested that manually but don't know if there's an automated test for that.

There's no chance you are running in production mode, or have the file in
question packaged in a JAR file?  Live reload is only for files on the file
system itself.


On Wed, Apr 17, 2013 at 3:25 PM, Charlouze  wrote:

> I explore the code of the ExtensibleJavaScriptStack class and it calculates
> the asset link on first use. Maybe I can disable the checksum in URL ?
>
>
> 2013/4/17 Charlouze 
>
> > I build my app with eclipse 3.7.2. I use the m2e plugin (1.1.0) and the
> > m2e-wtp (0.15.3) to configure my eclipse project. I'm running the app
> using
> > the run jetty run plugin (1.3.3). The selected jetty version is 8.1.2.
> >
> > I just made a small test project (only an index page with nothing but a
> > title and the styles.css file). I figured out where the problem is: if I
> > load my styles.css through an ExtensibleJavaScriptStack it does'nt work,
> > the address is not changing when I add some css rules to the file. If I
> use
> > @Import(stylesheet = { "context:/css/styles.css" }) on my index page, it
> > works well.
> >
> > Should I file a bug on jira ?
> >
> >
> > 2013/4/17 Howard Lewis Ship 
> >
> >> When you refresh your page, it *should* be building a new URL to the
> >> updated asset.  The particulars matter here ... how exactly are you
> >> building & running the app?
> >>
> >>
> >> On Wed, Apr 17, 2013 at 9:31 AM, Charlouze  wrote:
> >>
> >> > Hey everyone,
> >> >
> >> > I have some trouble with the 5.4-alpha-3. When I add some stuff to my
> >> > styles.css file, it get another address to access it (that is
> perfectly
> >> > normal according to the new asset feature). The problem is that if I
> >> don't
> >> > restart my application my pages tries to load my styles.css file from
> >> the
> >> > old address. I probably miss somthing.
> >> >
> >> > For your information, I'm am in development mode. I use eclipse and
> the
> >> run
> >> > jetty run plugin.
> >> >
> >> > Charles.
> >> >
> >> >
> >> > 2013/4/12 François Facon 
> >> >
> >> > > By the way, tapestry5-portlet is also ready to be used with 5.4. But
> >> I am
> >> > > still looking for a way to run integration tests inside Pluto with
> >> > Gradle.
> >> > > Perhaps the use of Arquillian with Pluto under gradle is the
> solution.
> >> > >
> >> > >
> >> > >
> >> > > 2013/4/12 Howard Lewis Ship 
> >> > >
> >> > > > That's great news!
> >> > > >
> >> > > >
> >> > > > On Fri, Apr 12, 2013 at 12:35 PM, François Facon <
> >> > > francois.fa...@atos.net
> >> > > > >wrote:
> >> > > >
> >> > > > > Thanks to Emmanuel, tapestry-jquery is already working fine with
> >> 5.4.
> >> > > > >
> >> > > > >
> >> > > > >
> >> > > > > 2013/4/12 Howard Lewis Ship 
> >> > > > >
> >> > > > > > We don't control the tapestry-jquery library; I actually
> haven't
> >> > > looked
> >> > > > > at
> >> > > > > > it. I suspect it will need to be reworked significantly for
> 5.4.
> >> > > > > >
> >> > > > > >
> >> > > > > > On Fri, Apr 12, 2013 at 9:40 AM, George Christman
> >> > > > > > wrote:
> >> > > > > >
> >> > > > > > > I'm just curious if Tapestry5.4 will just be integrating the
> >> > > > > > > Tapestry-Jquery library?
> >> > > > > > >
> >> > > > > > > On Sun, Apr 7, 2013 at 10:29 AM, hantsy <
> han...@yahoo.com.cn>
> >> > > wrote:
> >> > > > > > > >
> >> > > > > > > > Created a new thread for it. Thanks
> >> > > > > > > >
> >> > > > > > > > On 4/7/2013 22:16, Bob Harner wrote:
> >> > > > > > > >> Hantsy, you might want to start a separate thread. Your
> >> > question
> >> > > > > isn't
> >> > > > > > > >> about 5.4-alpha-3 at all.
> >> > > > > > > >>
> >> > > > > > > >> On Sun, Apr 7, 2013 at 9:23 AM, hantsy <
> >> han...@yahoo.com.cn>
> >> > > > wrote:
> >> > > > > > > >>
> >> > > > > > > >>> I want to know if Tapestry has plan to integrate with
> Java
> >> > EE,
> >> > > > such
> >> > > > > > as
> >> > > > > > > >>> how to use CDI with Tapestry, I know Tapestry has its DI
> >> > > > container,
> >> > > > > > it
> >> > > > > > > >>> can be replaced with CDI?
> >> > > > > > > >>>
> >> > > > > > > >>> I have used Tapestry4 before, and know little about the
> >> > newest
> >> > > > > > > Tapestry 5.
> >> > > > > > > >>>
> >> > > > > > > >>>
> >> > > > > > > >>> Hantsy
> >> > > > > > > >>> On 4/7/2013 09:11, Saeed wrote:
> >> > > > > > >  Great news! jQuery finally. Well done sire!
> >> > > > > > > 
> >> > > > > > > 
> >> > > > > > > 
> >> > > > > > > 
> >> > > > > > > 
> >> > > > > > >  On Sat, Apr 6, 2013 at 11:45 PM, Howard Lewis Ship <
> >> > > > > > hls...@gmail.com>
> >> > > > > > > >>> wrote:
> >> > > > > > > > Hot off the presses!  The latest preview release of
> >> > Tapestry,
> >> > > > > > > >>> 5.4-alpha-3,
> >> > > > > > > > is now available.
> >> > > > > > > >
> >> > > > > > > > Point your build tool of choice at the Maven
> repository:
> >> > > > > > > >

Re: Tapestry 5.4-alpha-3

2013-04-17 Thread Charlouze
I explore the code of the ExtensibleJavaScriptStack class and it calculates
the asset link on first use. Maybe I can disable the checksum in URL ?


2013/4/17 Charlouze 

> I build my app with eclipse 3.7.2. I use the m2e plugin (1.1.0) and the
> m2e-wtp (0.15.3) to configure my eclipse project. I'm running the app using
> the run jetty run plugin (1.3.3). The selected jetty version is 8.1.2.
>
> I just made a small test project (only an index page with nothing but a
> title and the styles.css file). I figured out where the problem is: if I
> load my styles.css through an ExtensibleJavaScriptStack it does'nt work,
> the address is not changing when I add some css rules to the file. If I use
> @Import(stylesheet = { "context:/css/styles.css" }) on my index page, it
> works well.
>
> Should I file a bug on jira ?
>
>
> 2013/4/17 Howard Lewis Ship 
>
>> When you refresh your page, it *should* be building a new URL to the
>> updated asset.  The particulars matter here ... how exactly are you
>> building & running the app?
>>
>>
>> On Wed, Apr 17, 2013 at 9:31 AM, Charlouze  wrote:
>>
>> > Hey everyone,
>> >
>> > I have some trouble with the 5.4-alpha-3. When I add some stuff to my
>> > styles.css file, it get another address to access it (that is perfectly
>> > normal according to the new asset feature). The problem is that if I
>> don't
>> > restart my application my pages tries to load my styles.css file from
>> the
>> > old address. I probably miss somthing.
>> >
>> > For your information, I'm am in development mode. I use eclipse and the
>> run
>> > jetty run plugin.
>> >
>> > Charles.
>> >
>> >
>> > 2013/4/12 François Facon 
>> >
>> > > By the way, tapestry5-portlet is also ready to be used with 5.4. But
>> I am
>> > > still looking for a way to run integration tests inside Pluto with
>> > Gradle.
>> > > Perhaps the use of Arquillian with Pluto under gradle is the solution.
>> > >
>> > >
>> > >
>> > > 2013/4/12 Howard Lewis Ship 
>> > >
>> > > > That's great news!
>> > > >
>> > > >
>> > > > On Fri, Apr 12, 2013 at 12:35 PM, François Facon <
>> > > francois.fa...@atos.net
>> > > > >wrote:
>> > > >
>> > > > > Thanks to Emmanuel, tapestry-jquery is already working fine with
>> 5.4.
>> > > > >
>> > > > >
>> > > > >
>> > > > > 2013/4/12 Howard Lewis Ship 
>> > > > >
>> > > > > > We don't control the tapestry-jquery library; I actually haven't
>> > > looked
>> > > > > at
>> > > > > > it. I suspect it will need to be reworked significantly for 5.4.
>> > > > > >
>> > > > > >
>> > > > > > On Fri, Apr 12, 2013 at 9:40 AM, George Christman
>> > > > > > wrote:
>> > > > > >
>> > > > > > > I'm just curious if Tapestry5.4 will just be integrating the
>> > > > > > > Tapestry-Jquery library?
>> > > > > > >
>> > > > > > > On Sun, Apr 7, 2013 at 10:29 AM, hantsy 
>> > > wrote:
>> > > > > > > >
>> > > > > > > > Created a new thread for it. Thanks
>> > > > > > > >
>> > > > > > > > On 4/7/2013 22:16, Bob Harner wrote:
>> > > > > > > >> Hantsy, you might want to start a separate thread. Your
>> > question
>> > > > > isn't
>> > > > > > > >> about 5.4-alpha-3 at all.
>> > > > > > > >>
>> > > > > > > >> On Sun, Apr 7, 2013 at 9:23 AM, hantsy <
>> han...@yahoo.com.cn>
>> > > > wrote:
>> > > > > > > >>
>> > > > > > > >>> I want to know if Tapestry has plan to integrate with Java
>> > EE,
>> > > > such
>> > > > > > as
>> > > > > > > >>> how to use CDI with Tapestry, I know Tapestry has its DI
>> > > > container,
>> > > > > > it
>> > > > > > > >>> can be replaced with CDI?
>> > > > > > > >>>
>> > > > > > > >>> I have used Tapestry4 before, and know little about the
>> > newest
>> > > > > > > Tapestry 5.
>> > > > > > > >>>
>> > > > > > > >>>
>> > > > > > > >>> Hantsy
>> > > > > > > >>> On 4/7/2013 09:11, Saeed wrote:
>> > > > > > >  Great news! jQuery finally. Well done sire!
>> > > > > > > 
>> > > > > > > 
>> > > > > > > 
>> > > > > > > 
>> > > > > > > 
>> > > > > > >  On Sat, Apr 6, 2013 at 11:45 PM, Howard Lewis Ship <
>> > > > > > hls...@gmail.com>
>> > > > > > > >>> wrote:
>> > > > > > > > Hot off the presses!  The latest preview release of
>> > Tapestry,
>> > > > > > > >>> 5.4-alpha-3,
>> > > > > > > > is now available.
>> > > > > > > >
>> > > > > > > > Point your build tool of choice at the Maven repository:
>> > > > > > > >
>> > > > > > > >
>> > > > > > > >>>
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> https://repository.apache.org/content/repositories/orgapachetapestry-072/
>> > > > > > > > Binary and source archives:
>> > > > > > > >
>> > > > > > > > http://people.apache.org/~hlship/tapestry-releases/
>> > > > > > > >
>> > > > > > > > What's new?
>> > > > > > > >
>> > > > > > > > So much, I've kind of lost track; the main changes are:
>> > > > > > > >
>> > > > > > > > Most assets are now accessed using a URL that
>> incorporates
>> > a
>> > > > > > Adler32
>> > > > > > > > checksum of the asset content.  Prior versio

Re: Long running process in onSuccess causing Life Cycle methods to rerun.

2013-04-17 Thread Dmitry Gusev
On Wed, Apr 17, 2013 at 4:43 PM, George Christman
wrote:

> Cezary, I would agree with your response if it didn't work perfectly fine
> in my test page using the same proxy settings. Anyhow, I removed the proxy
> all together and the behavior remains the same. Do you have any suggestions
> in regards to debugging this issue?
>
> I also agree this should be put on it's own thread, I'm just not aware of
> away with tapestry to push the response back to the UI after the thread has
> completed.
>

You would push response back as you would do with any other web framework :)
There are two options -- poll or push. You can push from server to
client-size using CometD or WebSockets,
or you can poll from client side and check if results are ready on server.
For instance, you may store results to DB when your job completed and
lookup results from DB on poll requests.

You can use ZoneRefresh, or just do AJAX call, say, with jQuery and return
results in response to display them on client-side using tapestry
client-side API or your custom javascript.


> On Tue, Apr 16, 2013 at 4:21 PM, Cezary Biernacki  >wrote:
>
> > Hi George,
> > you answered your own question.  Your proxy waits for response and after
> > some time it fails the request and issues new one. It is a typical
> > behaviour of the proxy, and it is designed to recover from failures or
> > temporary unresponsive servers. Check documentation of your proxy to see
> > how to change default timeout value. However setting this too high is
> not a
> > good solution. Browser also implement some maximum wait time (AFAIK
> around
> > 6 minutes). Even without software timeouts after few minutes a user
> > probably will get impatient and click refresh thinking that connection
> > failed.
> >
> > The proper solution would be to start long running process on a separate
> > thread (e.g. by using ParallelExecutor) or maybe even a separate machine,
> > return request immediately and provide some kind of feedback (e.g. via
> AJAX
> > polling) about process progress.
> >
> > Best regards,
> > Cezary
> >
> >
> > On Tue, 16 Apr 2013 14:08:14 -0400 George Christman <
> > gchrist...@cardaddy.com> wrote:
> >
> >> I ended up setting up a test app to learn that the issue was on my end
> >> and that the test app worked as intended. I setup Charlies Proxy and
> >> discovered after 30.0 seconds exact, it fails the request and creates
> >> a new request. I've disabled all my JS, css and can not figure out the
> >> underlying issue. Does anybody happen to know what might be happening?
> >>
> >> On Mon, Apr 15, 2013 at 7:56 PM, Cezary Biernacki 
> >> wrote:
> >>
> >>> Are you sure that the second request is not generated by e.g. a reverse
> >>> proxy?
> >>>
> >>>
> >>> On Mon, Apr 15, 2013 at 7:59 PM, George Christman
> >>> **wrote:
> >>>
> >>>  Hello, I have a long running process in my onSuccess method. I'm
>  noticing my onActivate and onValidate methods are being called
>  multiple times before the onSuccess method has actually completed. I
>  was able to successfully reproduce this using Thread.sleep in the
>  following example. Does anybody know why this my be happening?
> 
>  onActivate() {
>  System.out.println("**onActivate");
>  }
> 
>  onValidate() {
>  System.out.println("**onValidate");
>  }
> 
>  Object onSuccess() throws Exception {
>   if(ApplicationActionEnum.**GENERATE_PO == this.action) {
>   try {
>   Thread.sleep(6);
>   } catch (Exception e) {
> 
>   }
>   }
>   System.out.println("onSuccess"**);
>   return Index.class;
>   }
> 
>  My output.
> 
>  onActivate
>  pnValidate
>  onActivate
>  pnValidate
>  OnSuccess
> 
>  --**--**
>  -
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
> users-unsubscr...@tapestry.apache.org>
>  For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 
> >>
> >>
> >
> >
> > --**--**-
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
> users-unsubscr...@tapestry.apache.org>
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Long running process in onSuccess causing Life Cycle methods to rerun.

2013-04-17 Thread George Christman
Cezary, I would agree with your response if it didn't work perfectly fine
in my test page using the same proxy settings. Anyhow, I removed the proxy
all together and the behavior remains the same. Do you have any suggestions
in regards to debugging this issue?

I also agree this should be put on it's own thread, I'm just not aware of
away with tapestry to push the response back to the UI after the thread has
completed.


On Tue, Apr 16, 2013 at 4:21 PM, Cezary Biernacki wrote:

> Hi George,
> you answered your own question.  Your proxy waits for response and after
> some time it fails the request and issues new one. It is a typical
> behaviour of the proxy, and it is designed to recover from failures or
> temporary unresponsive servers. Check documentation of your proxy to see
> how to change default timeout value. However setting this too high is not a
> good solution. Browser also implement some maximum wait time (AFAIK around
> 6 minutes). Even without software timeouts after few minutes a user
> probably will get impatient and click refresh thinking that connection
> failed.
>
> The proper solution would be to start long running process on a separate
> thread (e.g. by using ParallelExecutor) or maybe even a separate machine,
> return request immediately and provide some kind of feedback (e.g. via AJAX
> polling) about process progress.
>
> Best regards,
> Cezary
>
>
> On Tue, 16 Apr 2013 14:08:14 -0400 George Christman <
> gchrist...@cardaddy.com> wrote:
>
>> I ended up setting up a test app to learn that the issue was on my end
>> and that the test app worked as intended. I setup Charlies Proxy and
>> discovered after 30.0 seconds exact, it fails the request and creates
>> a new request. I've disabled all my JS, css and can not figure out the
>> underlying issue. Does anybody happen to know what might be happening?
>>
>> On Mon, Apr 15, 2013 at 7:56 PM, Cezary Biernacki 
>> wrote:
>>
>>> Are you sure that the second request is not generated by e.g. a reverse
>>> proxy?
>>>
>>>
>>> On Mon, Apr 15, 2013 at 7:59 PM, George Christman
>>> **wrote:
>>>
>>>  Hello, I have a long running process in my onSuccess method. I'm
 noticing my onActivate and onValidate methods are being called
 multiple times before the onSuccess method has actually completed. I
 was able to successfully reproduce this using Thread.sleep in the
 following example. Does anybody know why this my be happening?

 onActivate() {
 System.out.println("**onActivate");
 }

 onValidate() {
 System.out.println("**onValidate");
 }

 Object onSuccess() throws Exception {
  if(ApplicationActionEnum.**GENERATE_PO == this.action) {
  try {
  Thread.sleep(6);
  } catch (Exception e) {

  }
  }
  System.out.println("onSuccess"**);
  return Index.class;
  }

 My output.

 onActivate
 pnValidate
 onActivate
 pnValidate
 OnSuccess

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



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


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: Tapestry 5.4-alpha-3

2013-04-17 Thread Charlouze
I build my app with eclipse 3.7.2. I use the m2e plugin (1.1.0) and the
m2e-wtp (0.15.3) to configure my eclipse project. I'm running the app using
the run jetty run plugin (1.3.3). The selected jetty version is 8.1.2.

I just made a small test project (only an index page with nothing but a
title and the styles.css file). I figured out where the problem is: if I
load my styles.css through an ExtensibleJavaScriptStack it does'nt work,
the address is not changing when I add some css rules to the file. If I use
@Import(stylesheet = { "context:/css/styles.css" }) on my index page, it
works well.

Should I file a bug on jira ?


2013/4/17 Howard Lewis Ship 

> When you refresh your page, it *should* be building a new URL to the
> updated asset.  The particulars matter here ... how exactly are you
> building & running the app?
>
>
> On Wed, Apr 17, 2013 at 9:31 AM, Charlouze  wrote:
>
> > Hey everyone,
> >
> > I have some trouble with the 5.4-alpha-3. When I add some stuff to my
> > styles.css file, it get another address to access it (that is perfectly
> > normal according to the new asset feature). The problem is that if I
> don't
> > restart my application my pages tries to load my styles.css file from the
> > old address. I probably miss somthing.
> >
> > For your information, I'm am in development mode. I use eclipse and the
> run
> > jetty run plugin.
> >
> > Charles.
> >
> >
> > 2013/4/12 François Facon 
> >
> > > By the way, tapestry5-portlet is also ready to be used with 5.4. But I
> am
> > > still looking for a way to run integration tests inside Pluto with
> > Gradle.
> > > Perhaps the use of Arquillian with Pluto under gradle is the solution.
> > >
> > >
> > >
> > > 2013/4/12 Howard Lewis Ship 
> > >
> > > > That's great news!
> > > >
> > > >
> > > > On Fri, Apr 12, 2013 at 12:35 PM, François Facon <
> > > francois.fa...@atos.net
> > > > >wrote:
> > > >
> > > > > Thanks to Emmanuel, tapestry-jquery is already working fine with
> 5.4.
> > > > >
> > > > >
> > > > >
> > > > > 2013/4/12 Howard Lewis Ship 
> > > > >
> > > > > > We don't control the tapestry-jquery library; I actually haven't
> > > looked
> > > > > at
> > > > > > it. I suspect it will need to be reworked significantly for 5.4.
> > > > > >
> > > > > >
> > > > > > On Fri, Apr 12, 2013 at 9:40 AM, George Christman
> > > > > > wrote:
> > > > > >
> > > > > > > I'm just curious if Tapestry5.4 will just be integrating the
> > > > > > > Tapestry-Jquery library?
> > > > > > >
> > > > > > > On Sun, Apr 7, 2013 at 10:29 AM, hantsy 
> > > wrote:
> > > > > > > >
> > > > > > > > Created a new thread for it. Thanks
> > > > > > > >
> > > > > > > > On 4/7/2013 22:16, Bob Harner wrote:
> > > > > > > >> Hantsy, you might want to start a separate thread. Your
> > question
> > > > > isn't
> > > > > > > >> about 5.4-alpha-3 at all.
> > > > > > > >>
> > > > > > > >> On Sun, Apr 7, 2013 at 9:23 AM, hantsy  >
> > > > wrote:
> > > > > > > >>
> > > > > > > >>> I want to know if Tapestry has plan to integrate with Java
> > EE,
> > > > such
> > > > > > as
> > > > > > > >>> how to use CDI with Tapestry, I know Tapestry has its DI
> > > > container,
> > > > > > it
> > > > > > > >>> can be replaced with CDI?
> > > > > > > >>>
> > > > > > > >>> I have used Tapestry4 before, and know little about the
> > newest
> > > > > > > Tapestry 5.
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>> Hantsy
> > > > > > > >>> On 4/7/2013 09:11, Saeed wrote:
> > > > > > >  Great news! jQuery finally. Well done sire!
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > >  On Sat, Apr 6, 2013 at 11:45 PM, Howard Lewis Ship <
> > > > > > hls...@gmail.com>
> > > > > > > >>> wrote:
> > > > > > > > Hot off the presses!  The latest preview release of
> > Tapestry,
> > > > > > > >>> 5.4-alpha-3,
> > > > > > > > is now available.
> > > > > > > >
> > > > > > > > Point your build tool of choice at the Maven repository:
> > > > > > > >
> > > > > > > >
> > > > > > > >>>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://repository.apache.org/content/repositories/orgapachetapestry-072/
> > > > > > > > Binary and source archives:
> > > > > > > >
> > > > > > > > http://people.apache.org/~hlship/tapestry-releases/
> > > > > > > >
> > > > > > > > What's new?
> > > > > > > >
> > > > > > > > So much, I've kind of lost track; the main changes are:
> > > > > > > >
> > > > > > > > Most assets are now accessed using a URL that
> incorporates
> > a
> > > > > > Adler32
> > > > > > > > checksum of the asset content.  Prior versions of
> Tapestry
> > > > > > > incorporated
> > > > > > > >>> the
> > > > > > > > application version number into the URL.
> > > > > > > >
> > > > > > > > What does this mean?  When you redeploy your web
> > application,
> > > > > most
> > > > > > > >>> assets
> > > > > > > > will have not changed: same content, same path, same
> > > c

Re: Tapestry 5.4-alpha-3

2013-04-17 Thread Howard Lewis Ship
When you refresh your page, it *should* be building a new URL to the
updated asset.  The particulars matter here ... how exactly are you
building & running the app?


On Wed, Apr 17, 2013 at 9:31 AM, Charlouze  wrote:

> Hey everyone,
>
> I have some trouble with the 5.4-alpha-3. When I add some stuff to my
> styles.css file, it get another address to access it (that is perfectly
> normal according to the new asset feature). The problem is that if I don't
> restart my application my pages tries to load my styles.css file from the
> old address. I probably miss somthing.
>
> For your information, I'm am in development mode. I use eclipse and the run
> jetty run plugin.
>
> Charles.
>
>
> 2013/4/12 François Facon 
>
> > By the way, tapestry5-portlet is also ready to be used with 5.4. But I am
> > still looking for a way to run integration tests inside Pluto with
> Gradle.
> > Perhaps the use of Arquillian with Pluto under gradle is the solution.
> >
> >
> >
> > 2013/4/12 Howard Lewis Ship 
> >
> > > That's great news!
> > >
> > >
> > > On Fri, Apr 12, 2013 at 12:35 PM, François Facon <
> > francois.fa...@atos.net
> > > >wrote:
> > >
> > > > Thanks to Emmanuel, tapestry-jquery is already working fine with 5.4.
> > > >
> > > >
> > > >
> > > > 2013/4/12 Howard Lewis Ship 
> > > >
> > > > > We don't control the tapestry-jquery library; I actually haven't
> > looked
> > > > at
> > > > > it. I suspect it will need to be reworked significantly for 5.4.
> > > > >
> > > > >
> > > > > On Fri, Apr 12, 2013 at 9:40 AM, George Christman
> > > > > wrote:
> > > > >
> > > > > > I'm just curious if Tapestry5.4 will just be integrating the
> > > > > > Tapestry-Jquery library?
> > > > > >
> > > > > > On Sun, Apr 7, 2013 at 10:29 AM, hantsy 
> > wrote:
> > > > > > >
> > > > > > > Created a new thread for it. Thanks
> > > > > > >
> > > > > > > On 4/7/2013 22:16, Bob Harner wrote:
> > > > > > >> Hantsy, you might want to start a separate thread. Your
> question
> > > > isn't
> > > > > > >> about 5.4-alpha-3 at all.
> > > > > > >>
> > > > > > >> On Sun, Apr 7, 2013 at 9:23 AM, hantsy 
> > > wrote:
> > > > > > >>
> > > > > > >>> I want to know if Tapestry has plan to integrate with Java
> EE,
> > > such
> > > > > as
> > > > > > >>> how to use CDI with Tapestry, I know Tapestry has its DI
> > > container,
> > > > > it
> > > > > > >>> can be replaced with CDI?
> > > > > > >>>
> > > > > > >>> I have used Tapestry4 before, and know little about the
> newest
> > > > > > Tapestry 5.
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> Hantsy
> > > > > > >>> On 4/7/2013 09:11, Saeed wrote:
> > > > > >  Great news! jQuery finally. Well done sire!
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > >  On Sat, Apr 6, 2013 at 11:45 PM, Howard Lewis Ship <
> > > > > hls...@gmail.com>
> > > > > > >>> wrote:
> > > > > > > Hot off the presses!  The latest preview release of
> Tapestry,
> > > > > > >>> 5.4-alpha-3,
> > > > > > > is now available.
> > > > > > >
> > > > > > > Point your build tool of choice at the Maven repository:
> > > > > > >
> > > > > > >
> > > > > > >>>
> > > > > >
> > > > >
> > > >
> > >
> >
> https://repository.apache.org/content/repositories/orgapachetapestry-072/
> > > > > > > Binary and source archives:
> > > > > > >
> > > > > > > http://people.apache.org/~hlship/tapestry-releases/
> > > > > > >
> > > > > > > What's new?
> > > > > > >
> > > > > > > So much, I've kind of lost track; the main changes are:
> > > > > > >
> > > > > > > Most assets are now accessed using a URL that incorporates
> a
> > > > > Adler32
> > > > > > > checksum of the asset content.  Prior versions of Tapestry
> > > > > > incorporated
> > > > > > >>> the
> > > > > > > application version number into the URL.
> > > > > > >
> > > > > > > What does this mean?  When you redeploy your web
> application,
> > > > most
> > > > > > >>> assets
> > > > > > > will have not changed: same content, same path, same
> > checksum,
> > > > > > >>> therefore,
> > > > > > > same URL. This means that client browsers will not have to
> > > > > > re-download
> > > > > > >>> all
> > > > > > > those assets again just because the application version
> > number
> > > > has
> > > > > > >>> changed.
> > > > > > > Assets that have changed will have a different content
> hash,
> > > and
> > > > > > >>> therefore,
> > > > > > > a different asset URL. Browsers will be sure to pull down
> > those
> > > > new
> > > > > > > versions.
> > > > > > >
> > > > > > > Modules are slightly different; because all JavaScript
> > modules
> > > > are
> > > > > > >>> expected
> > > > > > > to start in a common root URL, there is no reasonable way
> to
> > > > > > generate a
> > > > > > > unique content hash for each; module URLs still use the
> > > > application
> > > > > > >>> version
> > > > > > > number. However, modules and all asset

Re: Tapestry 5.4-alpha-3

2013-04-17 Thread Charlouze
Hey everyone,

I have some trouble with the 5.4-alpha-3. When I add some stuff to my
styles.css file, it get another address to access it (that is perfectly
normal according to the new asset feature). The problem is that if I don't
restart my application my pages tries to load my styles.css file from the
old address. I probably miss somthing.

For your information, I'm am in development mode. I use eclipse and the run
jetty run plugin.

Charles.


2013/4/12 François Facon 

> By the way, tapestry5-portlet is also ready to be used with 5.4. But I am
> still looking for a way to run integration tests inside Pluto with Gradle.
> Perhaps the use of Arquillian with Pluto under gradle is the solution.
>
>
>
> 2013/4/12 Howard Lewis Ship 
>
> > That's great news!
> >
> >
> > On Fri, Apr 12, 2013 at 12:35 PM, François Facon <
> francois.fa...@atos.net
> > >wrote:
> >
> > > Thanks to Emmanuel, tapestry-jquery is already working fine with 5.4.
> > >
> > >
> > >
> > > 2013/4/12 Howard Lewis Ship 
> > >
> > > > We don't control the tapestry-jquery library; I actually haven't
> looked
> > > at
> > > > it. I suspect it will need to be reworked significantly for 5.4.
> > > >
> > > >
> > > > On Fri, Apr 12, 2013 at 9:40 AM, George Christman
> > > > wrote:
> > > >
> > > > > I'm just curious if Tapestry5.4 will just be integrating the
> > > > > Tapestry-Jquery library?
> > > > >
> > > > > On Sun, Apr 7, 2013 at 10:29 AM, hantsy 
> wrote:
> > > > > >
> > > > > > Created a new thread for it. Thanks
> > > > > >
> > > > > > On 4/7/2013 22:16, Bob Harner wrote:
> > > > > >> Hantsy, you might want to start a separate thread. Your question
> > > isn't
> > > > > >> about 5.4-alpha-3 at all.
> > > > > >>
> > > > > >> On Sun, Apr 7, 2013 at 9:23 AM, hantsy 
> > wrote:
> > > > > >>
> > > > > >>> I want to know if Tapestry has plan to integrate with Java EE,
> > such
> > > > as
> > > > > >>> how to use CDI with Tapestry, I know Tapestry has its DI
> > container,
> > > > it
> > > > > >>> can be replaced with CDI?
> > > > > >>>
> > > > > >>> I have used Tapestry4 before, and know little about the newest
> > > > > Tapestry 5.
> > > > > >>>
> > > > > >>>
> > > > > >>> Hantsy
> > > > > >>> On 4/7/2013 09:11, Saeed wrote:
> > > > >  Great news! jQuery finally. Well done sire!
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > >  On Sat, Apr 6, 2013 at 11:45 PM, Howard Lewis Ship <
> > > > hls...@gmail.com>
> > > > > >>> wrote:
> > > > > > Hot off the presses!  The latest preview release of Tapestry,
> > > > > >>> 5.4-alpha-3,
> > > > > > is now available.
> > > > > >
> > > > > > Point your build tool of choice at the Maven repository:
> > > > > >
> > > > > >
> > > > > >>>
> > > > >
> > > >
> > >
> >
> https://repository.apache.org/content/repositories/orgapachetapestry-072/
> > > > > > Binary and source archives:
> > > > > >
> > > > > > http://people.apache.org/~hlship/tapestry-releases/
> > > > > >
> > > > > > What's new?
> > > > > >
> > > > > > So much, I've kind of lost track; the main changes are:
> > > > > >
> > > > > > Most assets are now accessed using a URL that incorporates a
> > > > Adler32
> > > > > > checksum of the asset content.  Prior versions of Tapestry
> > > > > incorporated
> > > > > >>> the
> > > > > > application version number into the URL.
> > > > > >
> > > > > > What does this mean?  When you redeploy your web application,
> > > most
> > > > > >>> assets
> > > > > > will have not changed: same content, same path, same
> checksum,
> > > > > >>> therefore,
> > > > > > same URL. This means that client browsers will not have to
> > > > > re-download
> > > > > >>> all
> > > > > > those assets again just because the application version
> number
> > > has
> > > > > >>> changed.
> > > > > > Assets that have changed will have a different content hash,
> > and
> > > > > >>> therefore,
> > > > > > a different asset URL. Browsers will be sure to pull down
> those
> > > new
> > > > > > versions.
> > > > > >
> > > > > > Modules are slightly different; because all JavaScript
> modules
> > > are
> > > > > >>> expected
> > > > > > to start in a common root URL, there is no reasonable way to
> > > > > generate a
> > > > > > unique content hash for each; module URLs still use the
> > > application
> > > > > >>> version
> > > > > > number. However, modules and all assets now also send an ETag
> > > > header;
> > > > > >>> this
> > > > > > means that module requests will still be sent, but will often
> > > get a
> > > > > 304
> > > > > > (resource not modified) response.
> > > > > >
> > > > > > Obviously, this is a big change, and we're welcoming
> feedback.
> > > > > >
> > > > > > Next up; we have first class support for jQuery.A little bit
> of
> > > > > symbol
> > > > > > tweaking, and Prototype and Scriptaculous are simply gone for
> > > good.
> > > 

Re: Is it possible somehow to get tapestry5 service from within integration test?

2013-04-17 Thread Dmitry Gusev
https://issues.apache.org/jira/browse/TAP5-2107


On Tue, Apr 16, 2013 at 8:17 PM, Dmitry Gusev wrote:

> Here's a piece of SeleniumTestCase that does what I wanted:
>
> private ServletContainerRunner servletContainerRunner;
>
>
>
> public Registry getRegistry()
>
> {
>
> if (servletContainerRunner instanceof Jetty7Runner)
>
> {
>
> Server server = ((Jetty7Runner) servletContainerRunner
> ).getServer();
>
>
>
> WebAppContext context = (WebAppContext) server.getHandler();
>
>
>
> ServletContext servletContext = context.getServletContext();
>
>
>
> Object registry = servletContext.getAttribute(TapestryFilter.
> REGISTRY_CONTEXT_NAME);
>
>
>
> return (Registry) registry;
>
> }
>
>
>
> if (servletContainerRunner instanceof Tomcat6Runner)
>
> {
>
> try
>
> {
>
> Field field = Tomcat6Runner.class.getDeclaredField(
> "tomcatServer");
>
> field.setAccessible(true);
>
>
>
> Embedded server = (Embedded) field.get(
> servletContainerRunner);
>
> Engine engine = (Engine) server.getContainer();
>
> Host host = (Host) engine.findChild("localhost");
>
> Context context = (Context) host.findChildren()[0];
>
> ServletContext servletContext =
> context.getServletContext();
>
>
>
> Object registry =
> servletContext.getAttribute(TapestryFilter.REGISTRY_CONTEXT_NAME);
>
>
>
> return (Registry) registry;
>
> }
>
> catch (Exception e)
>
> {
>
> throw new RuntimeException(e);
>
> }
>
> }
>
>
>
> throw new RuntimeException("Unsupported runner " +
> servletContainerRunner);
>
> }
>
>
>
> protected Runnable launchWebServer(String container, String
> webAppFolder, String contextPath, int port, int sslPort)
>
> throws Exception
>
> {
>
> final ServletContainerRunner runner;
>
> if (TOMCAT_6.equals(container))
>
> runner = new Tomcat6Runner(webAppFolder, contextPath, port,
> sslPort);
>
> else if (JETTY_7.equals(container))
>
> runner = new Jetty7Runner(webAppFolder, contextPath, port,
> sslPort);
>
> else
>
> throw new RuntimeException("Unknown servlet container: " +
> container);
>
>
> this.servletContainerRunner = runner;
>
> Method getRegistry() could be easily implemented by ServletContainerRunner
> interface without any reflection.
> It would be nice to have it in there.
> Should I file a JIRA for this or somebody of committers will integrate
> this?
>
> On Tue, Apr 16, 2013 at 7:01 PM, Dmitry Gusev wrote:
>
>> Michael,
>>
>> I already use RegistryBuilder in some of my tests.
>> It allows me to test services, but in this case I'm working with my
>> application using Java API.
>>
>> With SeleniumTestCase I can trigger my application handlers using HTTP
>> requests via Selenium.
>> In this case my application already running and it has constructed
>> Registry instance and I'd like to get that instance somehow.
>>
>> I'm looking at implementation of SeleniumTestCase and see that there's
>> not API for obtaining that Registry instance directly.
>> Though, I can see that instance in debugger in my IDE, I think I'll use
>> reflection to get it.
>>
>> On Tue, Apr 16, 2013 at 6:50 PM, Michael Prescott <
>> michael.r.presc...@gmail.com> wrote:
>>
>>> You can use the RegistryBuilder to instantiate your tapestry services via
>>> Tapestry IOC, I'm finding that very handy.  That's described here:
>>>
>>> http://tapestry.apache.org/starting-the-ioc-registry.html
>>>
>>>
>>> On 16 April 2013 10:38, Dmitry Gusev  wrote:
>>>
>>> > I'm writing integration tests (using SeleniumTestCase) and want to make
>>> > assertions against database state.
>>> >
>>> > I was thinking about getting one of my DAO services (or JPA
>>> > EntityManager/Source) and use it to run queries.
>>> >
>>> > Is it possible somehow? Or should I just write another client code that
>>> > would access database from integration tests?
>>> >
>>> > --
>>> > Dmitry Gusev
>>> >
>>> > AnjLab Team
>>> > http://anjlab.com
>>> >
>>>
>>
>>
>>
>> --
>> Dmitry Gusev
>>
>> AnjLab Team
>> http://anjlab.com
>>
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com