Re: alternative solution for addOrReplace()?

2014-10-08 Thread Patrick Davids
Hi Andrea,
this is the code (a bit pseudo-like...) I am quite sure it is not the 
way it should be and full of wicket anti-patterns. But still exists 
since my first wicket experiences 2 years ago. ;-)


This panel gets rendered via RefreshingView about 30 times.

public ElementPanel(String id, IModel? extends ElementState 
elementState){  
super(id, elementState);

container = new WebMarkupContainer(innerElementContainer, 
elementState){
private static final long serialVersionUID = 1L;

@Override
protected void onConfigure() {
super.onConfigure();

ElementState s = (ElementState)getDefaultModelObject();

if(s instanceof DefaultState){

container.addOrReplace(new 
DefaultStatePanel(REPLACE_CONTAINER_ID, s));

}else if(s instanceof SpecialState){

container.addOrReplace(new 
SpecialStatePanel(REPLACE_CONTAINER_ID, s));

}else if(s instanceof AnotherSpecialState){

container.addOrReplace(new 
AnotherSpecialStatePanel(REPLACE_CONTAINER_ID, s));

...

}else{
String error = No panel registered for class 
+getDefaultModelObject().getClass().getSimpleName();
container.addOrReplace(new 
Label(REPLACE_CONTAINER_ID, error));
error(error);
}
}
add(container);
}

Patrick


Am 07.10.2014 19:42, schrieb Andrea Del Bene:
 Hi,

 could you post the code you use inside onConfigure to addOrReplace inner
 container? Maybe you could avoid detaching/attaching overriding method
 detachModels in your inner containers.
 Hi Paul,
 thanx for replying.

 Oh, I use Ajax very heavily in this case. Thats why I said: the panel
 works quite good for ajax rendering and refreshing use-cases

 Hmm... ok... I think I missed some details. I try to explain.

 My page contains two sections seperated from each other.
 A kind of data-entry and a kind of displaying the results.

 The section which displays the results is a quite complicated panel,
 having an RefreshingView for about 30 (I will name them) sub-panels.

 These sub-panels addOrReplace() an inner container while rendering
 itself.
 And the replacement depends on my model object type.

 So, my sub-panel class has a hugh knowledge about how to render the
 results.

 On entering some data on the data-entry section I refresh the whole
 panel in the display section with all its sub-panels using Ajax. And
 this works great.
 Some of the sub-panels also rerender/refresh own there own, by listening
 to events etc pepe. All this behaviours are working very well.

 The only disadvantage is, using addOrReplace(), I have a heavy
 detaching/attaching situation and a performance problem.

 So, the best solution for now would be, keeping my panel implementation
 as it is, but just having my models detached only once, not for
 iteration.

 And here I dont have any idea how to solve that... :-/

 thanx and kind regards
 Patrick




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



Re: alternative solution for addOrReplace()?

2014-10-08 Thread Patrick Davids
  I think you might have over-complicated your design.
Yes, I also think so, but unfortunately currently I'm not able to 
redesign it, and I try to find a quick solution. :-/
(please have a look at my reply to andreas mail. There is some code...)

  should be simple to update the parent which in turn delegates that 
responsibility to the children.
It is -somehow- the way you described. I think... hmm... but not very 
good implemented it seems.

  Take a quick look over how Decebal implemented his Wicket-Dashboards
Ok, thanx, I will do...

  Otherwise I suggest you get rid of the addOrReplace() and move that logic
  into your onBeforeRender() methods for those panels to update themself.

Are markup modifications handled different by onBeforeRender() / add() 
compared to onConfigure() / addOrReplace()?

Or do I also have to use addOrReplace() in onBeforeRender()?

Patrick

Am 07.10.2014 21:47, schrieb Paul Bors:
 I think you might have over-complicated your design.
 Your use-case is quite simple, you have user input that filters the
 display. It might be that there are a lot of panels to be updated but then
 again it should be simple to update the parent which in turn delegates that
 responsibility to the children.

 Take a quick look over how Decebal implemented his Wicket-Dashboards as in
 his project the entire dashboard is refreshed when adding a new panel which
 in turn can be quite complicated.

 His code and examples are at:
 https://github.com/decebals/wicket-dashboard

 Study his design and see how much of that you can apply to your page.

 Otherwise I suggest you get rid of the addOrReplace() and move that logic
 into your onBeforeRender() methods for those panels to update themself.

 On Tue, Oct 7, 2014 at 12:43 PM, Patrick Davids 
 patrick.dav...@nubologic.com wrote:

 Hi Paul,
 thanx for replying.

 Oh, I use Ajax very heavily in this case. Thats why I said: the panel
 works quite good for ajax rendering and refreshing use-cases

 Hmm... ok... I think I missed some details. I try to explain.

 My page contains two sections seperated from each other.
 A kind of data-entry and a kind of displaying the results.

 The section which displays the results is a quite complicated panel,
 having an RefreshingView for about 30 (I will name them) sub-panels.

 These sub-panels addOrReplace() an inner container while rendering itself.
 And the replacement depends on my model object type.

 So, my sub-panel class has a hugh knowledge about how to render the
 results.

 On entering some data on the data-entry section I refresh the whole
 panel in the display section with all its sub-panels using Ajax. And
 this works great.
 Some of the sub-panels also rerender/refresh own there own, by listening
 to events etc pepe. All this behaviours are working very well.

 The only disadvantage is, using addOrReplace(), I have a heavy
 detaching/attaching situation and a performance problem.

 So, the best solution for now would be, keeping my panel implementation
 as it is, but just having my models detached only once, not for iteration.

 And here I dont have any idea how to solve that... :-/

 thanx and kind regards
 Patrick

 Am 07.10.2014 17:52, schrieb Paul Bors:
 Why not use Ajax?

 addOrReplace() is really for when you need the full request cycle and
 have
 the page rendered on the server side. With Ajax you get your target for
 which you can add all the components you want to refresh on the page.

 Given the day and age we live in, I don't think there is a need to even
 worry about browsers that do not support Ajax. Than again, that depends
 on
 your product's requirements.

 Otherwise, you can keep on using addOrReplace() but stop using instaceof
 and start using Generics.
 If you need an example code-snippet of that let me know and I'll dig some
 out for you.

 On Tue, Oct 7, 2014 at 9:51 AM, Patrick Davids 
 patrick.dav...@nubologic.com
 wrote:

 Hi all,
 I have a panel, which renders a inner markupcontainer (different panels
 for different ways of displaying my model object) depending on its model
 objects type.

 I do this by addOrReplace() the inner panel in an onConfigure() having
 an if instanceof; and it also iterates over a list...

 I'm not sure, if it is a good solution (I dont like the instanceof
 approach), but the panel works quite good for ajax rendering and
 refreshing use-cases.

 But, the addOrReplace() has one big disadvantage.
 It forces to detach the model on each iteration, so on each iteration I
 get a database access to retrieve it again.

 Is there anyway to keep the model attached until the entire request
 cycle is finished?


 Or should I try to find complete other solution for this kind of high
 dynamic iterating panel?
 Is it better to use e.g. Fragments to display a model object in
 different ways depending on its state?

 Please give some inspirations... I ran out of ideas. Help!

 kind regards :-)
 Patrick
 -
 

Re: unable to find property UploadProgressBar.starting

2014-10-08 Thread Garret Wilson
I just wanted to report back and say that, after our installer team 
updated the distribution to maintain the individual JARs (and thus not 
overwrite the files with clashing filenames), that solved the problem! 
Thanks to Martin Grigorov and Andrew Geery for helping point me in the 
direction of the problem.


Garret

On 10/1/2014 1:04 PM, Garret Wilson wrote:
I think I've found the source of the problem (even though I don't 
understand the internal details). Our installer creates an uber-JAR 
that has all the dependencies exploded and then placed inside a single 
JAR file. I looked inside wicket-extensions-7.0.0-M3.jar, and it has a 
file wicket.properties /in the root of the JAR file!/ Unfortunately, 
wicket-core-7.0.0-M3.jar (and likely other Wicket JARs) also have a 
wicket.properties file in their root as well. As you might guess, 
these have conflicting values:


initializer=org.apache.wicket.extensions.Initializer

initializer=org.apache.wicket.Initializer

So when we create our uber-JAR only one of these wicket.properties 
files wins and gets placed in the uber-JAR. The one we happen to have 
now contains initializer=org.apache.wicket.Initializer.


I will check with the installer team to see if we can distribute the 
application with all its dependencies as separate JARs rather than an 
uber-JAR. But on Wicket's side, is it really a good practice to stick 
some file in the root directory of a JAR, outside of any package, with 
a name you expect to be identical across JARs but with different 
contents? I naively would imagine that some better approach exists.


Garret

On 10/1/2014 1:22 PM, Martin Grigorov wrote:

The .properties file is packed inside wicket-extensions.jar, not in his
application.

I have no other ideas but to attach a remote debugger
to 
org.apache.wicket.resource.loader.InitializerStringResourceLoader#loadStringResource(java.lang.Class?,
java.lang.String, java.util.Locale, java.lang.String, 
java.lang.String) and

set condition on the key parameter to be equal to the missing resource
key.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Oct 1, 2014 at 5:55 PM, Andrew Geery andrew.ge...@gmail.com 
wrote:



As a sanity check, is the property file with the property
UploadProgressBar.starting
in the jar file?  Perhaps it didn't get copied over by the Maven build
process into the jar but the IDE was properly copying it over...

Andrew

On Wed, Oct 1, 2014 at 11:38 AM, Garret Wilson 
gar...@globalmentor.com

wrote:


On 10/1/2014 12:33 PM, Martin Grigorov wrote:


Hi,

Do you by chance manipulate the list of IStringResourceLoader's in
DEPLOYMENT mode ?


I don't think I touched anything related to IStringResourceLoader. The
only thing I've done relating to modes is this:

   //turn on Wicket development mode if in debug mode
   final String wicketConfiguration = Debug.isDebug() ? 
development

:

deployment;
   filterHolder.setInitParameter(configuration,

wicketConfiguration);
In other words, in embedded Jetty, if we've started up specifying a 
debug

mode (using a system variable), then I set the Wicket configuration to
development; otherwise, I set it to deployment.


Garret

-
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: Demonstrate End-to-End Security Enforcement using Open Source Software Wicket

2014-10-08 Thread Shawn McKinney

On 08/20/2014 10:08 AM, Shawn McKinney wrote:
 Notably missing from the material is theory or why these types of 
complex security mechanisms are necessary.  I'm working on that now and 
will publish it back here when ready.


Hello again, just now getting back to this thread

***

The fortressdemo2 web app tutorial shows an apache wicket web app 
deployed inside of a tomcat container using both an ldap and db server. 
 It recommends various security layers for end-to-end security which is 
a 'defense in depth' approach.


The fortressdemo2 source code is here:

https://github.com/shawnmckinney/fortressdemo2

The fortress demo2 tutorial page has been moved to a new location:
https://symas.com/kb/demonstrate-end-to-end-security-enforcement-using-open-source/

and on this page are more links to:

a. static html javadoc (hosted on same server) containing instructions 
for actual fortressdemo2 tutorial installation.  The overview page of 
the javadoc describes how to download the example source code and how to 
generate documentation locally.


b. link to presentation given last week at JavaOne

The J1 deck contains two parts:
1. Overview of the security controls used within the fortressdemo2 web app.

2. Description of how to drop the fortressdemo2 (and its associated 
infrastructure) into a cloud foundry PaaS (presented by John Field)


Finally there is an abbreviated version of the slides containing the 
rationale for each layer by comparing to everyday situations:

https://symas.com/javadocs/fortressdemo2/doc-files/AnatomyOfSecureWebApp.pdf

We are donating this material to help others learn the proper way to 
security inside of web app envs.  So there will be less violations and 
breaches of our personal and business data - events that are seemingly 
commonplace today.


Suggestions or comments are welcome.

Thanks for your attention,

Shawn

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



Re: Could not clear select2Choice component model value.

2014-10-08 Thread MadasamySankarapandian
Thankyou very much for yours reply.

I call formComponent.clearInput() in my ClearFormVisitor class. But It does
not work.
I have created issue-96
https://github.com/ivaynberg/wicket-select2/issues/96 in wicket-select2
project.






On Wed, Oct 8, 2014 at 12:13 AM, Maxim Solodovnik solomax...@gmail.com
wrote:

 Done, thanks for pointing this out

 On 7 October 2014 23:08, Paul Bors p...@bors.ws wrote:

  Can you update this issue then?
 
  https://github.com/ivaynberg/wicket-select2/issues/93
 
  On Tue, Oct 7, 2014 at 12:00 PM, Maxim Solodovnik solomax...@gmail.com
  wrote:
 
   we recently moved this component to wicketstuff:
  
  
 
 https://github.com/wicketstuff/core/tree/master/jdk-1.7-parent/select2-parent
  
   to get Wicket7 compatible version
  
  
   On 7 October 2014 22:56, Paul Bors p...@bors.ws wrote:
  
You can also ask the developer via:
https://github.com/ivaynberg/wicket-select2/issues
   
You should probably take a look over the open issues so that you are
familiar with that other developers faced. Maybe one of those issues
   might
be a road block for you?
   
Although you will get a faster reply from Igor or another Wicket
   developer
via this list :)
   
On Tue, Oct 7, 2014 at 4:23 AM, Martin Grigorov 
 mgrigo...@apache.org
wrote:
   
 Hi,

 You should call formComponent.clearInput() too.

 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Tue, Oct 7, 2014 at 9:13 AM, MadasamySankarapandian 
 madas...@mcruncher.com wrote:

 
  This is regarding wicket-select2 project. I could not find any
   mailing
  list for this project. That is why sending here. Please some one
  help
me.
 
  I have created clear link to clear the form input values. After
  click
the
  clear link,  all components values are cleared except
 Select2Choice
  component.
 
  Here with attached quickstart to recreate this problem.
 
  Follow below steps to recreate this problem
 
  * Download attachment and extract it.
  * cd select2-quickstart.
  * Then execute mvn clean package jetty:run
  * Type localhost:8080 in browser
  * Give the input to name and country field.
  * Click clear link
 
  Now name(*TextField*) field value is cleared and
country(*Select2Choice*)
  field value is not cleared.
 
 
 
  --
  Thanks and regards
   Madasamy
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 

   
  
  
  
   --
   WBR
   Maxim aka solomax
  
 



 --
 WBR
 Maxim aka solomax




-- 
Thanks and regards
 Madasamy


Re: Could not clear select2Choice component model value.

2014-10-08 Thread Maxim Solodovnik
I also noticed this issue in our project,
Will try to take a look at it

On 9 October 2014 07:33, MadasamySankarapandian madas...@mcruncher.com
wrote:

 Thankyou very much for yours reply.

 I call formComponent.clearInput() in my ClearFormVisitor class. But It does
 not work.
 I have created issue-96
 https://github.com/ivaynberg/wicket-select2/issues/96 in wicket-select2
 project.






 On Wed, Oct 8, 2014 at 12:13 AM, Maxim Solodovnik solomax...@gmail.com
 wrote:

  Done, thanks for pointing this out
 
  On 7 October 2014 23:08, Paul Bors p...@bors.ws wrote:
 
   Can you update this issue then?
  
   https://github.com/ivaynberg/wicket-select2/issues/93
  
   On Tue, Oct 7, 2014 at 12:00 PM, Maxim Solodovnik 
 solomax...@gmail.com
   wrote:
  
we recently moved this component to wicketstuff:
   
   
  
 
 https://github.com/wicketstuff/core/tree/master/jdk-1.7-parent/select2-parent
   
to get Wicket7 compatible version
   
   
On 7 October 2014 22:56, Paul Bors p...@bors.ws wrote:
   
 You can also ask the developer via:
 https://github.com/ivaynberg/wicket-select2/issues

 You should probably take a look over the open issues so that you
 are
 familiar with that other developers faced. Maybe one of those
 issues
might
 be a road block for you?

 Although you will get a faster reply from Igor or another Wicket
developer
 via this list :)

 On Tue, Oct 7, 2014 at 4:23 AM, Martin Grigorov 
  mgrigo...@apache.org
 wrote:

  Hi,
 
  You should call formComponent.clearInput() too.
 
  Martin Grigorov
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
  On Tue, Oct 7, 2014 at 9:13 AM, MadasamySankarapandian 
  madas...@mcruncher.com wrote:
 
  
   This is regarding wicket-select2 project. I could not find any
mailing
   list for this project. That is why sending here. Please some
 one
   help
 me.
  
   I have created clear link to clear the form input values. After
   click
 the
   clear link,  all components values are cleared except
  Select2Choice
   component.
  
   Here with attached quickstart to recreate this problem.
  
   Follow below steps to recreate this problem
  
   * Download attachment and extract it.
   * cd select2-quickstart.
   * Then execute mvn clean package jetty:run
   * Type localhost:8080 in browser
   * Give the input to name and country field.
   * Click clear link
  
   Now name(*TextField*) field value is cleared and
 country(*Select2Choice*)
   field value is not cleared.
  
  
  
   --
   Thanks and regards
Madasamy
  
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
 

   
   
   
--
WBR
Maxim aka solomax
   
  
 
 
 
  --
  WBR
  Maxim aka solomax
 



 --
 Thanks and regards
  Madasamy




-- 
WBR
Maxim aka solomax