By Pass the rendering strategie and set the HTTP return code

2013-01-09 Thread Gaetan Zoritchak
Hi all,

I've got a public website on which I fight against spammer.

In the case of a form submit by a spamer, I would like to return a basic
response with an error code 500  (I hope that the tools used by spamer
check the return code to optimize the list of sites they spam).  I don't
find where and how to do that. Does anyone have an idea?

Thanks,

Gaetan,


Re: By Pass the rendering strategie and set the HTTP return code

2013-01-09 Thread Gaetan Zoritchak
This is actually the easiest way. No control on the rendering but a good
500 code status.

Thanks,


2013/1/9 francois meillet francois.meil...@gmail.com

 throw new

 AbortWithHttpErrorCodeException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR)



Using AutocompleteTextField with database entries (without a converter)

2012-10-24 Thread Gaetan Zoritchak
Hello,
I don't know what is the best way of impleting that in Wicket

That's my use case:
- the user has to select a customer in a field of a form,
- he starts to type some characters,
- the list shows some possibilities based on a database request using the
first and last names, the email, ...
- then he selects one item in the list,
- the field just shows few informations (Last Name for exemple).

I don't want to use a converter because the data in the field could
eventually match more than one entry in the database. I can give more
context in the list to make the user be sure of his selection. When the
selection is made, I can put a title so that on a mouse over event the user
visualize the full information on the customer selection.

The best solution would be to use the database id of the customer as a key
during the selection phase.

I don't know what is the best way of implementing this behaviour.

Thanks a lot for any ideas,

Gaetan,


Re: Using AutocompleteTextField with database entries (without a converter)

2012-10-24 Thread Gaetan Zoritchak
Thanks for the input. I'm going to have a look.

Gaetan
2012/10/24 Paul Bors p...@bors.ws

 Take a look at Select2 developed by Ivan Vaynberg one of Wicket's
 contributors:
 http://ivaynberg.github.com/select2/

 You should try out the Loading Remote Data and Infinite Scroll with
 Remote Data examples.

 Thanks Ivan for a great job!

 ~ Thank you,
   Paul Bors

 -Original Message-
 From: Gaetan Zoritchak [mailto:g.zoritc...@moncoachfinance.com]
 Sent: Wednesday, October 24, 2012 9:39 AM
 To: users@wicket.apache.org
 Subject: Using AutocompleteTextField with database entries (without a
 converter)

 Hello,
 I don't know what is the best way of impleting that in Wicket

 That's my use case:
 - the user has to select a customer in a field of a form,
 - he starts to type some characters,
 - the list shows some possibilities based on a database request using the
 first and last names, the email, ...
 - then he selects one item in the list,
 - the field just shows few informations (Last Name for exemple).

 I don't want to use a converter because the data in the field could
 eventually match more than one entry in the database. I can give more
 context in the list to make the user be sure of his selection. When the
 selection is made, I can put a title so that on a mouse over event the user
 visualize the full information on the customer selection.

 The best solution would be to use the database id of the customer as a key
 during the selection phase.

 I don't know what is the best way of implementing this behaviour.

 Thanks a lot for any ideas,

 Gaetan,


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




Using Autocomplete with a

2012-10-22 Thread Gaetan Zoritchak
Hi,
I want to have a behavior similar to AutoCompleteTextField but without the
conversion.
That's my use case:
- the user has to select a customer in a field,
- he starts to type some characters,
- the list shows some possibilities based on a database request using the
first and last names, the email, ...
- then he selects one item in the list.

I don't want to use a converter because the data in the field could
eventually match more than one entry in the database. I can give more
context in the list to make the user be sure of his selection. When the
selection is made, I can put a title so that on a mouse over event the user
visualize the full information on the customer selection.

The best solution would be to use the database id of the customer as a key
during the selection phase.

I don't know what is the best way of implementing this behaviour.

Thanks a lot for any ideas,

Gaetan,


Bookmarkablepagelink with anchor

2012-05-15 Thread Gaetan Zoritchak
Hi all,

I wanted to make a link on a Bookmarkablepage with an anchor. I didn't find
how to do it. The link has a setAnchor(Component) method but it can't be
that because the targeted anchor does not exist yet.

My hope was that the method would take a String as parameter:

myLink.setAnchor(#8765);

What is the best way of doing it under wicket 1.5.x?

Thanks,


Re: Bookmarkablepagelink with anchor

2012-05-15 Thread Gaetan Zoritchak
Thanks for the tip. It was simple... I must be very tired.
Regards,
Gaetan,


2012/5/15 Alexander Cherednichenko lex...@gmail.com

 Hi!

 For this case we have subclassed protected CharSequence getURL() which is
 in BookmarkablePageLink. And - we just append anchor to it while passing it
 in the constructor or even model to the BookmarkablePageLink.

 In the override we call super.getURL() and then append an anchor.

 I see pretty much the same logic in some inner class of AutoLinkResolver --
 so we are on the right way :)

 Regards,
 Alex.


 2012/5/15 Gaetan Zoritchak g.zoritc...@moncoachfinance.com

  Hi all,
 
  I wanted to make a link on a Bookmarkablepage with an anchor. I didn't
 find
  how to do it. The link has a setAnchor(Component) method but it can't be
  that because the targeted anchor does not exist yet.
 
  My hope was that the method would take a String as parameter:
 
  myLink.setAnchor(#8765);
 
  What is the best way of doing it under wicket 1.5.x?
 
  Thanks,
 



 --
 Alexander Cherednichenko

 [ the only way out is the way up ]



Injection in a Resource

2012-02-07 Thread Gaetan Zoritchak
Hi all,

I use guice in my applications. I need to inject some code (service) in a
DynamicImageResource. It is not straightforward because a Resource is not a
component.

Does anybody has already done that? What would be the best way?

Thanks in advance,


Re: Injection in a Resource

2012-02-07 Thread Gaetan Zoritchak
Thanks for that quick answer.


2012/2/7 Carl-Eric Menzel cmen...@wicketbuch.de

 On Tue, 7 Feb 2012 16:08:37 +0100
 Gaetan Zoritchak g.zoritc...@moncoachfinance.com wrote:

  Hi all,
 
  I use guice in my applications. I need to inject some code (service)
  in a DynamicImageResource. It is not straightforward because a
  Resource is not a component.
 
  Does anybody has already done that? What would be the best way?

 You can call the Injector directly in your constructor:

 Injector.get().inject(this);

 The effect is the same as in Components: It will inject all your
 annotated fields.

 Carl-Eric
 www.wicketbuch.de

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




Access Denied with AjaxEditableLabel ant AjaxEditableMultiLineLabel under chrome and safari #wicket1.5

2011-11-29 Thread Gaetan Zoritchak
I had this problem during the migration from wicket 1.4 to wicket 1.5


The problems occurs under chrome, safari and wicket 1.5

Scenario with an AjaxEditableMultiLineLabel :

1. The user puts the focus on the AjaxEditableMultiLineLabel and edit the
field.
2. Without focusing out of the editable label, the user clicks on another
tab of chrome.
= coming back to the first tab, the browser shows an Access Denied Page.

The log shows the warn :
WARN - RequestListenerInterface - behavior not enabled; ignore call.
Behavior
org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel$5@18fa85at
component [ [Component id = editor]]

At that time, Martin proposed me a first workaround :
http://markmail.org/message/uyjns2njjpo22xoj#query:+page:1+mid:laq7whb4urciyz6n+state:results

The problem appeared again because of my migration to wicket 1.5.3.

I tried to further analyze the problem. It seems that the AJAX call is
done 2 times.
When the user switches tabs chrome, the updating of the html triggers
another onblur event and a new ajax call:

Wicket.replaceOuterHtmlSafari = function(element, text) {
// if we are replacing a single script element
if (element.tagName == SCRIPT) {
 // create temporal div and add script as inner HTML
var tempDiv = document.createElement(div);
 tempDiv.innerHTML = text;

// try to get script content
var script = tempDiv.childNodes[0].innerHTML;
 if (typeof(script) != string) {
script = tempDiv.childNodes[0].text;
 }
 element.outerHTML = text;  Trigger another blur event when the user
has already changed of tab.
 try {
eval(script);
} catch (e) {
 Wicket.Log.error(Wicket.replaceOuterHtmlSafari:  + e + : eval -  +
script);
}
 return;
}...

As I'm not a javascript expert, does anybody know how to correct the
problem in javascript instead of using a workaround?

Thanks,
Gaetan,


Re: Apache Wicket is a Flawed Framework

2011-11-22 Thread Gaetan Zoritchak
I didn't have a look one the wicket books for quite while. Good you told
us. I orderered yours yesterday on Amazon. :)

2011/11/18 Igor Vaynberg igor.vaynb...@gmail.com

 * there are three books written about wicket: two for beginners and
 one for intermediate-advanced users.
 * there is a searchable mailing list archive that spans years upon
 years of users asking questions and getting answers.
 * there is a wiki that lists examples and has some good articles.
 * there is stack overflow questions and answers.

 is there an answer to every single possible question out there? of
 course not. no framework has that. look at projects like spring and
 hibernate. do those have great documentation? i bet you would say
 yes. are their mailing lists any less busy than our own? no. so what
 does that say?

 if i had to make up a number i would say that armed with the resources
 i listed you would be able to answer about 80% of your own questions.
 and i think that is a pretty good number. there is a very active user
 list to help you answer questions you cant answer yourself, usually
 faster then a commercial support contract. for free.

 not too shabby.

 -igor

 On Thu, Nov 17, 2011 at 3:30 PM, Gaetan Zoritchak
 g.zoritc...@moncoachfinance.com wrote:
  I must admit that I agree with you. While I think Wicket is a
  great framework, the documentation is not up to par. This tool seems a
  little too elitist. If you're strong enough you will find
  a great framework. It's a shame because even if the mailing list is very
  effective it slows down the adoption of wicket.
 
  2011/11/17 geraldkw geral...@gmail.com
 
  This is not an april fool's day, it is just an opinion of an
 inexperienced
  developer. 
 
  This illustrates one of the traditional logical fallacies. If you can't
  effectively attack the argument, attack the speaker.
 
  My biggest problem with Wicket is that I haven't found any
 documentation on
  the web that really lets me get a solid grasp on the key concepts. I
 read a
  lot of poorly written documentation, weak examples and forum posts
  dealing
  with something that is only vaguely related to my goals, maybe learn a
  fragment of useful info, and then suffer while trying to apply it.
 
  I haven't looked a Wicket in Action or other Wicket Books, but I have
 not
  heard good things. Also, this is the Internet Age and this is web
  programming. I have no problem finding documentation on other web
  programming languages/frameworks like I do with Wicket.
 
  If I am wrong, point me to some solid learning materials, and you stand
 a
  chance of changing my mind.
 
  geraldkw
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-is-a-Flawed-Framework-tp4080411p4081206.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  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




Re: Apache Wicket is a Flawed Framework

2011-11-22 Thread Gaetan Zoritchak
Super cool list, thanks a lot.

2011/11/18 robert.mcguinness robert.mcguinness@gmail.com

 i'm baffled when people say the documentation is poor, the javadocs are
 excellent and like igor said there are some great books (blogs too!).
  books
 and blogs get outdated fast since technlogy is rapidly advancing, so *use
 the source luke!*.  Not only will you learn Wicket, but I guarantee your
 Java skills will improve.


 awesome examples:



 https://github.com/apache/wicket https://github.com/apache/wicket  (scan
 over the unit test, best way to learn any framework not just wicket)

 https://github.com/55minutes/fiftyfive-wicket
 https://github.com/55minutes/fiftyfive-wicket  (fantastic)

 https://github.com/42Lines https://github.com/42Lines

 https://github.com/wicketstuff/core https://github.com/wicketstuff/core (a
 gem, tons of examples on how to pretty much do anything)

 http://code.google.com/p/wiquery/source/checkout
 http://code.google.com/p/wiquery/source/checkout

 https://github.com/jolira/wicket-stateless
 https://github.com/jolira/wicket-stateless  (wicket stateless is
 excellent,
 even easier with wicket 1.5)

 https://github.com/reaktor/oegyscroll
 https://github.com/reaktor/oegyscroll
 (endless pagination)

 http://code.google.com/p/wiquery/source/browse/core
 http://code.google.com/p/wiquery/source/browse/core  (jquery)

 http://code.google.com/p/jqwicket/source/browse/
 http://code.google.com/p/jqwicket/source/browse/  (jquery, learn from the
 code and roll your own if it doesn't fit your needs, super easy

 https://github.com/rjnichols/visural-wicket
 https://github.com/rjnichols/visural-wicket  (great ui tools)

 https://xaloon.googlecode.com/svn/ https://xaloon.googlecode.com/svn/
 (excellent!)



 rob

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-is-a-Flawed-Framework-tp4080411p4082034.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Apache Wicket is a Flawed Framework

2011-11-18 Thread Gaetan Zoritchak
I started with the book wicket in action so it was ok. Before choosing a
technology I look at the number of existing books and I buy the best one.
But I'm not sure that every body does like me.

My main problem is the wiki. The pages are often very old explaining things
that do not apply with the last version of wicket and the wiki si so
slow that I can't imagine working on it to update the pages :(

2011/11/18 robert.mcguinness robert.mcguinness@gmail.com

 i'm baffled when people say the documentation is poor, the javadocs are
 excellent and like igor said there are some great books (blogs too!).
  books
 and blogs get outdated fast since technlogy is rapidly advancing, so *use
 the source luke!*.  Not only will you learn Wicket, but I guarantee your
 Java skills will improve.


 awesome examples:



 https://github.com/apache/wicket https://github.com/apache/wicket  (scan
 over the unit test, best way to learn any framework not just wicket)

 https://github.com/55minutes/fiftyfive-wicket
 https://github.com/55minutes/fiftyfive-wicket  (fantastic)

 https://github.com/42Lines https://github.com/42Lines

 https://github.com/wicketstuff/core https://github.com/wicketstuff/core (a
 gem, tons of examples on how to pretty much do anything)

 http://code.google.com/p/wiquery/source/checkout
 http://code.google.com/p/wiquery/source/checkout

 https://github.com/jolira/wicket-stateless
 https://github.com/jolira/wicket-stateless  (wicket stateless is
 excellent,
 even easier with wicket 1.5)

 https://github.com/reaktor/oegyscroll
 https://github.com/reaktor/oegyscroll
 (endless pagination)

 http://code.google.com/p/wiquery/source/browse/core
 http://code.google.com/p/wiquery/source/browse/core  (jquery)

 http://code.google.com/p/jqwicket/source/browse/
 http://code.google.com/p/jqwicket/source/browse/  (jquery, learn from the
 code and roll your own if it doesn't fit your needs, super easy

 https://github.com/rjnichols/visural-wicket
 https://github.com/rjnichols/visural-wicket  (great ui tools)

 https://xaloon.googlecode.com/svn/ https://xaloon.googlecode.com/svn/
 (excellent!)



 rob

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-is-a-Flawed-Framework-tp4080411p4082034.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Apache Wicket is a Flawed Framework

2011-11-18 Thread Gaetan Zoritchak
 The Play Framework has the right idea:  stateless and restful.
 No clunky components and over-engineered objected-oriented baggage.


Play has some advantages but also shortcomings and presents significant
risks. The transition from version 1 to version 2 will require re-writing
the code. No migration possible! The new version seems to focus
on scala (the views are now coded in scala instead of groovy). The business
code can be in java and scala. What will happen to the java version in 2
years? Play's vision is a fully integrated technology stack with
fairly fixed choices (JPA data access for java, Anorm - single
layer over jdbc - for scala).

This is not the approach of wicket which is much more modular and
simply treat the presentation layer.

In short, there is no silver bullet ... just find the framework that best
meets your needs.


Re: Apache Wicket is a Flawed Framework

2011-11-17 Thread Gaetan Zoritchak
I must admit that I agree with you. While I think Wicket is a
great framework, the documentation is not up to par. This tool seems a
little too elitist. If you're strong enough you will find
a great framework. It's a shame because even if the mailing list is very
effective it slows down the adoption of wicket.

2011/11/17 geraldkw geral...@gmail.com

 This is not an april fool's day, it is just an opinion of an inexperienced
 developer. 

 This illustrates one of the traditional logical fallacies. If you can't
 effectively attack the argument, attack the speaker.

 My biggest problem with Wicket is that I haven't found any documentation on
 the web that really lets me get a solid grasp on the key concepts. I read a
 lot of poorly written documentation, weak examples and forum posts
 dealing
 with something that is only vaguely related to my goals, maybe learn a
 fragment of useful info, and then suffer while trying to apply it.

 I haven't looked a Wicket in Action or other Wicket Books, but I have not
 heard good things. Also, this is the Internet Age and this is web
 programming. I have no problem finding documentation on other web
 programming languages/frameworks like I do with Wicket.

 If I am wrong, point me to some solid learning materials, and you stand a
 chance of changing my mind.

 geraldkw


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-is-a-Flawed-Framework-tp4080411p4081206.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Access Denied with AjaxEditableLabel ant AjaxEditableMultiLineLabel under chrome and safari #wicket1.5

2011-10-20 Thread Gaetan Zoritchak
So is it a bug or a regression (because it was working on W1.4)? Even, if
the event is fired when leaving the tab, I don't understand why the server
reacts differently. How can it knows that the component isn't visible
anymoree???

Should I drop all these widget from my app? We use them a lot in my
backoffice app.

Gaetan,

2011/10/19 Martin Grigorov mgrigo...@apache.org

 Hi,

 The EditableLabel's editor (the text field/area) saves the value on
 'blur' event.
 It is interesting when this event is fired - when the user leaves the
 first tab or when she comes back.

 On Wed, Oct 19, 2011 at 12:48 AM, Gaetan Zoritchak
 g.zoritc...@moncoachfinance.com wrote:
  The problems occurs under chrome, safari and wicket 1.5.
  Scenario with an AjaxEditableLabel :
  1. The user puts the focus on the AjaxEditableLabel and edit the field.
  2. Without focusing out of the editable label, the user clicks on another
  tab of chrome.
  = the value is not put in the model.
 
  Scenario with an AjaxEditableMultiLineLabel :
  1. The user puts the focus on the AjaxEditableMultiLineLabel and edit the
  field.
  2. Without focusing out of the editable label, the user clicks on another
  tab of chrome.
  = coming back to the first tab, the browser shows an Access Denied
 Page.
  The log shows the warn :
  WARN  - RequestListenerInterface   - behavior not enabled; ignore call.
  Behavior
 
 org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel$5@18fa85
  at component [ [Component id = editor]]
  After some debugs it appears that under chrome the call on
  isVisibleInHierarchie() returns false.
 
  These scenario were ok with wicket 1.4
 
  Gaetan,
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 



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

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




Re: Access Denied with AjaxEditableLabel ant AjaxEditableMultiLineLabel under chrome and safari #wicket1.5

2011-10-20 Thread Gaetan Zoritchak
Thank you, It's working but the code is quite ugly (lot of duplication just
to override the canCallListenerInterface() ).

I still doesn't understand how wicket is able to know that the component is
not visible in the browser.

Furthermore, I find problematic the fact that the behavior depends on
the browser implementation.

Gaetan,

2011/10/20 Martin Grigorov mgrigo...@apache.org

 There is an improvement in Wicket 1.5 to not allow execution of
 invisible component or even worse on disabled behavior for security
 reasons.
 It is possible to extend AjaxEditableLabel and configure it to allow
 such executions.

 Override
 org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.newEditor(MarkupContainer,
 String, IModelT)
 and instead of adding

 org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.EditorAjaxBehavior
 you'll have to extend that Behavior and override its
 org.apache.wicket.behavior.Behavior.canCallListenerInterface(Component)

 On Thu, Oct 20, 2011 at 10:44 AM, Gaetan Zoritchak
 g.zoritc...@moncoachfinance.com wrote:
  So is it a bug or a regression (because it was working on W1.4)? Even, if
  the event is fired when leaving the tab, I don't understand why the
 server
  reacts differently. How can it knows that the component isn't visible
  anymoree???
 
  Should I drop all these widget from my app? We use them a lot in my
  backoffice app.
 
  Gaetan,
 
  2011/10/19 Martin Grigorov mgrigo...@apache.org
 
  Hi,
 
  The EditableLabel's editor (the text field/area) saves the value on
  'blur' event.
  It is interesting when this event is fired - when the user leaves the
  first tab or when she comes back.
 
  On Wed, Oct 19, 2011 at 12:48 AM, Gaetan Zoritchak
  g.zoritc...@moncoachfinance.com wrote:
   The problems occurs under chrome, safari and wicket 1.5.
   Scenario with an AjaxEditableLabel :
   1. The user puts the focus on the AjaxEditableLabel and edit the
 field.
   2. Without focusing out of the editable label, the user clicks on
 another
   tab of chrome.
   = the value is not put in the model.
  
   Scenario with an AjaxEditableMultiLineLabel :
   1. The user puts the focus on the AjaxEditableMultiLineLabel and edit
 the
   field.
   2. Without focusing out of the editable label, the user clicks on
 another
   tab of chrome.
   = coming back to the first tab, the browser shows an Access Denied
  Page.
   The log shows the warn :
   WARN  - RequestListenerInterface   - behavior not enabled; ignore
 call.
   Behavior
  
 
 org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabel$5@18fa85
   at component [ [Component id = editor]]
   After some debugs it appears that under chrome the call on
   isVisibleInHierarchie() returns false.
  
   These scenario were ok with wicket 1.4
  
   Gaetan,
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 



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

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




Re: Removing jsessionid in wicket 1.5

2011-10-11 Thread Gaetan Zoritchak
Thanks it's working. That is simpler than what I thought but I didn't fully
understand the new request engine.

I updated the wiki.

By the way, the redirection is another important point for SEO optimization
with wicket 1.5. Wicket should never perform a redirect when a robot ask for
a page as it can't follow the redirect.

I resolved it using a SEORequestMapper that delegates to the systemMapper
for all request except is the user-agent is a bot. In that case I block the
redirect.

Do you think, it's the good solution?

public class SEORequestMapper implements IRequestMapper {

private final IRequestMapper delegate;

public SEORequestMapper(IRequestMapper delegate) {
this.delegate = delegate;
}

public IRequestHandler mapRequest(Request request) {
IRequestHandler requestHandler = delegate.mapRequest(request);
BotUtil botUtil = new BotUtil();
if(botUtil.isBotAgent()  requestHandler instanceof
IPageRequestHandler) {
IPageClassRequestHandler handler = (IPageRequestHandler)
requestHandler;
return renderPageWithoutRedirect(handler.getPageClass(),
handler.getPageParameters());
}
return requestHandler;
}

private IRequestHandler renderPageWithoutRedirect(Class? extends
IRequestablePage pageClass, PageParameters pageParameters) {
PageProvider pageProvider = new PageProvider(pageClass,
pageParameters);
pageProvider.setPageSource(Application.get().getMapperContext());
return new RenderPageRequestHandler(pageProvider,
RenderPageRequestHandler.RedirectPolicy.NEVER_REDIRECT);
}

... delegation of other methods.

2011/10/11 Martin Grigorov mgrigo...@apache.org

 protected WebResponse newWebResponse(final WebRequest
 webRequest, final HttpServletResponse httpServletResponse){
 return
 new ServletWebResponse((ServletWebRequest)webRequest,
 httpServletResponse) {

   @Override
   public String encodeURL(CharSequence url)
   {
   final String agent = webRequest.getHeader(User-Agent);
   return isAgent(agent) ? url : super.encodeURL(url);
   }
   };}

 Please update the wiki page if that works.
 Thanks!
 On Mon, Oct 10, 2011 at 11:34 PM, Gaetan Zoritchak
 g.zoritc...@moncoachfinance.com wrote:
  Hi,
 
  Removing the jsessionid for scrawling robots is important to avoid the
  duplicate content problem.
 
  The solution proposed in the wiki
  https://cwiki.apache.org/WICKET/seo-search-engine-optimization.html is
 not
  working anymore. Does anyone knows the new way of doing it in wicket 1.5?
 
  Thanks in advance,
 
  Gaetan,
 



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

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




Removing jsessionid in wicket 1.5

2011-10-10 Thread Gaetan Zoritchak
Hi,

Removing the jsessionid for scrawling robots is important to avoid the
duplicate content problem.

The solution proposed in the wiki
https://cwiki.apache.org/WICKET/seo-search-engine-optimization.html is not
working anymore. Does anyone knows the new way of doing it in wicket 1.5?

Thanks in advance,

Gaetan,


Re: Community tools

2011-10-08 Thread Gaetan Zoritchak
2011/10/7 Clint Checketts checke...@gmail.com

 So what is the best way (official? permanent?) to link to a previous
 response?

 In 6 months when someone has a similar question, what is the official way
 to
 link to previous answers? Equally, what is the best way to improve those
 answers if the answer 6 months back worked at that time, but now is invalid
 and a 'bad practice' due to wicket improvements?

 That is part of the problem. On the wiki, the pages are not tagged
WICKET-1.4 or WICKET-1.5 so you don't know if you can use them.

Is's the same with mail.

The avantage with a QA tool is that you tag, rename and edit the question
and the answers. At the end you have a good question with the best answer
and no duplicates. When you search something you just have to look at the
tags to know if you can use the answer.


 Folks so rarely use the mailing list archives (
 http://wicket.apache.org/help/email.html), (not easily searched!) I doubt
 that is the solution.

 -Clint

 On Fri, Oct 7, 2011 at 7:32 AM, manuelbarzi manuelba...@gmail.com wrote:

  it sounds great, but why not fully concentrate on wicket. apache will
  adopt whatever magic-solution asa it'll be licence compliant, and
  affordable by resources and directives.
 
  for the moment this mailing list has been a very successful machine,
  and still has much to bring. outside, whatever wrapper (wicket-based
  or not, may be assembled to pull all posts, order and make them as far
  confortable-searcheable as low-patience eager-brains demand).
 
  as other expressed: markmail and nabble are pretty enough, and
  managing issues by mail - on smart or not phones - is simply a
  pleasure.
  .
 



Re: Community tools

2011-10-07 Thread Gaetan Zoritchak
I fully understand the risk of relying on an external and uncontrolled
party. The best of breed solution would be to have SO like a Q  A
for wicket based on an  open source implementation like Bert mentionned.

For the mailing list, I think the advantage of reading the messages on his
phone is less important than the gate of a partially closed system that
requires a subscription by email. See on
http://softwareandsilicon.com/chapter:2 # toc2  - Freedom of Access and
- Weak Group Identity

Markmail:
The traffic is constantly increasing from 1999 until late 2009 early
2010 before being reduced significantly. I think the reason is due to the
tool a little bit old. Even if the interface allows to search for messages,
ergonomics and the quality of responses is not equivalent to what is
available on intenet today.

My point is not to criticize but to point out that this is negative for the
adoption of wicket. Today when I choose a technology for a project, even
though I prefer Wicket for its design, I have  to sell the framework to a
team that does not necessarily find it very sexy.

Gaetan


2011/10/7 Martijn Dashorst martijn.dasho...@gmail.com

 The biggest issue with moving to Stack Overflow is that we deliver our
 community to an external party which can do anything with the
 questions, show stupid ads, etc. Have no mistake: stack exchange is a
 commercial venture. So one criterium is to be able to pull the plug on
 it whenever it goes sour. While the content of stack overflow is
 publicly available, it is not licensed with an Apache friendly license
 (http://creativecommons.org/licenses/by-sa/2.5/). This issue was the
 biggest hurdle SO needs to take to become a viable alternative for the
 user list at Apache.

 As for this list not being visible, you can always shop around for
 list archive providers. Nabble has a nice forum like interface, Mark
 mail provides awesome search tooling.

 Martijn

 On Fri, Oct 7, 2011 at 8:49 AM, Bert taser...@gmail.com wrote:
  I had a discussion about this with martin dashorst when we meet this
  year at a conference. Apparently, he does like the idea of a SO like
  QA site for wicket. But wicket being an Apache project, there are
  certain requirement if i recall our discussion correctly.
 
  One of the problems is the hosting of such a side. The mailing list,
  bugtracker, wicki,... are all hosted and maintained by the apache
  admins. Getting a new tool into there is not easy. One could host a
  solution outside of apache, but this opens questions about long term
  support of the infrastructure, privacy issues and so forth.
 
  There are a few opensource implementations available:
 
  http://gitorious.org/shapado (used by debian at http://ask.debian.net/)
  http://www.osqa.net/
 
  I do like the SO style (never been a fan of mailing lists), but on the
  other side registering here is not much of a hassle.
 
  My 2 cent
  Bert
 
  On Fri, Oct 7, 2011 at 07:25, Josh Kamau joshnet2...@gmail.com wrote:
  I like the mail. Atleast i can get the answers even on my not so smart
  phone.
 
  Josh.
 
  On Fri, Oct 7, 2011 at 6:43 AM, Chris Colman
  chr...@stepaheadsoftware.comwrote:
 
  Source management and bugs are also outdated. The version on github is
  much
  better.
 
  I recently had to get up to speed with github. Not sure what all the
  fuss is about. The learning curve was about 20x that of Subversion and
  I'm still not confident about how to do things or whether what I'm
 doing
  is the 'right' thing to be doing. Subversion on the other hand is
 really
  easy to understand (and most developers already know it) and even
 though
  it has 'theoretical' shortcomings compared to a distributed VCS like
 git
  in practice I never saw any difference in performance or usage apart
  from git being a lot 'weirder' ;)
 
  
  My 2 cents,
  
  Gaetan
 
  -
  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
 
 



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

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




Community tools

2011-10-06 Thread Gaetan Zoritchak
First of all, I love wicket. I think it's a very effective framework,
with an active community.

But ...

I regret that some tools reduce its visibility. I think, in particular, the
mode of exchange based on a mailing list is quite outdated. This mailing
list which requires subscription limits the number
of participants. Moreover, research on old messages are poorly referenced. I
have recently experienced it one more time  during the migration of my
project on Wicket 1.5. The solution to my problem has already been discussed
and resolved but it took me a long time to find it. Why not drop this
mailing list and discuss all questions
onStackOverflow. The business community would be more visible.

Source management and bugs are also outdated. The version on github is much
better.

My 2 cents,

Gaetan


Re: Community tools

2011-10-06 Thread Gaetan Zoritchak

 Heh.  You just said we have a very active community.

 While I do like Stack Overflow for many things, it's not a true way of
 building a community.  It's a way of asking questions.  (Yes, this is just
 my opinion - not meaning to start a flamewar).  We have a vibrant community
 here - I don't think the mailing list is limiting the community.


I think but it's just an opinion, that the need of subscribe to a mailing
list is a little barrier. Some people won't do the effort which means less
interactions.


 Plus, mailing lists are still THE way to communicate in open source.
  Especially is this true with Apache projects.


  Moreover, research on old messages are poorly referenced. I
  have recently experienced it one more time  during the migration of my
  project on Wicket 1.5. The solution to my problem has already been
  discussed
  and resolved but it took me a long time to find it. Why not drop this
  mailing list and discuss all questions
  onStackOverflow. The business community would be more visible.
 

 How can we quantify such a statement?  If you can provide some kind of
 proof
 that it's easier to find an answer by searching SO rather than mailing list
 archives, we could look into alternatives.  But such a statement just isn't
 easily (if at all) quantifiable.


Difficult to quantify but the nable mailing list is flat. There no way for
google to know which question is more important. For the reader it's not
very obvious neither. In a system like StackOverflow, the votes on
questions, on answers, the use of comments rather than answer allow the
filtering of the noise. I think the links beetween questions take the votes
in count and as a result google
shows you rapidly the best question/answer. Moreover when you are reading a
question, you see the other questions in relation.
I don't exactly how SO works but I find it very very efficient for me (not
for wicket questions ;) )

 Source management and bugs are also outdated. The version on github is
 much
  better.
 

 Github is awesome.  I don't care about the issue management on it.  JIRA
 has
 a ton more features and support.  It works for us.  I think that we would
 like to move to git at some point - but it's not (yet) supported for all
 projects at the ASF.  There is a public beta running of git for one project
 at the ASF right now.  If it succeeds, I think we'll be one of the first
 projects to switch as soon as they make it available to all projects.


Good news.



 Thanks!  Hope to see you around this antiquated mailing list :)


:)

Of course!!!


Re: updating page version after an ajax request

2010-09-17 Thread Gaetan Zoritchak
I'm waiting for a long time for the resolution of this bug wich is very
important in regards on the use of Ajax nowadays. Unfortunately, the
resolution has always been delayed and I don't know enough Wicket to try to
resolve it. :(

2010/9/17 Josh Kamau joshnet2...@gmail.com

 hello, Is there a way of updating the page version after an ajax request in
 order to support the back button for a 100% component based application
 (i.e
 an application based on a single page)?

 i think my question is related to this
 https://issues.apache.org/jira/browse/WICKET-271.

 Has any of the 1.5 milestones implemented this?

 kind regards.
 Josh



Wicket Pattern to reduce session size

2010-01-28 Thread Gaetan Zoritchak
Hi all,

I was debugging my sessions size in order to reduce it and I saw that one of
my page spend 20ko because of an dynamic image generated with JFreeChart.
JFreeChart was serialized with my DynamicImageRessource.

My first optimisation is to make JFreeChart a static field initialized in a
static bloc.

Is it an valid way of handling that problem?

Gaetan Zoritchak,


Re: Wicket Pattern to reduce session size

2010-01-28 Thread Gaetan Zoritchak
In fact, I just put the reference to JFreeChart as static. All the commons
values are initialized in the static bloc (ie, Font, definition on the axis,
...).

I keep the image generation done in the getImageData using the
pageParameters. So every session or even page request can have its own
version on the graph.

2010/1/28 Pedro Santos pedros...@gmail.com

 Then this image will to be the same for all sessions. If you don't want
 that
 object on your session, make sure at getImageData method implementation
 that
 you are always creating your chart object, and  not keeping it in any
 instance variable.


 On Thu, Jan 28, 2010 at 8:28 AM, Gaetan Zoritchak 
 g.zoritc...@virtual-soft.com wrote:

  Hi all,
 
  I was debugging my sessions size in order to reduce it and I saw that one
  of
  my page spend 20ko because of an dynamic image generated with JFreeChart.
  JFreeChart was serialized with my DynamicImageRessource.
 
  My first optimisation is to make JFreeChart a static field initialized in
 a
  static bloc.
 
  Is it an valid way of handling that problem?
 
  Gaetan Zoritchak,
 



 --
 Pedro Henrique Oliveira dos Santos