Tap question on SO

2011-09-05 Thread Richard Hill

Hi Chaps,

Opportunity to promote T5 a bit:

http://stackoverflow.com/questions/7306707/how-to-expose-an-api-to-a-tapestry-web-application




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



Re: Clearing @SessionState

2011-06-06 Thread Richard Hill

Rich's point is that pages are re-used: a fresh instance of a page is
not instantiated for each request. So yes you'll have your transfer data
rendering in the page, but that doesn't mean that data was
collected/built/queried from db or whatever in response to the current
request.

AFAIK constructors are not the place to put initialisation stuff: as
Rich suggested take a look at the @SetupRender annotation and/or the
setupRender() method.

R.




On Mon, 2011-06-06 at 09:42 -0700, robnangle wrote:
> Rich M wrote:
> > 
> > On 06/06/2011 12:20 PM, robnangle wrote:
> >> Rich M wrote:
> >>> On 06/06/2011 12:04 PM, robnangle wrote:
>  No didn't seem to make a difference im afraid. I cant think of anything
>  that
>  would revert the user back to the previous logged in user?
> 
>  My updated code now looks like:
> 
>    @SessionState(create=false)
>   @Property
>   private User user;
>   @Property
>   private boolean userExists;
>   @Property
>   private Transfers transfers;
>   
>   private boolean adminUser;
> >>> Don't know the rest of your code, but if this boolean adminUser
> >>> determines whether or not show pages, it should be persisted shouldn't
> >>> it? Otherwise the value set here is going to clear. When is
> >>> UpdatePoints() called?
> >>>
> > 
> >> Well does it have to be persisted? I call the adminUser() in every class
> >> where it is necessary. The updatePoints() is the constructor so it will
> >> be
> >> called when the page is loading?
> >>
> > 
> > You might want to refresh your knowledge of the page render lifecycle 
> > and how pages/components operate in T5, based on your comment here.
> > 
> > http://tapestry.apache.org/page-life-cycle.html
> > 
> > Someone else might be better able to explain, but to my knowledge, a 
> > page is only constructed a minimal amount of times and re-used within 
> > the application. The page is not constructed to render a response for a 
> > request.
> > 
> > You'd be looking to call the logic for a page "loading" or rather being 
> > requested in the onActivate method, or a render phase like @SetupRender.
> > 
> > As for persisted or not, if you are maintaining a user session in your 
> > application, might I ask what the point is of recalculating their admin 
> > status if that never changes within a given session?
> > 
> > http://tapestry.apache.org/persistent-page-data.html
> > 
> > Most likely your page is not loading and assigning the adminUser boolean 
> > like you are expecting, and after your initial login, it's not calling 
> > any of that code anymore and thus your privileges appear to regress to a 
> > normal user, when really you aren't calculating them at all.
> > 
> > You might have an easier time figuring this out using some System.out 
> > commands or better yet using the built-in logging support @Inject 
> > private Logger log; and provide a Log4J configuration file in 
> > src/main/resources
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> > 
> 
> Yes I agree with you that it is pointless recalculating whether its an admin
> user or not. However that constructor is defientley being called as the
> transfers display in a sidebar and if it was not being called the transfers
> would not display (also them transfers being persisted would make more sense
> too).
> 
> So I dont think its a problem of it not being called or not?
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Clearing-SessionState-tp4458525p4459190.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
> 



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



Re: Clearing @SessionState

2011-06-06 Thread Richard Hill

Could there be a browser-caching issue here? If the URLs are the same,
but with different views for logged-in and logged out, perhaps being
cached?

On Mon, 2011-06-06 at 08:30 -0700, robnangle wrote:
> Thiago H. de Paula Figueiredo wrote:
> > 
> > I'm sorry, but I need to ask: have you checked what the actual user is  
> > when granting access or not to the admin page? Are you sure your  
> > authentication code is correct?
> > 
> > -- 
> > Thiago H. de Paula Figueiredo
> > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
> > and instructor
> > Owner, Ars Machina Tecnologia da Informação Ltda.
> > http://www.arsmachina.com.br
> > 
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> > 
> 
> Yes the code seems to be correct. When i login after a logout the immediate
> page that loads is one which the admin user should see, which is correct.
> You can click on an admin only link and that page will load but after this
> it seems to revert back to the previous user and you will then be unable to
> view admin pages (even though I just logged in as an admin user).
> 
> It seems to be setting itself to the previous user for some reason? 
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Clearing-SessionState-tp4458525p4459002.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
> 



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



Re: Clearing @SessionState

2011-06-06 Thread Richard Hill
What do you mean exactly "not clearing the session" ? 

Al you are doing below is setting the user to null, the session is not
being destroyed and nothing else in the session will be affected.



On Mon, 2011-06-06 at 05:26 -0700, robnangle wrote:
> Hi All,
> 
> I create have a @SessionState on my user but when I try logout it is not
> fully clearing the session.
> 
> @SessionState
> private User user;
> 
> onSubmitFromLogout(){
> user = null;
> return index;
> }
> 
> Is there a specific way to do it?
> Cheers
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Clearing-SessionState-tp4458525p4458525.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
> 



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



Re: A new T5 site! www.bookmarkerpro.com

2011-05-25 Thread Richard Hill

Yes, exactly :) Sorry we not too clear.

R.



On Wed, 2011-05-25 at 06:52 -0400, Bob Harner wrote:
> By back end I think Joel means the part you see after you create an account.
> 
> Bob Harner
> On May 25, 2011 5:48 AM, "George Banus"  wrote:
> >
> > Wao, what a brilliant idea to gain some popularity for your site. What do
> > you mean by you use Tapestry for the backend? Tapestry is a front end
> > technology. I think people doing their site with PHP can also come here in
> > the future and mention just the "Tapestry" keyword and qualify for free
> > advert for their site. That's easy and free as in beer! :-)
> >
> > On Tue, May 24, 2011 at 5:59 PM, Joel Halbert 
> wrote:
> >
> > > The front of site www.bookmarkerpro.com is wordpress, but this is only a
> > > few pages.
> > >
> > > ALL of the backend, on the app sub-domain, app.bookmarkerpro.com is T5.
> > >
> > > It also integrates with Lucene, HBase, OpenJPA & our crawler.
> > >
> > > If you want to have a play you just need an email/passwd to register.
> > >
> > >
> > >
> > >
> > > On Tue, 2011-05-24 at 08:53 -0700, Howard Lewis Ship wrote:
> > > > How far do you have to get into it to see the T5 part ... or are you
> > > > just using tapestry-ioc for back end processing?  Just curious.
> > > >
> > > > On Tue, May 24, 2011 at 7:34 AM, Joel Halbert 
> > > wrote:
> > > > > Hi Folks,
> > > > >
> > > > > We've just released (another) Tapestry5 based site!
> > > > >
> > > > > www.bookmarkerpro.com
> > > > >
> > > > > This one's a bookmarking app, as the name suggests.
> > > > >
> > > > > Features include:
> > > > >
> > > > > * Search the content of your bookmarks: page content, title & url
> > > > > * Monitor your bookmarked pages, or even just part(s) of each page
> > > > > * Alerts (including optional email) when content you are monitoring
> > > > > changes
> > > > > * Import bookmarks from your browser. Export at any time.
> > > > > * One click search of your bookmarks from your browsers
> > > > > * Page archival and page change history
> > > > >
> > > > > We'll also be integrating with Readability in the near future, for
> > > > > sending bookmarked pages to kindle/ipad/iphone for offline viewing.
> > > > >
> > > > > The front end is wordpress (yawn) buy the back-end is all T5 (yay!)
> > > > > goodness .
> > > > >
> > > > > If you'd like to try it out you can sign up in less than 10 seconds,
> > > all
> > > > > you need is an email/password. We'd love to get your feedback.
> > > > > http://www.bookmarkerpro.com/beta-trial
> > > > >
> > > > > Once again, thanks to everyone on the mailing list for any help, and
> to
> > > > > the core T5 developers!
> > > > >
> > > > > Joel
> > > > >
> > > > > (p.s. Thiago - should be OK in Opera too, but let me know if not!)
> > > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >



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



Re: A new T5 site! www.bookmarkerpro.com

2011-05-25 Thread Richard Hill
Hi George,

Yes sorry, slight mis-use of "backend" there. What we mean is that
Tapestry is powering the client application, as opposed to the publicly
visible static website.

Richard. 


On Wed, 2011-05-25 at 11:47 +0200, George Banus wrote:
> Wao, what a brilliant idea to gain some popularity for your site. What do
> you mean by you use Tapestry for the backend? Tapestry is a front end
> technology. I think people doing their site with PHP can also come here in
> the future and mention just the "Tapestry" keyword and qualify for free
> advert for their site. That's easy and free as in beer! :-)
> 
> On Tue, May 24, 2011 at 5:59 PM, Joel Halbert  wrote:
> 
> > The front of site www.bookmarkerpro.com is wordpress, but this is only a
> > few pages.
> >
> > ALL of the backend, on the app sub-domain, app.bookmarkerpro.com is T5.
> >
> > It also integrates with Lucene, HBase, OpenJPA & our crawler.
> >
> > If you want to have a play you just need an email/passwd to register.
> >
> >
> >
> >
> > On Tue, 2011-05-24 at 08:53 -0700, Howard Lewis Ship wrote:
> > > How far do you have to get into it to see the T5 part ... or are you
> > > just using tapestry-ioc for back end processing?  Just curious.
> > >
> > > On Tue, May 24, 2011 at 7:34 AM, Joel Halbert 
> > wrote:
> > > > Hi Folks,
> > > >
> > > > We've just released (another) Tapestry5 based site!
> > > >
> > > > www.bookmarkerpro.com
> > > >
> > > > This one's a bookmarking app, as the name suggests.
> > > >
> > > > Features include:
> > > >
> > > > * Search the content of your bookmarks: page content, title & url
> > > > * Monitor your bookmarked pages, or even just part(s) of each page
> > > > * Alerts (including optional email) when content you are monitoring
> > > > changes
> > > > * Import bookmarks from your browser. Export at any time.
> > > > * One click search of your bookmarks from your browsers
> > > > * Page archival and page change history
> > > >
> > > > We'll also be integrating with Readability in the near future, for
> > > > sending bookmarked pages to kindle/ipad/iphone for offline viewing.
> > > >
> > > > The front end is wordpress (yawn) buy the back-end is all T5 (yay!)
> > > > goodness .
> > > >
> > > > If you'd like to try it out you can sign up in less than 10 seconds,
> > all
> > > > you need is an email/password. We'd love to get your feedback.
> > > > http://www.bookmarkerpro.com/beta-trial
> > > >
> > > > Once again, thanks to everyone on the mailing list for any help, and to
> > > > the core T5 developers!
> > > >
> > > > Joel
> > > >
> > > > (p.s. Thiago - should be OK in Opera too, but let me know if not!)
> > > >
> > >
> > >
> > >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >



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



Re: Live class reloading very slow

2011-05-24 Thread Richard Hill

Honestly, we have a pretty complex app: multiple zones, lots of and
nested components, loads of injected assets, services etc and it reloads
faster than I can hit F5. 



On Tue, 2011-05-24 at 19:06 +0200, Davor Hrg wrote:
> I've updated run-jetty,
> and tried with and without page-pool
> still 5-6 seconds load time.
> 
> 
> I decided to try to go as simple as possible ...
> 
> empty page with layout component takes 500 ms
> 
> - add a form .. it jumps to 700 ms
> 
> - add few submit buttons ... jumps to 800 ms
> 
> - add a component with a zone inside it .. jumps to 950 ms
> 
> - add two more of same component and few lines of text ... jumps to 1200 ms
> 
> 
> This is awful ... I hope this can be fixed by configuring something ...
> etc...
> if this is T5 reality ... it is extremely unproductive and painful.
> 
> 
> :( :( :(
> 
> 
> Davor Hrg
> 
> 
> On Tue, May 24, 2011 at 6:26 PM, Joel Halbert  wrote:
> 
> > Hi Davor,
> >
> > I use a similar spec. Should take a second or two.
> >
> > - Joel
> >
> > On Tue, 2011-05-24 at 18:10 +0200, Davor Hrg wrote:
> > > ok,
> > >
> > > we are on 5.2.4 now,
> > > I am running it from eclipse using run-jetty-run 1.1.1
> > > I'll try newer jetty plugin 1.2.2.1
> > >
> > > how long should I expect a page reload to last for:
> > >  - page
> > >  - editing component inside
> > >- two forms in the component
> > >- maybe 20 form fields total
> > >
> > > Quad core  intel Core i7
> > > 4GB RAM
> > >
> > > Davor Hrg
> > >
> > > On Tue, May 24, 2011 at 5:50 PM, Howard Lewis Ship 
> > wrote:
> > >
> > > > For me as well, instantaneous under Jetty.
> > > >
> > > > 5.2.5 adds "field write-behind" when in development mode, to assist
> > > > with debugging.  This is also present in 5.3.
> > > >
> > > > There is a switch to use the page pool, please chck the documentation
> > > > (configuration page).
> > > >
> > > > On Tue, May 24, 2011 at 8:37 AM, Davor Hrg  wrote:
> > > > > Hi,
> > > > >
> > > > > I may be wrong but since T5  5.2+
> > > > > live class reloading is much slower.
> > > > >
> > > > > I remember it being faster before 
> > > > > for a page with maybe 10-20 components
> > > > > reload lasts for 5-10 seconds.
> > > > >
> > > > > it becomes worse with each component added.
> > > > >
> > > > > This is far from productive and far from advertised by the framework.
> > > > > It feels like going back to stone age of JSP and restarting whole
> > server
> > > > for
> > > > > simple change.
> > > > >
> > > > > We have been using tapestry since the beginning of T5, and a bit T4,
> > > > > I could swear it was not this horribly slow before.
> > > > >
> > > > >
> > > > > Another thing is the new handling of variables and page pool.
> > > > > it is awful for debugging... is there a switch to use old page pool ?
> > > > >
> > > > > Davor Hrg
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > 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
> > > >
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > > >
> > > >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >



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



Re: Live class reloading very slow

2011-05-24 Thread Richard Hill

Tomcat or Jetty? I forget why (perhaps I can dig out the details) but I
found class reloading on Tomcat was very slow - so I switched to Jetty
which is essentially instantaneous - very quick.



On Tue, 2011-05-24 at 17:37 +0200, Davor Hrg wrote:
> Hi,
> 
> I may be wrong but since T5  5.2+
> live class reloading is much slower.
> 
> I remember it being faster before 
> for a page with maybe 10-20 components
> reload lasts for 5-10 seconds.
> 
> it becomes worse with each component added.
> 
> This is far from productive and far from advertised by the framework.
> It feels like going back to stone age of JSP and restarting whole server for
> simple change.
> 
> We have been using tapestry since the beginning of T5, and a bit T4,
> I could swear it was not this horribly slow before.
> 
> 
> Another thing is the new handling of variables and page pool.
> it is awful for debugging... is there a switch to use old page pool ?
> 
> Davor Hrg



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



Re: Hyperlink not becoming hyperlink

2011-05-17 Thread Richard Hill

link  ?


On Tue, 2011-05-17 at 08:03 -0700, TG wrote:
> Thanks for the prompt response. Actually I meant url as part of tapestry grid
> component. So I tried this -
> 
>  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";
> xmlns:p="tapestry:parameter">
> ...
> 
> ...
>   
>${url.endpoint} Link  
>
> ...
> 
> and it does not work. Any idea how to make the endpoint clickable URL
> automagically?
> 
> Thanks.
> 
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Hyperlink-not-becoming-hyperlink-tp4403607p4403743.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
> 



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



Re: Execute JavaScript from dynamic component

2011-05-06 Thread Richard Hill

Hi Tim,

A "cheap" way is to simply include your javascript in a  tag at
the bottom of your component .tml: