You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Mike Mander <wi...@gmx.de> on 2011/08/18 13:51:52 UTC

Log bookmarkable page link execution

Hi,

i would like to log execution of bookmarkable page links. I know that 
they are only renderered in markup and call the page from the browser.

Maybe someone has a hint for me here?

Thanks
Mike

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


RE: Log bookmarkable page link execution

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
Not sure if this is the same as what you want but we've made all our
page classes derive from a common base which performs the logging
function in the constructor so that you can't miss a log. You can do
some reflection to grab the name of the page class instance or create a
method that is overridden by every page class.

The later method has the advantage that it can include context
information as well.

>-----Original Message-----
>From: Mike Mander [mailto:wicket-mike@gmx.de]
>Sent: Thursday, 18 August 2011 9:52 PM
>To: users@wicket.apache.org
>Subject: Log bookmarkable page link execution
>
>Hi,
>
>i would like to log execution of bookmarkable page links. I know that
>they are only renderered in markup and call the page from the browser.
>
>Maybe someone has a hint for me here?
>
>Thanks
>Mike
>
>---------------------------------------------------------------------
>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: Log bookmarkable page link execution

Posted by Dan Retzlaff <dr...@gmail.com>.
Mike, since I didn't really understand your use case, I'm not sure a
site-wide link decorator is the best way to go. You might keep it simple and
just print a log statement when certain actions are performed, then
periodically grep through your log files to generate statistics. My
suggestion assumed you wanted to know both the "from" and "to" of each
bookmarkable link click.

Chris, I can see how that would work. I guess I'm of the opinion that Wicket
provides enough listener hooks that inheritance needn't come into the
picture. It's easy to inherit one behavior, but things can get messy when
you want to mix in multiple behaviors. If some use case requires
per-component customization as you suggest, you can throw an interface
specific to the use case onto those particular components and do some
"instanceof" checks in your application-wide listeners.

On Thu, Aug 18, 2011 at 11:23 PM, Mike Mander <wi...@gmx.de> wrote:

> Thanks Dan,
>
> my intention is to track ux with our shop. We have for instance a link you
> can configure how many
> products you see per page. Because we don't know what is the best "view
> size" we want to check
> if users use our preselection or "always" change it to other values.
>
> I will try your suggestion and post the solution (if i can :-).
>
> Thanks
> Mike
>
>  Is your goal to understand which links are used to open certain
>> bookmarkable
>> pages? If so, here's an approach that might get you started.
>>
>> Create a Behavior which appends a tracking query parameter to
>> BookmarkablePageLinks. You could add it manually to each link you want to
>> track, or apply it application-wide through
>> an IComponentOnBeforeRenderListen**er registered with
>> Application#**addPreComponentOnBeforeRenderL**istener(). Then you you'd
>> have to
>> watch for these query parameters in subsequent application requests, maybe
>> by inspecting the Request object in an Application#newRequestCycle()
>> override.
>>
>> Hope that helps,
>> Dan
>>
>> On Thu, Aug 18, 2011 at 4:51 AM, Mike Mander<wi...@gmx.de>  wrote:
>>
>>  Hi,
>>>
>>> i would like to log execution of bookmarkable page links. I know that
>>> they
>>> are only renderered in markup and call the page from the browser.
>>>
>>> Maybe someone has a hint for me here?
>>>
>>> Thanks
>>> Mike
>>>
>>> ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>> <us...@wicket.apache.org>
>>> >
>>>
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Log bookmarkable page link execution

Posted by Mike Mander <wi...@gmx.de>.
Thanks Dan,

my intention is to track ux with our shop. We have for instance a link 
you can configure how many
products you see per page. Because we don't know what is the best "view 
size" we want to check
if users use our preselection or "always" change it to other values.

I will try your suggestion and post the solution (if i can :-).

Thanks
Mike

> Is your goal to understand which links are used to open certain bookmarkable
> pages? If so, here's an approach that might get you started.
>
> Create a Behavior which appends a tracking query parameter to
> BookmarkablePageLinks. You could add it manually to each link you want to
> track, or apply it application-wide through
> an IComponentOnBeforeRenderListener registered with
> Application#addPreComponentOnBeforeRenderListener(). Then you you'd have to
> watch for these query parameters in subsequent application requests, maybe
> by inspecting the Request object in an Application#newRequestCycle()
> override.
>
> Hope that helps,
> Dan
>
> On Thu, Aug 18, 2011 at 4:51 AM, Mike Mander<wi...@gmx.de>  wrote:
>
>> Hi,
>>
>> i would like to log execution of bookmarkable page links. I know that they
>> are only renderered in markup and call the page from the browser.
>>
>> Maybe someone has a hint for me here?
>>
>> Thanks
>> Mike
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@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: Log bookmarkable page link execution

Posted by Dan Retzlaff <dr...@gmail.com>.
Is your goal to understand which links are used to open certain bookmarkable
pages? If so, here's an approach that might get you started.

Create a Behavior which appends a tracking query parameter to
BookmarkablePageLinks. You could add it manually to each link you want to
track, or apply it application-wide through
an IComponentOnBeforeRenderListener registered with
Application#addPreComponentOnBeforeRenderListener(). Then you you'd have to
watch for these query parameters in subsequent application requests, maybe
by inspecting the Request object in an Application#newRequestCycle()
override.

Hope that helps,
Dan

On Thu, Aug 18, 2011 at 4:51 AM, Mike Mander <wi...@gmx.de> wrote:

> Hi,
>
> i would like to log execution of bookmarkable page links. I know that they
> are only renderered in markup and call the page from the browser.
>
> Maybe someone has a hint for me here?
>
> Thanks
> Mike
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Log bookmarkable page link execution

Posted by Martijn Dashorst <ma...@gmail.com>.
Why not use the RequestLogger? (see chapter 14 of Wicket in Action)

Martijn

On Thu, Aug 18, 2011 at 1:51 PM, Mike Mander <wi...@gmx.de> wrote:
> Hi,
>
> i would like to log execution of bookmarkable page links. I know that they
> are only renderered in markup and call the page from the browser.
>
> Maybe someone has a hint for me here?
>
> Thanks
> Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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