Re: Best Practice - Create component by entity type?

2015-07-04 Thread Per Newgro
This sounds good. I already have a registry where i can register services in a 
decoupled way. With spring and @PostConstruct no Problem :-). I would ASK then 
every factory if it is responsible for my entity type. But i still see a 
problem here. How to prioritize factory if i have more than one factory for a 
Person type. For instance if a boss is a manager. Then i can't use instanceof 
in the manager factory because boss entity would match twice.

Am 03.07.2015 3:14 nachm. schrieb Rob Audenaerde rob.audenae...@gmail.com:

 Hi Per, 

 You can do something like this: 

 Create a set of compontents that will be your panels to display specific 
 Persons. 

 Let's call them PersonPanels. 

 You can introduce a PersonPanelFactory, which might give you the 
 appropriate PersonPanel based on the class of the Person ( 
 person.getClass() ) . This is however not yet nicely extensible, but you 
 decoupled the logic for creating panels from your list-code. 

 Next step: you need to register the classes somehow so you can provide 
 panels for in the factory, so the factory can for example use a map to 
 provide the proper PersonPanel. You can use reflection to call the 
 constructors, which will need to have the same arguments for their 
 constructors. This is the biggest disadvantage I think in this approach. 

 Somewhat like this: 

 class PersonPanelFactory 
 { 
    public PersonPanel getPanelFor( ClassT extends personClass) ... 
   public registerPanelFor ( ClassT extends Person personClass, ClassT 
 extends PersonPanel personPanelClass ... 
 } 



 On Fri, Jul 3, 2015 at 2:32 PM, Per Newgro per.new...@gmx.ch wrote: 

  Hi, 
  
  i think about that problem for some time now. Maybe someone alrady has a 
  good solution. 
  
  Let's assume we have a Manager entity and a Tainee entity. Both are Person 
  entities. 
  In Model we ask for all persons. So we get a mix from Managers and 
  Trainees in a list. 
  
  Both concrete entity types shall be displayed in their own component (a 
  custom panel for every1). 
  
  I would ask for simple, decoupled (extendible) solution of this problem. 
  So far i've tried the obvious instance of approach. But this is not 
  extendible. 
  Maybe someone can send me some ideas. 
  
  Thanks for your support 
  Per 
  
  - 
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org 
  For additional commands, e-mail: users-h...@wicket.apache.org 
  
  


Re: cryptomapper uses the same wicket-crypt params for each user

2015-07-04 Thread Martin Grigorov
Hi,

Yes. This is the correct way.
It is the default in 6.19.0
On Jul 4, 2015 2:51 AM, Steve Swinsburg steve.swinsb...@gmail.com wrote:

 OK solved:

 getSecuritySettings().setCryptFactory(new
 KeyInSessionSunJceCryptFactory()); //diff key per user
 final IRequestMapper cryptoMapper = new
 CryptoMapper(getRootRequestMapper(), this);
 setRootRequestMapper(cryptoMapper);

 On Fri, Jul 3, 2015 at 9:58 PM, Steve Swinsburg steve.swinsb...@gmail.com
 
 wrote:

  Hi all,
 
  I am using the cryptomapper to encrypt some URLs and am finding that
 every
  logged in user is getting the same encrypted URL for the same pages.
  ie to go to x page is http://url?wicket-crypt=Uqcgp... for both user A
  and user B.
 
  Is there any way to make this unique for each user?
 
  In my Application class I have:
 
  IRequestMapper cryptoMapper = new CryptoMapper(getRootRequestMapper(),
  this);
  setRootRequestMapper(cryptoMapper);
 
  Wicket 6.18.0
 
  Thanks,
  Steve
 



Re: cryptomapper uses the same wicket-crypt params for each user

2015-07-04 Thread Steve Swinsburg
Thanks for the confirmation, Martin.
Regards.

On Sat, Jul 4, 2015 at 4:32 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 Hi,

 Yes. This is the correct way.
 It is the default in 6.19.0
 On Jul 4, 2015 2:51 AM, Steve Swinsburg steve.swinsb...@gmail.com
 wrote:

  OK solved:
 
  getSecuritySettings().setCryptFactory(new
  KeyInSessionSunJceCryptFactory()); //diff key per user
  final IRequestMapper cryptoMapper = new
  CryptoMapper(getRootRequestMapper(), this);
  setRootRequestMapper(cryptoMapper);
 
  On Fri, Jul 3, 2015 at 9:58 PM, Steve Swinsburg 
 steve.swinsb...@gmail.com
  
  wrote:
 
   Hi all,
  
   I am using the cryptomapper to encrypt some URLs and am finding that
  every
   logged in user is getting the same encrypted URL for the same pages.
   ie to go to x page is http://url?wicket-crypt=Uqcgp... for both user A
   and user B.
  
   Is there any way to make this unique for each user?
  
   In my Application class I have:
  
   IRequestMapper cryptoMapper = new CryptoMapper(getRootRequestMapper(),
   this);
   setRootRequestMapper(cryptoMapper);
  
   Wicket 6.18.0
  
   Thanks,
   Steve
  
 



Re: Wicket7: MediaComponent and Source classes

2015-07-04 Thread Maxim Solodovnik
Hello Tobias,

Everything seems to work as expected!
sorry for the late response, your emails are still going into Spam :(((

On Fri, Jul 3, 2015 at 6:34 PM, Tobias Soloschenko 
tobiassolosche...@googlemail.com wrote:

 @Maxim: Is there anything left to be done within the media components?
 Otherwise I am going to vote +1

 kind regards

 Tobias

  Am 03.07.2015 um 07:43 schrieb Maxim Solodovnik solomax...@gmail.com:
 
  OK, will try
  Thanks
 
  On Fri, Jul 3, 2015 at 11:38 AM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
  HI Maxim,
 
  This will lead to a big API break.
  If we change this signature then we will have to change many more to
 keep
  it consistent, and this will lead to a lot of work for the application
  developers to change AjaxRequestTarget with IPartialPageRequestHandler.
 
  We may need to make this change for Wicket 8.x if there are many users
  wanting this change, but for now I'd suggest you to create an adapter.
 
  Martin Grigorov
  Freelancer. Available for hire!
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
  On Fri, Jul 3, 2015 at 7:46 AM, Maxim Solodovnik solomax...@gmail.com
  wrote:
 
  Hello Martin,
 
  I guess following method need to be additionally updated:
 
  org.apache.wicket.ajax.AbstractAjaxTimerBehavior.onTimer
 
  On Thu, Jul 2, 2015 at 6:11 PM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
  The change is rather big:
 
 https://github.com/sebfz1/wicket-jquery-ui/commit/e94f89d8f07f2b1af2b327a4aaec5ddd4b1400af
  I guess many other methods will need to be changed too if one needs to
  use
  them with WebSocket.
  The improvement in the Wicket API looked so innocent ...
 
  Martin Grigorov
  Freelancer. Available for hire!
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
  On Thu, Jul 2, 2015 at 2:28 PM, Maxim Solodovnik 
 solomax...@gmail.com
 
  wrote:
 
  Done: https://github.com/sebfz1/wicket-jquery-ui/issues/177
  Sorry, forgot about Sebastians vacation :(
 
  On Thu, Jul 2, 2015 at 5:23 PM, Martin Grigorov 
  mgrigo...@apache.org
  wrote:
 
  @Maxim: Please create an issue at Wicket jQuery UI github.
  Sebastien is on vacation. I can do it but first I need a good
  reason
  for
  the change :-)
 
  Martin Grigorov
  Freelancer. Available for hire!
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
  On Thu, Jul 2, 2015 at 12:33 PM, Maxim Solodovnik 
  solomax...@gmail.com
  wrote:
 
  @Sebastian could you please modify AbstractDialog.open method to
  be
 
  public final void open(IPartialPageRequestHandler target)
  instead of
  public final void open(AjaxRequestTarget target)
 
  Thanks in advance!
 
 
  On Thu, Jul 2, 2015 at 2:58 PM, Martin Grigorov 
  mgrigo...@apache.org
  wrote:
 
  Yes, another minor cleanup: there is now
 
 https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPartialPageRequestHandler.java
  A base interface for Ajax and WebSocket.
 
  Martin Grigorov
  Freelancer. Available for hire!
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
  On Thu, Jul 2, 2015 at 11:45 AM, Maxim Solodovnik 
  solomax...@gmail.com
  wrote:
 
  Additionally it looks like WebSocketRequestHandler can not be
  used
  as AjaxRequestTarget any longer
  Previously it was possible to use WebSocketRequestHandler to
  push
  updated
  component .
 
  On Thu, Jul 2, 2015 at 2:42 PM, Maxim Solodovnik 
  solomax...@gmail.com
 
  wrote:
 
  Thanks a lot Tobias!
 
  On Thu, Jul 2, 2015 at 1:03 PM, Tobias Soloschenko 
  tobiassolosche...@googlemail.com wrote:
 
  Hi Maxim,
 
  no problem I am going to add the getter this evening.
  Thank
  you
  for
  your
  suggestions! :-)
 
  Maybe the SNAPSHOT isn't refreshed because of the downtime
  of
  the
  buildbot server. However the build was triggered already.
 
  kind regards
 
  Tobias
 
  Am 02.07.2015 um 08:45 schrieb Maxim Solodovnik 
  solomax...@gmail.com
  :
 
  Thanks a lot for the changes Tobias,
  Unfortunately I'm unable to test it due to latest
  7.0.0-SNAPSHOT
  seems
  doesn't contain it :(
 
  And one more question: I would like to be able to modify
  PageParameters
  passed to source, maybe it would be possible to add
  public
  getter
  for
  it?
 
  Thanks in advance
 
  On Mon, Jun 29, 2015 at 9:41 PM, Tobias Soloschenko 
  tobiassolosche...@googlemail.com wrote:
 
  Hi Maxim,
 
  hope the change is like you wanted it to be:
 
 https://github.com/apache/wicket/commit/e20bfa738aa64f35b668f05866e0c0b7ca71c1f4
 
  But again: The PackageResourceReference is best
  practice,
  because
  you
  also
  can use readBuffered(false) of it - with this option
  the
  resource
  is
  streamed directly without loading it into memory. For
  more
  information
  refer to the Javadoc of the method.
 
  kind regards
 
  Tobias
 
  Am 29.06.15 um 10:22 schrieb Maxim Solodovnik:
 
  Thanks a lot!
  It was gmail SPAM filter :(((
  will do migration and examine examples
 
  On Mon, Jun