generic keep-alive within Pier

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

generic keep-alive within Pier

Nick
Hi

I've been littering my code with javascript keep-alive calls, to ensures that sessions don't timeout when I'm say writing a blog post, or a user is uploading details in one of my custom forms.

Thinking about the problem, I noticed that I'm normally within an edit when I'm in a form and could fix the problem generically by derving from PRContentsWidget and overriding the #renderContentOn: method as:

renderContentOn: html
super renderContentOn: html.

self context command isView ifFalse: [
html script: (html jQuery ajax
callback: [ "Do nothing" ];
interval: 10 minutes).
"self application cache expiryPolicy configuration at: #cacheTimeout"


The keep alive will then be rendered for all non-view commands. Do others use a similar approach?

Cheers

Nick

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: generic keep-alive within Pier

Lukas Renggli
That sounds like a good strategy, but keep in mind that not everybody
wants to include the jQuery libraries in their site.

Lukas

On 7 January 2011 19:52, Nick Ager <[hidden email]> wrote:

> Hi
> I've been littering my code with javascript keep-alive calls, to ensures
> that sessions don't timeout when I'm say writing a blog post, or a user is
> uploading details in one of my custom forms.
> Thinking about the problem, I noticed that I'm normally within an edit when
> I'm in a form and could fix the problem generically by derving from
> PRContentsWidget and overriding the #renderContentOn: method as:
> renderContentOn: html
> super renderContentOn: html.
> self context command isView ifFalse: [
> html script: (html jQuery ajax
> callback: [ "Do nothing" ];
> interval: 10 minutes).
> "self application cache expiryPolicy configuration at: #cacheTimeout"
> ]
>
> The keep alive will then be rendered for all non-view commands. Do others
> use a similar approach?
> Cheers
> Nick
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>



--
Lukas Renggli
www.lukas-renggli.ch
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: generic keep-alive within Pier

sergio_101-2
In reply to this post by Nick
> I'm in a form and could fix the problem generically by derving from
> PRContentsWidget and overriding the #renderContentOn: method as:
> renderContentOn: html
> super renderContentOn: html.
> self context command isView ifFalse: [

this is a problem i have been wanting to think about for awhile. one
thing i have found is that if an article takes me more than ten
minutes to write, it would probably benefit me to write the whole
thing in emacas as a cohesive article.. then, when i am done, paste it
in to the site, then add decorations to it there.

so the problem went away for awhile..

would it be advisable to change the session timeout to something like
30 minutes?

--
----
peace,
sergio
photographer, journalist, visionary

http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki