You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniel Watrous <da...@gmail.com> on 2012/02/07 00:32:46 UTC

Reload html in Wicket + GAE

Hi,

I'm following up on a previous thread that's still unresolved. I would
like GAE to automatically reload my HTML when I save changes. Classes
are reloaded when I save (compile) them, but I have to restart each
time for HTML changes.

There are some old articles that show how to do this, but they deal
with older versions of Wicket and GAE. For example:
http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
http://code.google.com/p/kickat26/source/browse/trunk/src/de/kickat26/ui/wicket/GAEModificationWatcher.java

Those suggest creating a class MyWebRequestCycle extends
WebRequestCycle, but wicket 1.5 doesn't have WebRequestCycle.

How can I accomplish this same thing in the current version of wicket?

Daniel

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


Re: Reload html in Wicket + GAE

Posted by Daniel Watrous <da...@gmail.com>.
Here's my write up:
http://software.danielwatrous.com/software-engineering/wicket-gae-automatic-reload

I'm not sure if I can push directly into wicketstuff, but I'm happy to
try. You can grab the source from my site and put it in there. You may
even have a more clever way to composing things.

Daniel

On Tue, Feb 7, 2012 at 12:17 PM, Kayode Odeyemi <dr...@gmail.com> wrote:
> Glad you got it working Daniel, as Martin mentioned earlier, I'll
> appreciate if you can contribute this to existing GaeInitializer or
> somewhere comfortable with the full code so it can be valuable to us all.
>
> Thanks
>
> On Tue, Feb 7, 2012 at 5:31 PM, Daniel Watrous <da...@gmail.com>wrote:
>
>> I finally got it working. Here's the modified function:
>>
>>        public boolean add(IModifiable modifiable, IChangeListener
>> listener) {
>>                // TODO Auto-generated method stub
>>                checkResources();
>>                 HashSet<IChangeListener> listenerSet = new
>> HashSet<IChangeListener>();
>>                Set<IChangeListener> listeners =
>> listenersMap.putIfAbsent(modifiable, listenerSet);
>>                if (listeners != null) {
>>                        return listeners.add(listener);
>>                } else return listenerSet.add(listener);
>>        }
>>
>> I'm not sure if that's a good approach or not, but it works for me and
>> that's fantastic.
>>
>> Daniel
>>
>> On Tue, Feb 7, 2012 at 9:30 AM, Daniel Watrous <da...@gmail.com>
>> wrote:
>> > So I was just looking at what I sent along and it seems that
>> > putIfAbsent(modifiable, new HashSet<IChangeListener>()) should return
>> > the value component, which should be the new HashSet<IChangeListener>.
>> > Even if the key modifiable already exists, it should return the
>> > previously created HashSet<IChangeListener>.
>> >
>> > I'm confused that listener is coming back null.
>> >
>> > Daniel
>> >
>> > On Tue, Feb 7, 2012 at 9:21 AM, Daniel Watrous <da...@gmail.com>
>> wrote:
>> >> That helped. I'm getting really close.
>> >>
>> >> I'm now getting a null pointer exception in this function
>> >>
>> >>        public boolean add(IModifiable modifiable, IChangeListener
>> listener) {
>> >>                // TODO Auto-generated method stub
>> >>                checkResources();
>> >>                Set<IChangeListener> listeners =
>> listenersMap.putIfAbsent(modifiable,
>> >>                                new HashSet<IChangeListener>());
>> >>                return listeners.add(listener);
>> >>        }
>> >>
>> >> listeners is null.
>> >>
>> >> I noticed that start(Duration pollFrequency) in GaeModificationWatcher
>> >> was never getting called, so I updated my WicketApplication to set it
>> >> like this:
>> >>
>> >>                IModificationWatcher watcher = new
>> GaeModificationWatcher();
>> >>                watcher.start(Duration.ONE_SECOND);
>> >>                getResourceSettings().setResourceWatcher(watcher);
>> >>
>> >> But that didn't help my problem. I'm still trying to follow
>> >>
>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>> >>
>> >> Any pointers?
>> >>
>> >> Thanks,
>> >> Daniel
>> >>
>> >> On Tue, Feb 7, 2012 at 8:42 AM, Martin Grigorov <mg...@apache.org>
>> wrote:
>> >>> Try with java.util.Map.Entry
>> >>>
>> >>> On Tue, Feb 7, 2012 at 5:39 PM, Daniel Watrous <
>> daniel.watrous@gmail.com> wrote:
>> >>>> I've now created a class MyRequestCycleListener extends
>> >>>> AbstractRequestCycleListener.
>> >>>>
>> >>>> I'm having a little trouble building  class GaeModificationWatcher
>> >>>> implements IModificationWatcher. I've tried following this example:
>> >>>>
>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>> >>>>
>> >>>> to create the public void checkResources() function, but I'm not sure
>> >>>> what Entry class to import. I have tried importing these two Entry
>> >>>> classes:
>> >>>> org.apache.wicket.util.collections.IntHashMap.Entry
>> >>>> import
>> com.google.appengine.repackaged.com.google.common.collect.Multiset.Entry
>> >>>>
>> >>>> It seems no matter which Entry class I import I get errors like:
>> >>>>
>> >>>> Multiple markers at this line
>> >>>>        - Entry cannot be resolved to a type
>> >>>>        - The constructor
>> >>>>
>> HashSet<Entry<IModifiable,Set<IChangeListener>>>(Set<Map.Entry<IModifiable,Set<IChangeListener>>>)
>> >>>> is
>> >>>>         undefined
>> >>>>        - Incorrect number of arguments for type IntHashMap.Entry; it
>> cannot
>> >>>> be parameterized with arguments <IModifiable,
>> >>>>         Set<IChangeListener>>
>> >>>>
>> >>>> Thanks for any pointers.
>> >>>>
>> >>>> Daniel
>> >>>>
>> >>>>
>> >>>> On Tue, Feb 7, 2012 at 7:07 AM, Martin Grigorov <mg...@apache.org>
>> wrote:
>> >>>>> On Tue, Feb 7, 2012 at 3:53 PM, Daniel Watrous <
>> daniel.watrous@gmail.com> wrote:
>> >>>>>> Thanks Martin,
>> >>>>>>
>> >>>>>> I did make that much progress yesterday after sending this, but I
>> >>>>>> can't figure out how to get the Application inside the
>> onBeginRequest
>> >>>>>> method that I override. In the other examples they call
>> >>>>>> getApplication()
>> >>>>>>
>> >>>>>>    @Override
>> >>>>>>    protected void onBeginRequest() {
>> >>>>>>        if
>> (getApplication().getConfigurationType().equals(Application.DEVELOPMENT))
>> >>>>>> {
>> >>>>>>            final GaeModificationWatcher resourceWatcher =
>> >>>>>> (GaeModificationWatcher) getApplication()
>> >>>>>>                    .getResourceSettings().getResourceWatcher(true);
>> >>>>>>            resourceWatcher.checkResources();
>> >>>>>>        }
>> >>>>>>    }
>> >>>>>>
>> >>>>>> How can I get the Application object?
>> >>>>>
>> >>>>> Application.get()
>> >>>>>
>> >>>>>>
>> >>>>>> Daniel
>> >>>>>>
>> >>>>>> On Mon, Feb 6, 2012 at 11:43 PM, Martin Grigorov <
>> mgrigorov@apache.org> wrote:
>> >>>>>>> Hi,
>> >>>>>>>
>> >>>>>>> On Tue, Feb 7, 2012 at 1:32 AM, Daniel Watrous <
>> daniel.watrous@gmail.com> wrote:
>> >>>>>>>> Hi,
>> >>>>>>>>
>> >>>>>>>> I'm following up on a previous thread that's still unresolved. I
>> would
>> >>>>>>>> like GAE to automatically reload my HTML when I save changes.
>> Classes
>> >>>>>>>> are reloaded when I save (compile) them, but I have to restart
>> each
>> >>>>>>>> time for HTML changes.
>> >>>>>>>>
>> >>>>>>>> There are some old articles that show how to do this, but they
>> deal
>> >>>>>>>> with older versions of Wicket and GAE. For example:
>> >>>>>>>>
>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>> >>>>>>>>
>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
>> >>>>>>>>
>> http://code.google.com/p/kickat26/source/browse/trunk/src/de/kickat26/ui/wicket/GAEModificationWatcher.java
>> >>>>>>>>
>> >>>>>>>> Those suggest creating a class MyWebRequestCycle extends
>> >>>>>>>> WebRequestCycle, but wicket 1.5 doesn't have WebRequestCycle.
>> >>>>>>>>
>> >>>>>>>> How can I accomplish this same thing in the current version of
>> wicket?
>> >>>>>>>
>> >>>>>>> application.getRequestCycleListeners().add(new
>> MyRequestCycleListener())
>> >>>>>>>
>> >>>>>>> class MyRequestCycleListener extends AbstractRequestCycleListener {
>> >>>>>>>  // override the method you need here
>> >>>>>>> }
>> >>>>>>>
>> >>>>>>> Once you have it you can contribute it to gae-initializer project
>> so
>> >>>>>>> other people can re-use it and improve it.
>> >>>>>>>
>> >>>>>>>>
>> >>>>>>>> Daniel
>> >>>>>>>>
>> >>>>>>>>
>> ---------------------------------------------------------------------
>> >>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>>>>>>
>> >>>>>>>
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> --
>> >>>>>>> Martin Grigorov
>> >>>>>>> jWeekend
>> >>>>>>> Training, Consulting, Development
>> >>>>>>> http://jWeekend.com
>> >>>>>>>
>> >>>>>>>
>> ---------------------------------------------------------------------
>> >>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>>>>>
>> >>>>>>
>> >>>>>>
>> ---------------------------------------------------------------------
>> >>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> Martin Grigorov
>> >>>>> jWeekend
>> >>>>> Training, Consulting, Development
>> >>>>> http://jWeekend.com
>> >>>>>
>> >>>>> ---------------------------------------------------------------------
>> >>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>>>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>>>
>> >>>>
>> >>>> ---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Martin Grigorov
>> >>> jWeekend
>> >>> Training, Consulting, Development
>> >>> http://jWeekend.com
>> >>>
>> >>> ---------------------------------------------------------------------
>> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Odeyemi 'Kayode O.
> http://www.sinati.com. t: @charyorde

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


Re: Reload html in Wicket + GAE

Posted by Kayode Odeyemi <dr...@gmail.com>.
Glad you got it working Daniel, as Martin mentioned earlier, I'll
appreciate if you can contribute this to existing GaeInitializer or
somewhere comfortable with the full code so it can be valuable to us all.

Thanks

On Tue, Feb 7, 2012 at 5:31 PM, Daniel Watrous <da...@gmail.com>wrote:

> I finally got it working. Here's the modified function:
>
>        public boolean add(IModifiable modifiable, IChangeListener
> listener) {
>                // TODO Auto-generated method stub
>                checkResources();
>                 HashSet<IChangeListener> listenerSet = new
> HashSet<IChangeListener>();
>                Set<IChangeListener> listeners =
> listenersMap.putIfAbsent(modifiable, listenerSet);
>                if (listeners != null) {
>                        return listeners.add(listener);
>                } else return listenerSet.add(listener);
>        }
>
> I'm not sure if that's a good approach or not, but it works for me and
> that's fantastic.
>
> Daniel
>
> On Tue, Feb 7, 2012 at 9:30 AM, Daniel Watrous <da...@gmail.com>
> wrote:
> > So I was just looking at what I sent along and it seems that
> > putIfAbsent(modifiable, new HashSet<IChangeListener>()) should return
> > the value component, which should be the new HashSet<IChangeListener>.
> > Even if the key modifiable already exists, it should return the
> > previously created HashSet<IChangeListener>.
> >
> > I'm confused that listener is coming back null.
> >
> > Daniel
> >
> > On Tue, Feb 7, 2012 at 9:21 AM, Daniel Watrous <da...@gmail.com>
> wrote:
> >> That helped. I'm getting really close.
> >>
> >> I'm now getting a null pointer exception in this function
> >>
> >>        public boolean add(IModifiable modifiable, IChangeListener
> listener) {
> >>                // TODO Auto-generated method stub
> >>                checkResources();
> >>                Set<IChangeListener> listeners =
> listenersMap.putIfAbsent(modifiable,
> >>                                new HashSet<IChangeListener>());
> >>                return listeners.add(listener);
> >>        }
> >>
> >> listeners is null.
> >>
> >> I noticed that start(Duration pollFrequency) in GaeModificationWatcher
> >> was never getting called, so I updated my WicketApplication to set it
> >> like this:
> >>
> >>                IModificationWatcher watcher = new
> GaeModificationWatcher();
> >>                watcher.start(Duration.ONE_SECOND);
> >>                getResourceSettings().setResourceWatcher(watcher);
> >>
> >> But that didn't help my problem. I'm still trying to follow
> >>
> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
> >>
> >> Any pointers?
> >>
> >> Thanks,
> >> Daniel
> >>
> >> On Tue, Feb 7, 2012 at 8:42 AM, Martin Grigorov <mg...@apache.org>
> wrote:
> >>> Try with java.util.Map.Entry
> >>>
> >>> On Tue, Feb 7, 2012 at 5:39 PM, Daniel Watrous <
> daniel.watrous@gmail.com> wrote:
> >>>> I've now created a class MyRequestCycleListener extends
> >>>> AbstractRequestCycleListener.
> >>>>
> >>>> I'm having a little trouble building  class GaeModificationWatcher
> >>>> implements IModificationWatcher. I've tried following this example:
> >>>>
> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
> >>>>
> >>>> to create the public void checkResources() function, but I'm not sure
> >>>> what Entry class to import. I have tried importing these two Entry
> >>>> classes:
> >>>> org.apache.wicket.util.collections.IntHashMap.Entry
> >>>> import
> com.google.appengine.repackaged.com.google.common.collect.Multiset.Entry
> >>>>
> >>>> It seems no matter which Entry class I import I get errors like:
> >>>>
> >>>> Multiple markers at this line
> >>>>        - Entry cannot be resolved to a type
> >>>>        - The constructor
> >>>>
> HashSet<Entry<IModifiable,Set<IChangeListener>>>(Set<Map.Entry<IModifiable,Set<IChangeListener>>>)
> >>>> is
> >>>>         undefined
> >>>>        - Incorrect number of arguments for type IntHashMap.Entry; it
> cannot
> >>>> be parameterized with arguments <IModifiable,
> >>>>         Set<IChangeListener>>
> >>>>
> >>>> Thanks for any pointers.
> >>>>
> >>>> Daniel
> >>>>
> >>>>
> >>>> On Tue, Feb 7, 2012 at 7:07 AM, Martin Grigorov <mg...@apache.org>
> wrote:
> >>>>> On Tue, Feb 7, 2012 at 3:53 PM, Daniel Watrous <
> daniel.watrous@gmail.com> wrote:
> >>>>>> Thanks Martin,
> >>>>>>
> >>>>>> I did make that much progress yesterday after sending this, but I
> >>>>>> can't figure out how to get the Application inside the
> onBeginRequest
> >>>>>> method that I override. In the other examples they call
> >>>>>> getApplication()
> >>>>>>
> >>>>>>    @Override
> >>>>>>    protected void onBeginRequest() {
> >>>>>>        if
> (getApplication().getConfigurationType().equals(Application.DEVELOPMENT))
> >>>>>> {
> >>>>>>            final GaeModificationWatcher resourceWatcher =
> >>>>>> (GaeModificationWatcher) getApplication()
> >>>>>>                    .getResourceSettings().getResourceWatcher(true);
> >>>>>>            resourceWatcher.checkResources();
> >>>>>>        }
> >>>>>>    }
> >>>>>>
> >>>>>> How can I get the Application object?
> >>>>>
> >>>>> Application.get()
> >>>>>
> >>>>>>
> >>>>>> Daniel
> >>>>>>
> >>>>>> On Mon, Feb 6, 2012 at 11:43 PM, Martin Grigorov <
> mgrigorov@apache.org> wrote:
> >>>>>>> Hi,
> >>>>>>>
> >>>>>>> On Tue, Feb 7, 2012 at 1:32 AM, Daniel Watrous <
> daniel.watrous@gmail.com> wrote:
> >>>>>>>> Hi,
> >>>>>>>>
> >>>>>>>> I'm following up on a previous thread that's still unresolved. I
> would
> >>>>>>>> like GAE to automatically reload my HTML when I save changes.
> Classes
> >>>>>>>> are reloaded when I save (compile) them, but I have to restart
> each
> >>>>>>>> time for HTML changes.
> >>>>>>>>
> >>>>>>>> There are some old articles that show how to do this, but they
> deal
> >>>>>>>> with older versions of Wicket and GAE. For example:
> >>>>>>>>
> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
> >>>>>>>>
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
> >>>>>>>>
> http://code.google.com/p/kickat26/source/browse/trunk/src/de/kickat26/ui/wicket/GAEModificationWatcher.java
> >>>>>>>>
> >>>>>>>> Those suggest creating a class MyWebRequestCycle extends
> >>>>>>>> WebRequestCycle, but wicket 1.5 doesn't have WebRequestCycle.
> >>>>>>>>
> >>>>>>>> How can I accomplish this same thing in the current version of
> wicket?
> >>>>>>>
> >>>>>>> application.getRequestCycleListeners().add(new
> MyRequestCycleListener())
> >>>>>>>
> >>>>>>> class MyRequestCycleListener extends AbstractRequestCycleListener {
> >>>>>>>  // override the method you need here
> >>>>>>> }
> >>>>>>>
> >>>>>>> Once you have it you can contribute it to gae-initializer project
> so
> >>>>>>> other people can re-use it and improve it.
> >>>>>>>
> >>>>>>>>
> >>>>>>>> Daniel
> >>>>>>>>
> >>>>>>>>
> ---------------------------------------------------------------------
> >>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> --
> >>>>>>> Martin Grigorov
> >>>>>>> jWeekend
> >>>>>>> Training, Consulting, Development
> >>>>>>> http://jWeekend.com
> >>>>>>>
> >>>>>>>
> ---------------------------------------------------------------------
> >>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>>>>
> >>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> Martin Grigorov
> >>>>> jWeekend
> >>>>> Training, Consulting, Development
> >>>>> http://jWeekend.com
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Martin Grigorov
> >>> jWeekend
> >>> Training, Consulting, Development
> >>> http://jWeekend.com
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde

Re: Reload html in Wicket + GAE

Posted by Daniel Watrous <da...@gmail.com>.
I finally got it working. Here's the modified function:

	public boolean add(IModifiable modifiable, IChangeListener listener) {
		// TODO Auto-generated method stub
		checkResources();
		HashSet<IChangeListener> listenerSet = new HashSet<IChangeListener>();
		Set<IChangeListener> listeners =
listenersMap.putIfAbsent(modifiable, listenerSet);
		if (listeners != null) {
			return listeners.add(listener);
		} else return listenerSet.add(listener);
	}

I'm not sure if that's a good approach or not, but it works for me and
that's fantastic.

Daniel

On Tue, Feb 7, 2012 at 9:30 AM, Daniel Watrous <da...@gmail.com> wrote:
> So I was just looking at what I sent along and it seems that
> putIfAbsent(modifiable, new HashSet<IChangeListener>()) should return
> the value component, which should be the new HashSet<IChangeListener>.
> Even if the key modifiable already exists, it should return the
> previously created HashSet<IChangeListener>.
>
> I'm confused that listener is coming back null.
>
> Daniel
>
> On Tue, Feb 7, 2012 at 9:21 AM, Daniel Watrous <da...@gmail.com> wrote:
>> That helped. I'm getting really close.
>>
>> I'm now getting a null pointer exception in this function
>>
>>        public boolean add(IModifiable modifiable, IChangeListener listener) {
>>                // TODO Auto-generated method stub
>>                checkResources();
>>                Set<IChangeListener> listeners = listenersMap.putIfAbsent(modifiable,
>>                                new HashSet<IChangeListener>());
>>                return listeners.add(listener);
>>        }
>>
>> listeners is null.
>>
>> I noticed that start(Duration pollFrequency) in GaeModificationWatcher
>> was never getting called, so I updated my WicketApplication to set it
>> like this:
>>
>>                IModificationWatcher watcher = new GaeModificationWatcher();
>>                watcher.start(Duration.ONE_SECOND);
>>                getResourceSettings().setResourceWatcher(watcher);
>>
>> But that didn't help my problem. I'm still trying to follow
>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>>
>> Any pointers?
>>
>> Thanks,
>> Daniel
>>
>> On Tue, Feb 7, 2012 at 8:42 AM, Martin Grigorov <mg...@apache.org> wrote:
>>> Try with java.util.Map.Entry
>>>
>>> On Tue, Feb 7, 2012 at 5:39 PM, Daniel Watrous <da...@gmail.com> wrote:
>>>> I've now created a class MyRequestCycleListener extends
>>>> AbstractRequestCycleListener.
>>>>
>>>> I'm having a little trouble building  class GaeModificationWatcher
>>>> implements IModificationWatcher. I've tried following this example:
>>>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>>>>
>>>> to create the public void checkResources() function, but I'm not sure
>>>> what Entry class to import. I have tried importing these two Entry
>>>> classes:
>>>> org.apache.wicket.util.collections.IntHashMap.Entry
>>>> import com.google.appengine.repackaged.com.google.common.collect.Multiset.Entry
>>>>
>>>> It seems no matter which Entry class I import I get errors like:
>>>>
>>>> Multiple markers at this line
>>>>        - Entry cannot be resolved to a type
>>>>        - The constructor
>>>> HashSet<Entry<IModifiable,Set<IChangeListener>>>(Set<Map.Entry<IModifiable,Set<IChangeListener>>>)
>>>> is
>>>>         undefined
>>>>        - Incorrect number of arguments for type IntHashMap.Entry; it cannot
>>>> be parameterized with arguments <IModifiable,
>>>>         Set<IChangeListener>>
>>>>
>>>> Thanks for any pointers.
>>>>
>>>> Daniel
>>>>
>>>>
>>>> On Tue, Feb 7, 2012 at 7:07 AM, Martin Grigorov <mg...@apache.org> wrote:
>>>>> On Tue, Feb 7, 2012 at 3:53 PM, Daniel Watrous <da...@gmail.com> wrote:
>>>>>> Thanks Martin,
>>>>>>
>>>>>> I did make that much progress yesterday after sending this, but I
>>>>>> can't figure out how to get the Application inside the onBeginRequest
>>>>>> method that I override. In the other examples they call
>>>>>> getApplication()
>>>>>>
>>>>>>    @Override
>>>>>>    protected void onBeginRequest() {
>>>>>>        if (getApplication().getConfigurationType().equals(Application.DEVELOPMENT))
>>>>>> {
>>>>>>            final GaeModificationWatcher resourceWatcher =
>>>>>> (GaeModificationWatcher) getApplication()
>>>>>>                    .getResourceSettings().getResourceWatcher(true);
>>>>>>            resourceWatcher.checkResources();
>>>>>>        }
>>>>>>    }
>>>>>>
>>>>>> How can I get the Application object?
>>>>>
>>>>> Application.get()
>>>>>
>>>>>>
>>>>>> Daniel
>>>>>>
>>>>>> On Mon, Feb 6, 2012 at 11:43 PM, Martin Grigorov <mg...@apache.org> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> On Tue, Feb 7, 2012 at 1:32 AM, Daniel Watrous <da...@gmail.com> wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I'm following up on a previous thread that's still unresolved. I would
>>>>>>>> like GAE to automatically reload my HTML when I save changes. Classes
>>>>>>>> are reloaded when I save (compile) them, but I have to restart each
>>>>>>>> time for HTML changes.
>>>>>>>>
>>>>>>>> There are some old articles that show how to do this, but they deal
>>>>>>>> with older versions of Wicket and GAE. For example:
>>>>>>>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>>>>>>>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
>>>>>>>> http://code.google.com/p/kickat26/source/browse/trunk/src/de/kickat26/ui/wicket/GAEModificationWatcher.java
>>>>>>>>
>>>>>>>> Those suggest creating a class MyWebRequestCycle extends
>>>>>>>> WebRequestCycle, but wicket 1.5 doesn't have WebRequestCycle.
>>>>>>>>
>>>>>>>> How can I accomplish this same thing in the current version of wicket?
>>>>>>>
>>>>>>> application.getRequestCycleListeners().add(new MyRequestCycleListener())
>>>>>>>
>>>>>>> class MyRequestCycleListener extends AbstractRequestCycleListener {
>>>>>>>  // override the method you need here
>>>>>>> }
>>>>>>>
>>>>>>> Once you have it you can contribute it to gae-initializer project so
>>>>>>> other people can re-use it and improve it.
>>>>>>>
>>>>>>>>
>>>>>>>> Daniel
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Martin Grigorov
>>>>>>> jWeekend
>>>>>>> Training, Consulting, Development
>>>>>>> http://jWeekend.com
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Martin Grigorov
>>>>> jWeekend
>>>>> Training, Consulting, Development
>>>>> http://jWeekend.com
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>

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


Re: Reload html in Wicket + GAE

Posted by Daniel Watrous <da...@gmail.com>.
So I was just looking at what I sent along and it seems that
putIfAbsent(modifiable, new HashSet<IChangeListener>()) should return
the value component, which should be the new HashSet<IChangeListener>.
Even if the key modifiable already exists, it should return the
previously created HashSet<IChangeListener>.

I'm confused that listener is coming back null.

Daniel

On Tue, Feb 7, 2012 at 9:21 AM, Daniel Watrous <da...@gmail.com> wrote:
> That helped. I'm getting really close.
>
> I'm now getting a null pointer exception in this function
>
>        public boolean add(IModifiable modifiable, IChangeListener listener) {
>                // TODO Auto-generated method stub
>                checkResources();
>                Set<IChangeListener> listeners = listenersMap.putIfAbsent(modifiable,
>                                new HashSet<IChangeListener>());
>                return listeners.add(listener);
>        }
>
> listeners is null.
>
> I noticed that start(Duration pollFrequency) in GaeModificationWatcher
> was never getting called, so I updated my WicketApplication to set it
> like this:
>
>                IModificationWatcher watcher = new GaeModificationWatcher();
>                watcher.start(Duration.ONE_SECOND);
>                getResourceSettings().setResourceWatcher(watcher);
>
> But that didn't help my problem. I'm still trying to follow
> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>
> Any pointers?
>
> Thanks,
> Daniel
>
> On Tue, Feb 7, 2012 at 8:42 AM, Martin Grigorov <mg...@apache.org> wrote:
>> Try with java.util.Map.Entry
>>
>> On Tue, Feb 7, 2012 at 5:39 PM, Daniel Watrous <da...@gmail.com> wrote:
>>> I've now created a class MyRequestCycleListener extends
>>> AbstractRequestCycleListener.
>>>
>>> I'm having a little trouble building  class GaeModificationWatcher
>>> implements IModificationWatcher. I've tried following this example:
>>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>>>
>>> to create the public void checkResources() function, but I'm not sure
>>> what Entry class to import. I have tried importing these two Entry
>>> classes:
>>> org.apache.wicket.util.collections.IntHashMap.Entry
>>> import com.google.appengine.repackaged.com.google.common.collect.Multiset.Entry
>>>
>>> It seems no matter which Entry class I import I get errors like:
>>>
>>> Multiple markers at this line
>>>        - Entry cannot be resolved to a type
>>>        - The constructor
>>> HashSet<Entry<IModifiable,Set<IChangeListener>>>(Set<Map.Entry<IModifiable,Set<IChangeListener>>>)
>>> is
>>>         undefined
>>>        - Incorrect number of arguments for type IntHashMap.Entry; it cannot
>>> be parameterized with arguments <IModifiable,
>>>         Set<IChangeListener>>
>>>
>>> Thanks for any pointers.
>>>
>>> Daniel
>>>
>>>
>>> On Tue, Feb 7, 2012 at 7:07 AM, Martin Grigorov <mg...@apache.org> wrote:
>>>> On Tue, Feb 7, 2012 at 3:53 PM, Daniel Watrous <da...@gmail.com> wrote:
>>>>> Thanks Martin,
>>>>>
>>>>> I did make that much progress yesterday after sending this, but I
>>>>> can't figure out how to get the Application inside the onBeginRequest
>>>>> method that I override. In the other examples they call
>>>>> getApplication()
>>>>>
>>>>>    @Override
>>>>>    protected void onBeginRequest() {
>>>>>        if (getApplication().getConfigurationType().equals(Application.DEVELOPMENT))
>>>>> {
>>>>>            final GaeModificationWatcher resourceWatcher =
>>>>> (GaeModificationWatcher) getApplication()
>>>>>                    .getResourceSettings().getResourceWatcher(true);
>>>>>            resourceWatcher.checkResources();
>>>>>        }
>>>>>    }
>>>>>
>>>>> How can I get the Application object?
>>>>
>>>> Application.get()
>>>>
>>>>>
>>>>> Daniel
>>>>>
>>>>> On Mon, Feb 6, 2012 at 11:43 PM, Martin Grigorov <mg...@apache.org> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> On Tue, Feb 7, 2012 at 1:32 AM, Daniel Watrous <da...@gmail.com> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm following up on a previous thread that's still unresolved. I would
>>>>>>> like GAE to automatically reload my HTML when I save changes. Classes
>>>>>>> are reloaded when I save (compile) them, but I have to restart each
>>>>>>> time for HTML changes.
>>>>>>>
>>>>>>> There are some old articles that show how to do this, but they deal
>>>>>>> with older versions of Wicket and GAE. For example:
>>>>>>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>>>>>>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
>>>>>>> http://code.google.com/p/kickat26/source/browse/trunk/src/de/kickat26/ui/wicket/GAEModificationWatcher.java
>>>>>>>
>>>>>>> Those suggest creating a class MyWebRequestCycle extends
>>>>>>> WebRequestCycle, but wicket 1.5 doesn't have WebRequestCycle.
>>>>>>>
>>>>>>> How can I accomplish this same thing in the current version of wicket?
>>>>>>
>>>>>> application.getRequestCycleListeners().add(new MyRequestCycleListener())
>>>>>>
>>>>>> class MyRequestCycleListener extends AbstractRequestCycleListener {
>>>>>>  // override the method you need here
>>>>>> }
>>>>>>
>>>>>> Once you have it you can contribute it to gae-initializer project so
>>>>>> other people can re-use it and improve it.
>>>>>>
>>>>>>>
>>>>>>> Daniel
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Martin Grigorov
>>>>>> jWeekend
>>>>>> Training, Consulting, Development
>>>>>> http://jWeekend.com
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Martin Grigorov
>>>> jWeekend
>>>> Training, Consulting, Development
>>>> http://jWeekend.com
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>

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


Re: Reload html in Wicket + GAE

Posted by Daniel Watrous <da...@gmail.com>.
That helped. I'm getting really close.

I'm now getting a null pointer exception in this function

	public boolean add(IModifiable modifiable, IChangeListener listener) {
		// TODO Auto-generated method stub
		checkResources();
		Set<IChangeListener> listeners = listenersMap.putIfAbsent(modifiable,
				new HashSet<IChangeListener>());
		return listeners.add(listener);
	}

listeners is null.

I noticed that start(Duration pollFrequency) in GaeModificationWatcher
was never getting called, so I updated my WicketApplication to set it
like this:

		IModificationWatcher watcher = new GaeModificationWatcher();
		watcher.start(Duration.ONE_SECOND);
		getResourceSettings().setResourceWatcher(watcher);

But that didn't help my problem. I'm still trying to follow
http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html

Any pointers?

Thanks,
Daniel

On Tue, Feb 7, 2012 at 8:42 AM, Martin Grigorov <mg...@apache.org> wrote:
> Try with java.util.Map.Entry
>
> On Tue, Feb 7, 2012 at 5:39 PM, Daniel Watrous <da...@gmail.com> wrote:
>> I've now created a class MyRequestCycleListener extends
>> AbstractRequestCycleListener.
>>
>> I'm having a little trouble building  class GaeModificationWatcher
>> implements IModificationWatcher. I've tried following this example:
>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>>
>> to create the public void checkResources() function, but I'm not sure
>> what Entry class to import. I have tried importing these two Entry
>> classes:
>> org.apache.wicket.util.collections.IntHashMap.Entry
>> import com.google.appengine.repackaged.com.google.common.collect.Multiset.Entry
>>
>> It seems no matter which Entry class I import I get errors like:
>>
>> Multiple markers at this line
>>        - Entry cannot be resolved to a type
>>        - The constructor
>> HashSet<Entry<IModifiable,Set<IChangeListener>>>(Set<Map.Entry<IModifiable,Set<IChangeListener>>>)
>> is
>>         undefined
>>        - Incorrect number of arguments for type IntHashMap.Entry; it cannot
>> be parameterized with arguments <IModifiable,
>>         Set<IChangeListener>>
>>
>> Thanks for any pointers.
>>
>> Daniel
>>
>>
>> On Tue, Feb 7, 2012 at 7:07 AM, Martin Grigorov <mg...@apache.org> wrote:
>>> On Tue, Feb 7, 2012 at 3:53 PM, Daniel Watrous <da...@gmail.com> wrote:
>>>> Thanks Martin,
>>>>
>>>> I did make that much progress yesterday after sending this, but I
>>>> can't figure out how to get the Application inside the onBeginRequest
>>>> method that I override. In the other examples they call
>>>> getApplication()
>>>>
>>>>    @Override
>>>>    protected void onBeginRequest() {
>>>>        if (getApplication().getConfigurationType().equals(Application.DEVELOPMENT))
>>>> {
>>>>            final GaeModificationWatcher resourceWatcher =
>>>> (GaeModificationWatcher) getApplication()
>>>>                    .getResourceSettings().getResourceWatcher(true);
>>>>            resourceWatcher.checkResources();
>>>>        }
>>>>    }
>>>>
>>>> How can I get the Application object?
>>>
>>> Application.get()
>>>
>>>>
>>>> Daniel
>>>>
>>>> On Mon, Feb 6, 2012 at 11:43 PM, Martin Grigorov <mg...@apache.org> wrote:
>>>>> Hi,
>>>>>
>>>>> On Tue, Feb 7, 2012 at 1:32 AM, Daniel Watrous <da...@gmail.com> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I'm following up on a previous thread that's still unresolved. I would
>>>>>> like GAE to automatically reload my HTML when I save changes. Classes
>>>>>> are reloaded when I save (compile) them, but I have to restart each
>>>>>> time for HTML changes.
>>>>>>
>>>>>> There are some old articles that show how to do this, but they deal
>>>>>> with older versions of Wicket and GAE. For example:
>>>>>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>>>>>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
>>>>>> http://code.google.com/p/kickat26/source/browse/trunk/src/de/kickat26/ui/wicket/GAEModificationWatcher.java
>>>>>>
>>>>>> Those suggest creating a class MyWebRequestCycle extends
>>>>>> WebRequestCycle, but wicket 1.5 doesn't have WebRequestCycle.
>>>>>>
>>>>>> How can I accomplish this same thing in the current version of wicket?
>>>>>
>>>>> application.getRequestCycleListeners().add(new MyRequestCycleListener())
>>>>>
>>>>> class MyRequestCycleListener extends AbstractRequestCycleListener {
>>>>>  // override the method you need here
>>>>> }
>>>>>
>>>>> Once you have it you can contribute it to gae-initializer project so
>>>>> other people can re-use it and improve it.
>>>>>
>>>>>>
>>>>>> Daniel
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Martin Grigorov
>>>>> jWeekend
>>>>> Training, Consulting, Development
>>>>> http://jWeekend.com
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

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


Re: Reload html in Wicket + GAE

Posted by Martin Grigorov <mg...@apache.org>.
Try with java.util.Map.Entry

On Tue, Feb 7, 2012 at 5:39 PM, Daniel Watrous <da...@gmail.com> wrote:
> I've now created a class MyRequestCycleListener extends
> AbstractRequestCycleListener.
>
> I'm having a little trouble building  class GaeModificationWatcher
> implements IModificationWatcher. I've tried following this example:
> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>
> to create the public void checkResources() function, but I'm not sure
> what Entry class to import. I have tried importing these two Entry
> classes:
> org.apache.wicket.util.collections.IntHashMap.Entry
> import com.google.appengine.repackaged.com.google.common.collect.Multiset.Entry
>
> It seems no matter which Entry class I import I get errors like:
>
> Multiple markers at this line
>        - Entry cannot be resolved to a type
>        - The constructor
> HashSet<Entry<IModifiable,Set<IChangeListener>>>(Set<Map.Entry<IModifiable,Set<IChangeListener>>>)
> is
>         undefined
>        - Incorrect number of arguments for type IntHashMap.Entry; it cannot
> be parameterized with arguments <IModifiable,
>         Set<IChangeListener>>
>
> Thanks for any pointers.
>
> Daniel
>
>
> On Tue, Feb 7, 2012 at 7:07 AM, Martin Grigorov <mg...@apache.org> wrote:
>> On Tue, Feb 7, 2012 at 3:53 PM, Daniel Watrous <da...@gmail.com> wrote:
>>> Thanks Martin,
>>>
>>> I did make that much progress yesterday after sending this, but I
>>> can't figure out how to get the Application inside the onBeginRequest
>>> method that I override. In the other examples they call
>>> getApplication()
>>>
>>>    @Override
>>>    protected void onBeginRequest() {
>>>        if (getApplication().getConfigurationType().equals(Application.DEVELOPMENT))
>>> {
>>>            final GaeModificationWatcher resourceWatcher =
>>> (GaeModificationWatcher) getApplication()
>>>                    .getResourceSettings().getResourceWatcher(true);
>>>            resourceWatcher.checkResources();
>>>        }
>>>    }
>>>
>>> How can I get the Application object?
>>
>> Application.get()
>>
>>>
>>> Daniel
>>>
>>> On Mon, Feb 6, 2012 at 11:43 PM, Martin Grigorov <mg...@apache.org> wrote:
>>>> Hi,
>>>>
>>>> On Tue, Feb 7, 2012 at 1:32 AM, Daniel Watrous <da...@gmail.com> wrote:
>>>>> Hi,
>>>>>
>>>>> I'm following up on a previous thread that's still unresolved. I would
>>>>> like GAE to automatically reload my HTML when I save changes. Classes
>>>>> are reloaded when I save (compile) them, but I have to restart each
>>>>> time for HTML changes.
>>>>>
>>>>> There are some old articles that show how to do this, but they deal
>>>>> with older versions of Wicket and GAE. For example:
>>>>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>>>>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
>>>>> http://code.google.com/p/kickat26/source/browse/trunk/src/de/kickat26/ui/wicket/GAEModificationWatcher.java
>>>>>
>>>>> Those suggest creating a class MyWebRequestCycle extends
>>>>> WebRequestCycle, but wicket 1.5 doesn't have WebRequestCycle.
>>>>>
>>>>> How can I accomplish this same thing in the current version of wicket?
>>>>
>>>> application.getRequestCycleListeners().add(new MyRequestCycleListener())
>>>>
>>>> class MyRequestCycleListener extends AbstractRequestCycleListener {
>>>>  // override the method you need here
>>>> }
>>>>
>>>> Once you have it you can contribute it to gae-initializer project so
>>>> other people can re-use it and improve it.
>>>>
>>>>>
>>>>> Daniel
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Martin Grigorov
>>>> jWeekend
>>>> Training, Consulting, Development
>>>> http://jWeekend.com
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Reload html in Wicket + GAE

Posted by Daniel Watrous <da...@gmail.com>.
I've now created a class MyRequestCycleListener extends
AbstractRequestCycleListener.

I'm having a little trouble building  class GaeModificationWatcher
implements IModificationWatcher. I've tried following this example:
http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html

to create the public void checkResources() function, but I'm not sure
what Entry class to import. I have tried importing these two Entry
classes:
org.apache.wicket.util.collections.IntHashMap.Entry
import com.google.appengine.repackaged.com.google.common.collect.Multiset.Entry

It seems no matter which Entry class I import I get errors like:

Multiple markers at this line
	- Entry cannot be resolved to a type
	- The constructor
HashSet<Entry<IModifiable,Set<IChangeListener>>>(Set<Map.Entry<IModifiable,Set<IChangeListener>>>)
is
	 undefined
	- Incorrect number of arguments for type IntHashMap.Entry; it cannot
be parameterized with arguments <IModifiable,
	 Set<IChangeListener>>

Thanks for any pointers.

Daniel


On Tue, Feb 7, 2012 at 7:07 AM, Martin Grigorov <mg...@apache.org> wrote:
> On Tue, Feb 7, 2012 at 3:53 PM, Daniel Watrous <da...@gmail.com> wrote:
>> Thanks Martin,
>>
>> I did make that much progress yesterday after sending this, but I
>> can't figure out how to get the Application inside the onBeginRequest
>> method that I override. In the other examples they call
>> getApplication()
>>
>>    @Override
>>    protected void onBeginRequest() {
>>        if (getApplication().getConfigurationType().equals(Application.DEVELOPMENT))
>> {
>>            final GaeModificationWatcher resourceWatcher =
>> (GaeModificationWatcher) getApplication()
>>                    .getResourceSettings().getResourceWatcher(true);
>>            resourceWatcher.checkResources();
>>        }
>>    }
>>
>> How can I get the Application object?
>
> Application.get()
>
>>
>> Daniel
>>
>> On Mon, Feb 6, 2012 at 11:43 PM, Martin Grigorov <mg...@apache.org> wrote:
>>> Hi,
>>>
>>> On Tue, Feb 7, 2012 at 1:32 AM, Daniel Watrous <da...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I'm following up on a previous thread that's still unresolved. I would
>>>> like GAE to automatically reload my HTML when I save changes. Classes
>>>> are reloaded when I save (compile) them, but I have to restart each
>>>> time for HTML changes.
>>>>
>>>> There are some old articles that show how to do this, but they deal
>>>> with older versions of Wicket and GAE. For example:
>>>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>>>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
>>>> http://code.google.com/p/kickat26/source/browse/trunk/src/de/kickat26/ui/wicket/GAEModificationWatcher.java
>>>>
>>>> Those suggest creating a class MyWebRequestCycle extends
>>>> WebRequestCycle, but wicket 1.5 doesn't have WebRequestCycle.
>>>>
>>>> How can I accomplish this same thing in the current version of wicket?
>>>
>>> application.getRequestCycleListeners().add(new MyRequestCycleListener())
>>>
>>> class MyRequestCycleListener extends AbstractRequestCycleListener {
>>>  // override the method you need here
>>> }
>>>
>>> Once you have it you can contribute it to gae-initializer project so
>>> other people can re-use it and improve it.
>>>
>>>>
>>>> Daniel
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

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


Re: Reload html in Wicket + GAE

Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Feb 7, 2012 at 3:53 PM, Daniel Watrous <da...@gmail.com> wrote:
> Thanks Martin,
>
> I did make that much progress yesterday after sending this, but I
> can't figure out how to get the Application inside the onBeginRequest
> method that I override. In the other examples they call
> getApplication()
>
>    @Override
>    protected void onBeginRequest() {
>        if (getApplication().getConfigurationType().equals(Application.DEVELOPMENT))
> {
>            final GaeModificationWatcher resourceWatcher =
> (GaeModificationWatcher) getApplication()
>                    .getResourceSettings().getResourceWatcher(true);
>            resourceWatcher.checkResources();
>        }
>    }
>
> How can I get the Application object?

Application.get()

>
> Daniel
>
> On Mon, Feb 6, 2012 at 11:43 PM, Martin Grigorov <mg...@apache.org> wrote:
>> Hi,
>>
>> On Tue, Feb 7, 2012 at 1:32 AM, Daniel Watrous <da...@gmail.com> wrote:
>>> Hi,
>>>
>>> I'm following up on a previous thread that's still unresolved. I would
>>> like GAE to automatically reload my HTML when I save changes. Classes
>>> are reloaded when I save (compile) them, but I have to restart each
>>> time for HTML changes.
>>>
>>> There are some old articles that show how to do this, but they deal
>>> with older versions of Wicket and GAE. For example:
>>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
>>> http://code.google.com/p/kickat26/source/browse/trunk/src/de/kickat26/ui/wicket/GAEModificationWatcher.java
>>>
>>> Those suggest creating a class MyWebRequestCycle extends
>>> WebRequestCycle, but wicket 1.5 doesn't have WebRequestCycle.
>>>
>>> How can I accomplish this same thing in the current version of wicket?
>>
>> application.getRequestCycleListeners().add(new MyRequestCycleListener())
>>
>> class MyRequestCycleListener extends AbstractRequestCycleListener {
>>  // override the method you need here
>> }
>>
>> Once you have it you can contribute it to gae-initializer project so
>> other people can re-use it and improve it.
>>
>>>
>>> Daniel
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Reload html in Wicket + GAE

Posted by Daniel Watrous <da...@gmail.com>.
Thanks Martin,

I did make that much progress yesterday after sending this, but I
can't figure out how to get the Application inside the onBeginRequest
method that I override. In the other examples they call
getApplication()

    @Override
    protected void onBeginRequest() {
        if (getApplication().getConfigurationType().equals(Application.DEVELOPMENT))
{
            final GaeModificationWatcher resourceWatcher =
(GaeModificationWatcher) getApplication()
                    .getResourceSettings().getResourceWatcher(true);
            resourceWatcher.checkResources();
        }
    }

How can I get the Application object?

Daniel

On Mon, Feb 6, 2012 at 11:43 PM, Martin Grigorov <mg...@apache.org> wrote:
> Hi,
>
> On Tue, Feb 7, 2012 at 1:32 AM, Daniel Watrous <da...@gmail.com> wrote:
>> Hi,
>>
>> I'm following up on a previous thread that's still unresolved. I would
>> like GAE to automatically reload my HTML when I save changes. Classes
>> are reloaded when I save (compile) them, but I have to restart each
>> time for HTML changes.
>>
>> There are some old articles that show how to do this, but they deal
>> with older versions of Wicket and GAE. For example:
>> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
>> http://code.google.com/p/kickat26/source/browse/trunk/src/de/kickat26/ui/wicket/GAEModificationWatcher.java
>>
>> Those suggest creating a class MyWebRequestCycle extends
>> WebRequestCycle, but wicket 1.5 doesn't have WebRequestCycle.
>>
>> How can I accomplish this same thing in the current version of wicket?
>
> application.getRequestCycleListeners().add(new MyRequestCycleListener())
>
> class MyRequestCycleListener extends AbstractRequestCycleListener {
>  // override the method you need here
> }
>
> Once you have it you can contribute it to gae-initializer project so
> other people can re-use it and improve it.
>
>>
>> Daniel
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

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


Re: Reload html in Wicket + GAE

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

On Tue, Feb 7, 2012 at 1:32 AM, Daniel Watrous <da...@gmail.com> wrote:
> Hi,
>
> I'm following up on a previous thread that's still unresolved. I would
> like GAE to automatically reload my HTML when I save changes. Classes
> are reloaded when I save (compile) them, but I have to restart each
> time for HTML changes.
>
> There are some old articles that show how to do this, but they deal
> with older versions of Wicket and GAE. For example:
> http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
> http://code.google.com/p/kickat26/source/browse/trunk/src/de/kickat26/ui/wicket/GAEModificationWatcher.java
>
> Those suggest creating a class MyWebRequestCycle extends
> WebRequestCycle, but wicket 1.5 doesn't have WebRequestCycle.
>
> How can I accomplish this same thing in the current version of wicket?

application.getRequestCycleListeners().add(new MyRequestCycleListener())

class MyRequestCycleListener extends AbstractRequestCycleListener {
 // override the method you need here
}

Once you have it you can contribute it to gae-initializer project so
other people can re-use it and improve it.

>
> Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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