AW: Iterate over Pages in Pagemap

2009-11-10 Thread Giambalvo, Christian
I agree that i should be carefully. 
But, back to the timer, let's assume I have 16 versions of one page in pagemap 
and each of 16 versions has a timer.
Then there are 16 timers polling information from server, well if there are 
only 16 versions of one page, the traffic is low, but if the page count 
increase I have much unneeded traffic.
You know I mean?
I will look at push but I hold timer in mind.

Btw, do you come to London on 21.11 (Jweekend)?

Greets Chris

-Ursprüngliche Nachricht-
Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Gesendet: Dienstag, 10. November 2009 11:44
An: users@wicket.apache.org
Betreff: Re: Iterate over Pages in Pagemap

I haven't used wicketstuff-push myself so I can't be of much help there. I
once had to implement some push functionality and I used DWR in combination
with Wicket. Going the reverse AJAX can complicate things a lot (or so I
believe). Thus, think carefully if what you want to achieve cannot be
accomplished using other means. e.g.  an AJAX timer that polls the server
from time to time and if new navigation is available updates what you need
to update (maybe asking  the user if they want to do so;-).

Regards,

Ernesto

On Tue, Nov 10, 2009 at 10:25 AM, Giambalvo, Christian <
christian.giamba...@excelsisnet.com> wrote:

> > So, your Application object will act as a factory of components? I
> wouldn't
> > follow that approach myself. At most the application would contain the
> data
> > for the navigation and then the navigation component will fetch that data
> > and rebuild itself.
>
> Well, no. The session holds the navigation and triggers a method on it, so
> the navigation rebuilds itself.
> I need to hold it in session cause the available navigationentries depend
> on user roles.
>
> But your right with reverse ajax, I think I need it.
> Wicket is so "Swing", so I totally forgot I'm working with a webapp :)
>
> I will read more about reverse ajax.
> Btw, cant find any wicketstuff-push svn or project description.
>
> Greets
> Chris
>
> -Ursprüngliche Nachricht-
> Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Gesendet: Dienstag, 10. November 2009 09:54
> An: users@wicket.apache.org
> Betreff: Re: Iterate over Pages in Pagemap
>
> Hi,
>
> On Tue, Nov 10, 2009 at 9:36 AM, Giambalvo, Christian <
> christian.giamba...@excelsisnet.com> wrote:
>
> > Well, i don't want a timer in the page. This causes unneeded checks.
> > That's why I thought of the simplest solution.
> > The basepage gets its navigation from session (which gets rebuild upon
> > changes to stay up2date).
> > Now I need a way to notify the page that navigation changed.
> > So I implemented following method in basepage.
> > ...
> > public void refreshNavigation() {
> >
> >  this.navigation.replaceWith(AuthenticatedWebSession.get().getNavi());
> >AjaxRequestTarget.get().addComponent(this.navigation);
> >}
> > ...
> >
> > So, your Application object will act as a factory of components? I
> wouldn't
> follow that approach myself. At most the application would contain the data
> for the navigation and then the navigation component will fetch that data
> and rebuild itself.
>
>
> > Now all I have to do is call this method for each active page to refresh
> > navigation (or am I wrong?).
> >
> >
> Just one question? How would a remote page "know" that it has to reload
> itself? Do you plan to do that next time user get backs to the server with
> an AJAX request? If so, then you don't need anything else (I guess.) But if
> you want this to happen even if the user do not interact with the page.
> Then
> either you need a timer or use reverse AJAX.
>
>
> > Can you tell me a bit more about reverse ajax?
> >
> >
> Just google for reverse AJAX, comet, server push, etc and you will have
> enough to read...
>
> Regards,
>
> Ernesto
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



AW: Iterate over Pages in Pagemap

2009-11-10 Thread Giambalvo, Christian
> So, your Application object will act as a factory of components? I wouldn't
> follow that approach myself. At most the application would contain the data
> for the navigation and then the navigation component will fetch that data
> and rebuild itself.

Well, no. The session holds the navigation and triggers a method on it, so the 
navigation rebuilds itself.
I need to hold it in session cause the available navigationentries depend on 
user roles.

But your right with reverse ajax, I think I need it.
Wicket is so "Swing", so I totally forgot I'm working with a webapp :)

I will read more about reverse ajax.
Btw, cant find any wicketstuff-push svn or project description.

Greets
Chris

-Ursprüngliche Nachricht-
Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Gesendet: Dienstag, 10. November 2009 09:54
An: users@wicket.apache.org
Betreff: Re: Iterate over Pages in Pagemap

Hi,

On Tue, Nov 10, 2009 at 9:36 AM, Giambalvo, Christian <
christian.giamba...@excelsisnet.com> wrote:

> Well, i don't want a timer in the page. This causes unneeded checks.
> That's why I thought of the simplest solution.
> The basepage gets its navigation from session (which gets rebuild upon
> changes to stay up2date).
> Now I need a way to notify the page that navigation changed.
> So I implemented following method in basepage.
> ...
> public void refreshNavigation() {
>
>  this.navigation.replaceWith(AuthenticatedWebSession.get().getNavi());
>AjaxRequestTarget.get().addComponent(this.navigation);
>}
> ...
>
> So, your Application object will act as a factory of components? I wouldn't
follow that approach myself. At most the application would contain the data
for the navigation and then the navigation component will fetch that data
and rebuild itself.


> Now all I have to do is call this method for each active page to refresh
> navigation (or am I wrong?).
>
>
Just one question? How would a remote page "know" that it has to reload
itself? Do you plan to do that next time user get backs to the server with
an AJAX request? If so, then you don't need anything else (I guess.) But if
you want this to happen even if the user do not interact with the page. Then
either you need a timer or use reverse AJAX.


> Can you tell me a bit more about reverse ajax?
>
>
Just google for reverse AJAX, comet, server push, etc and you will have
enough to read...

Regards,

Ernesto

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



AW: Iterate over Pages in Pagemap

2009-11-10 Thread Giambalvo, Christian
Well, i don't want a timer in the page. This causes unneeded checks.
That's why I thought of the simplest solution.
The basepage gets its navigation from session (which gets rebuild upon changes 
to stay up2date).
Now I need a way to notify the page that navigation changed.
So I implemented following method in basepage.
...
public void refreshNavigation() {
this.navigation.replaceWith(AuthenticatedWebSession.get().getNavi());
AjaxRequestTarget.get().addComponent(this.navigation);
}
...

Now all I have to do is call this method for each active page to refresh 
navigation (or am I wrong?).

Can you tell me a bit more about reverse ajax?

Greets
Chris

-Ursprüngliche Nachricht-
Von: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Gesendet: Dienstag, 10. November 2009 09:21
An: users@wicket.apache.org
Betreff: Re: Iterate over Pages in Pagemap

Why not make your pages consult some kind of service that builds the
navigation? And then have some a timer that get back to the server and looks
for a flag "newEntriesAdded" and then repaint part of the page via AJAX?
Another possibility is get changes pushed to your pages using reverse AJAX,
but this might be a bit trickier to implement... if you want to use this
last approach, I think, there is a project at wicket-stuff that targets
those use cases (I think is DOJO based?)... I have used plain DWR, in
combination with Wicket, for implementing similar functionalities

Cheers,

Ernesto


On Tue, Nov 10, 2009 at 8:54 AM, Giambalvo, Christian <
christian.giamba...@excelsisnet.com> wrote:

> Hi all,
>
>
>
> how to iterate over latest version of all pages in pagemap?
>
> All my Pages have the ability to reload the navigation, but to
> accomplish this,  I need to tell the page to reload the navigation.
>
> So my first idea was to iterate over latest version of all pages in
> pagemap and call the needed method on it.
>
> But Session#getPageMaps returns a list of IPageMap which doesn't offer
> an iterator.
>
> How can a accomplish this?
>
>
>
> Greets
>
> Chris
>
>
>
>

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